From b30024d2bd5a4d91a9efacdadfd02d7c9a7839f4 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Mon, 13 Jul 2009 14:28:52 +0300 Subject: openssl: register engines, and use oneshot digest when possible to actually get hardware acceleration if available. --- src/apk.c | 1 + src/apk_csum.h | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/apk.c b/src/apk.c index 93be9df..cd6cd91 100644 --- a/src/apk.c +++ b/src/apk.c @@ -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 -- cgit v1.2.3-70-g09d2