diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-13 14:28:52 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-13 14:28:52 +0300 |
commit | b30024d2bd5a4d91a9efacdadfd02d7c9a7839f4 (patch) | |
tree | bbef6a71b8c900148fd6a1c4c433ab7219eaa1d6 | |
parent | 3cbccbaf99fde94477f1a32a7f4dab36d061e2ca (diff) | |
download | apk-tools-b30024d2bd5a4d91a9efacdadfd02d7c9a7839f4.tar.gz apk-tools-b30024d2bd5a4d91a9efacdadfd02d7c9a7839f4.tar.bz2 apk-tools-b30024d2bd5a4d91a9efacdadfd02d7c9a7839f4.tar.xz apk-tools-b30024d2bd5a4d91a9efacdadfd02d7c9a7839f4.zip |
openssl: register engines, and use oneshot digest when possible
to actually get hardware acceleration if available.
-rw-r--r-- | src/apk.c | 1 | ||||
-rw-r--r-- | src/apk_csum.h | 6 |
2 files changed, 2 insertions, 5 deletions
@@ -255,6 +255,7 @@ static void init_openssl(void) OpenSSL_add_all_algorithms(); #ifndef OPENSSL_NO_ENGINE ENGINE_load_builtin_engines(); + ENGINE_register_all_complete(); #endif } diff --git a/src/apk_csum.h b/src/apk_csum.h index 564339b..f2335d3 100644 --- a/src/apk_csum.h +++ b/src/apk_csum.h @@ -43,11 +43,7 @@ static inline int csum_valid(csum_p csum) static inline void csum_blob(apk_blob_t blob, csum_p csum) { - csum_ctx_t ctx; - - csum_init(&ctx); - csum_process(&ctx, (csum_p) blob.ptr, blob.len); - csum_finish(&ctx, csum); + EVP_Digest(blob.ptr, blob.len, csum, NULL, EVP_md5(), NULL); } #endif |