-/* $OpenBSD: evp_digest.c,v 1.9 2024/02/18 15:43:21 tb Exp $ */
+/* $OpenBSD: evp_digest.c,v 1.10 2024/02/18 15:45:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int
EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
{
- EVP_MD_CTX_init(ctx);
+ EVP_MD_CTX_legacy_clear(ctx);
return EVP_DigestInit_ex(ctx, type, NULL);
}
EVP_MD_CTX ctx;
int ret;
- EVP_MD_CTX_init(&ctx);
+ EVP_MD_CTX_legacy_clear(&ctx);
EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_ONESHOT);
ret = EVP_DigestInit_ex(&ctx, type, NULL) &&
EVP_DigestUpdate(&ctx, data, count) &&
int
EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
{
- EVP_MD_CTX_init(out);
+ EVP_MD_CTX_legacy_clear(out);
return EVP_MD_CTX_copy_ex(out, in);
}
-/* $OpenBSD: evp_key.c,v 1.33 2024/01/05 10:18:52 tb Exp $ */
+/* $OpenBSD: evp_key.c,v 1.34 2024/02/18 15:45:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (data == NULL)
return nkey;
- EVP_MD_CTX_init(&c);
+ EVP_MD_CTX_legacy_clear(&c);
for (;;) {
if (!EVP_DigestInit_ex(&c, md, NULL))
goto err;
-/* $OpenBSD: evp_pbe.c,v 1.41 2024/02/01 17:11:58 tb Exp $ */
+/* $OpenBSD: evp_pbe.c,v 1.42 2024/02/18 15:45:42 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
else if (passlen == -1)
passlen = strlen(pass);
- EVP_MD_CTX_init(&ctx);
+ EVP_MD_CTX_legacy_clear(&ctx);
if (!EVP_DigestInit_ex(&ctx, md, NULL))
goto err;
-/* $OpenBSD: m_sigver.c,v 1.14 2023/11/29 21:35:57 tb Exp $ */
+/* $OpenBSD: m_sigver.c,v 1.15 2024/02/18 15:45:42 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
EVP_MD_CTX tmp_ctx;
unsigned char md[EVP_MAX_MD_SIZE];
unsigned int mdlen = 0;
- EVP_MD_CTX_init(&tmp_ctx);
+ EVP_MD_CTX_legacy_clear(&tmp_ctx);
if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx))
return 0;
if (sctx)
vctx = 1;
else
vctx = 0;
- EVP_MD_CTX_init(&tmp_ctx);
+ EVP_MD_CTX_legacy_clear(&tmp_ctx);
if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx))
return -1;
if (vctx) {
-/* $OpenBSD: p_sign.c,v 1.19 2023/07/07 19:37:54 beck Exp $ */
+/* $OpenBSD: p_sign.c,v 1.20 2024/02/18 15:45:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int ret = 0;
*siglen = 0;
- EVP_MD_CTX_init(&tmp_ctx);
+ EVP_MD_CTX_legacy_clear(&tmp_ctx);
if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx))
goto err;
if (!EVP_DigestFinal_ex(&tmp_ctx, &(m[0]), &m_len))
-/* $OpenBSD: p_verify.c,v 1.18 2023/07/07 19:37:54 beck Exp $ */
+/* $OpenBSD: p_verify.c,v 1.19 2024/02/18 15:45:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
EVP_PKEY_CTX *pkctx = NULL;
int ret = 0;
- EVP_MD_CTX_init(&tmp_ctx);
+ EVP_MD_CTX_legacy_clear(&tmp_ctx);
if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx))
goto err;
if (!EVP_DigestFinal_ex(&tmp_ctx, &(m[0]), &m_len))
-/* $OpenBSD: hmac.c,v 1.31 2023/02/16 08:38:17 tb Exp $ */
+/* $OpenBSD: hmac.c,v 1.32 2024/02/18 15:45:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
void
HMAC_CTX_init(HMAC_CTX *ctx)
{
- EVP_MD_CTX_init(&ctx->i_ctx);
- EVP_MD_CTX_init(&ctx->o_ctx);
- EVP_MD_CTX_init(&ctx->md_ctx);
+ EVP_MD_CTX_legacy_clear(&ctx->i_ctx);
+ EVP_MD_CTX_legacy_clear(&ctx->o_ctx);
+ EVP_MD_CTX_legacy_clear(&ctx->md_ctx);
ctx->md = NULL;
}
-/* $OpenBSD: pvkfmt.c,v 1.27 2023/07/07 13:40:44 beck Exp $ */
+/* $OpenBSD: pvkfmt.c,v 1.28 2024/02/18 15:45:42 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2005.
*/
EVP_MD_CTX mctx;
int rv = 1;
- EVP_MD_CTX_init(&mctx);
+ EVP_MD_CTX_legacy_clear(&mctx);
if (!EVP_DigestInit_ex(&mctx, EVP_sha1(), NULL) ||
!EVP_DigestUpdate(&mctx, salt, saltlen) ||
!EVP_DigestUpdate(&mctx, pass, passlen) ||
-/* $OpenBSD: pk7_doit.c,v 1.55 2024/01/25 13:44:08 tb Exp $ */
+/* $OpenBSD: pk7_doit.c,v 1.56 2024/02/18 15:45:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return 0;
}
- EVP_MD_CTX_init(&ctx_tmp);
+ EVP_MD_CTX_legacy_clear(&ctx_tmp);
i = OBJ_obj2nid(p7->type);
p7->state = PKCS7_S_HEADER;
if (md == NULL)
return 0;
- EVP_MD_CTX_init(&mctx);
+ EVP_MD_CTX_legacy_clear(&mctx);
if (EVP_DigestSignInit(&mctx, &pctx, md, NULL, si->pkey) <= 0)
goto err;
BIO *btmp;
EVP_PKEY *pkey;
- EVP_MD_CTX_init(&mdc_tmp);
+ EVP_MD_CTX_legacy_clear(&mdc_tmp);
if (!PKCS7_type_is_signed(p7) &&
!PKCS7_type_is_signedAndEnveloped(p7)) {
-/* $OpenBSD: rsa_oaep.c,v 1.37 2023/07/08 12:26:45 beck Exp $ */
+/* $OpenBSD: rsa_oaep.c,v 1.38 2024/02/18 15:45:42 tb Exp $ */
/*
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
*
int mdlen;
int rv = -1;
- EVP_MD_CTX_init(&c);
+ EVP_MD_CTX_legacy_clear(&c);
mdlen = EVP_MD_size(dgst);
if (mdlen < 0)
goto err;
-/* $OpenBSD: rsa_pss.c,v 1.17 2023/07/08 12:26:45 beck Exp $ */
+/* $OpenBSD: rsa_pss.c,v 1.18 2024/02/18 15:45:42 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2005.
*/
EVP_MD_CTX ctx;
unsigned char H_[EVP_MAX_MD_SIZE];
- EVP_MD_CTX_init(&ctx);
+ EVP_MD_CTX_legacy_clear(&ctx);
if (mgf1Hash == NULL)
mgf1Hash = Hash;
unsigned char *H, *salt = NULL, *p;
EVP_MD_CTX ctx;
- EVP_MD_CTX_init(&ctx);
+ EVP_MD_CTX_legacy_clear(&ctx);
if (mgf1Hash == NULL)
mgf1Hash = Hash;
-/* $OpenBSD: x509_cmp.c,v 1.42 2023/02/16 08:38:17 tb Exp $ */
+/* $OpenBSD: x509_cmp.c,v 1.43 2024/02/18 15:45:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
unsigned char md[16];
char *f;
- EVP_MD_CTX_init(&ctx);
+ EVP_MD_CTX_legacy_clear(&ctx);
f = X509_NAME_oneline(a->cert_info->issuer, NULL, 0);
if (f == NULL)
goto err;
/* Make sure X509_NAME structure contains valid cached encoding */
i2d_X509_NAME(x, NULL);
- EVP_MD_CTX_init(&md_ctx);
+ EVP_MD_CTX_legacy_clear(&md_ctx);
if (EVP_DigestInit_ex(&md_ctx, EVP_md5(), NULL) &&
EVP_DigestUpdate(&md_ctx, x->bytes->data, x->bytes->length) &&
EVP_DigestFinal_ex(&md_ctx, md, NULL))