692 char *res_hash = dav_get_property_ns(res, DAV_NS, "crypto-hash"); |
692 char *res_hash = dav_get_property_ns(res, DAV_NS, "crypto-hash"); |
693 |
693 |
694 if(res_hash) { |
694 if(res_hash) { |
695 size_t len = 0; |
695 size_t len = 0; |
696 char *dec_hash = aes_decrypt(res_hash, &len, key); |
696 char *dec_hash = aes_decrypt(res_hash, &len, key); |
697 char *hex_hash = util_hexstr(dec_hash, 32); |
697 char *hex_hash = util_hexstr((unsigned char*)dec_hash, 32); |
698 if(strcmp(hash, hex_hash)) { |
698 if(strcmp(hash, hex_hash)) { |
699 verify_failed = 1; |
699 verify_failed = 1; |
700 } |
700 } |
701 free(dec_hash); |
701 free(dec_hash); |
702 free(hex_hash); |
702 free(hex_hash); |