853 char *res_hash = dav_get_string_property_ns(res, DAV_NS, "crypto-hash"); |
853 char *res_hash = dav_get_string_property_ns(res, DAV_NS, "crypto-hash"); |
854 |
854 |
855 if(res_hash) { |
855 if(res_hash) { |
856 size_t len = 0; |
856 size_t len = 0; |
857 char *dec_hash = aes_decrypt(res_hash, &len, key); |
857 char *dec_hash = aes_decrypt(res_hash, &len, key); |
858 char *hex_hash = util_hexstr((unsigned char*)dec_hash, 32); |
858 char *hex_hash = util_hexstr((unsigned char*)dec_hash, len); |
859 if(strcmp(hash, hex_hash)) { |
859 if(strcmp(hash, hex_hash)) { |
860 verify_failed = 1; |
860 verify_failed = 1; |
861 } |
861 } |
862 free(dec_hash); |
862 free(dec_hash); |
863 free(hex_hash); |
863 free(hex_hash); |