summaryrefslogtreecommitdiff
path: root/src/apk_crypto.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/apk_crypto.h')
-rw-r--r--src/apk_crypto.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/apk_crypto.h b/src/apk_crypto.h
index 4697901..6f6e801 100644
--- a/src/apk_crypto.h
+++ b/src/apk_crypto.h
@@ -85,7 +85,9 @@ static inline int apk_digest_ctx_init(struct apk_digest_ctx *dctx, uint8_t alg)
dctx->mdctx = EVP_MD_CTX_new();
if (!dctx->mdctx) return -ENOMEM;
dctx->alg = alg;
+#ifdef EVP_MD_CTX_FLAG_FINALISE
EVP_MD_CTX_set_flags(dctx->mdctx, EVP_MD_CTX_FLAG_FINALISE);
+#endif
EVP_DigestInit_ex(dctx->mdctx, apk_digest_alg_to_evp(alg), 0);
return 0;
}