libidav/resource.c

changeset 542
060a8cda7f62
parent 525
26a1d5b9d9d2
child 555
c9ada14ee90e
equal deleted inserted replaced
541:e59a989d890d 542:060a8cda7f62
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);

mercurial