662 enc, |
662 enc, |
663 (dav_read_func)aes_read, |
663 (dav_read_func)aes_read, |
664 0); |
664 0); |
665 |
665 |
666 // get sha256 hash |
666 // get sha256 hash |
667 unsigned char sha[SHA256_DIGEST_LENGTH]; |
667 unsigned char sha[DAV_SHA256_DIGEST_LENGTH]; |
668 dav_get_hash(&enc->sha256, sha); |
668 dav_get_hash(&enc->sha256, sha); |
669 char *enc_hash = aes_encrypt((char*)sha, SHA256_DIGEST_LENGTH, sn->key); |
669 char *enc_hash = aes_encrypt((char*)sha, DAV_SHA256_DIGEST_LENGTH, sn->key); |
670 |
670 |
671 aes_encrypter_close(enc); |
671 aes_encrypter_close(enc); |
672 if(buf) { |
672 if(buf) { |
673 ucx_buffer_free(buf); |
673 ucx_buffer_free(buf); |
674 } |
674 } |
770 char *hash = NULL; |
770 char *hash = NULL; |
771 if(dec) { |
771 if(dec) { |
772 aes_decrypter_shutdown(dec); // get final bytes |
772 aes_decrypter_shutdown(dec); // get final bytes |
773 |
773 |
774 // get hash |
774 // get hash |
775 unsigned char sha[SHA256_DIGEST_LENGTH]; |
775 unsigned char sha[DAV_SHA256_DIGEST_LENGTH]; |
776 dav_get_hash(&dec->sha256, sha); |
776 dav_get_hash(&dec->sha256, sha); |
777 hash = util_hexstr(sha, 32); |
777 hash = util_hexstr(sha, DAV_SHA256_DIGEST_LENGTH); |
778 |
778 |
779 aes_decrypter_close(dec); |
779 aes_decrypter_close(dec); |
780 } |
780 } |
781 |
781 |
782 long status = 0; |
782 long status = 0; |