summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_digest.c
diff options
context:
space:
mode:
authortb <>2024-02-18 15:45:42 +0000
committertb <>2024-02-18 15:45:42 +0000
commit46825b346de88f3d8b554aef8711f11431f7e17c (patch)
tree9047d6e85fd9fcd495ed303a0ed1b208200ff841 /src/lib/libcrypto/evp/evp_digest.c
parent39b6299876ec6c908309c9f47f3940eb84b3be12 (diff)
downloadopenbsd-46825b346de88f3d8b554aef8711f11431f7e17c.tar.gz
openbsd-46825b346de88f3d8b554aef8711f11431f7e17c.tar.bz2
openbsd-46825b346de88f3d8b554aef8711f11431f7e17c.zip
Use EVP_MD_CTX_legacy_clear() internally
ok jsing
Diffstat (limited to 'src/lib/libcrypto/evp/evp_digest.c')
-rw-r--r--src/lib/libcrypto/evp/evp_digest.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/evp_digest.c b/src/lib/libcrypto/evp/evp_digest.c
index 33ba923e72..3a349ad0e6 100644
--- a/src/lib/libcrypto/evp/evp_digest.c
+++ b/src/lib/libcrypto/evp/evp_digest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_digest.c,v 1.9 2024/02/18 15:43:21 tb Exp $ */ 1/* $OpenBSD: evp_digest.c,v 1.10 2024/02/18 15:45:42 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -123,7 +123,7 @@
123int 123int
124EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) 124EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
125{ 125{
126 EVP_MD_CTX_init(ctx); 126 EVP_MD_CTX_legacy_clear(ctx);
127 return EVP_DigestInit_ex(ctx, type, NULL); 127 return EVP_DigestInit_ex(ctx, type, NULL);
128} 128}
129 129
@@ -207,7 +207,7 @@ EVP_Digest(const void *data, size_t count,
207 EVP_MD_CTX ctx; 207 EVP_MD_CTX ctx;
208 int ret; 208 int ret;
209 209
210 EVP_MD_CTX_init(&ctx); 210 EVP_MD_CTX_legacy_clear(&ctx);
211 EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_ONESHOT); 211 EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_ONESHOT);
212 ret = EVP_DigestInit_ex(&ctx, type, NULL) && 212 ret = EVP_DigestInit_ex(&ctx, type, NULL) &&
213 EVP_DigestUpdate(&ctx, data, count) && 213 EVP_DigestUpdate(&ctx, data, count) &&
@@ -294,7 +294,7 @@ EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
294int 294int
295EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) 295EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
296{ 296{
297 EVP_MD_CTX_init(out); 297 EVP_MD_CTX_legacy_clear(out);
298 return EVP_MD_CTX_copy_ex(out, in); 298 return EVP_MD_CTX_copy_ex(out, in);
299} 299}
300 300