From aac497e9019ec4429918921779e79cd530f6fb22 Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 12 Dec 2021 14:27:20 +0000 Subject: [PATCH] Rewrite X509_ALGOR_set_md() without reaching into EVP_MD. ok inoguchi schwarze --- lib/libcrypto/asn1/x_algor.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libcrypto/asn1/x_algor.c b/lib/libcrypto/asn1/x_algor.c index 2013de795d1..efb0c342aab 100644 --- a/lib/libcrypto/asn1/x_algor.c +++ b/lib/libcrypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.22 2018/05/01 19:01:27 tb Exp $ */ +/* $OpenBSD: x_algor.c,v 1.23 2021/12/12 14:27:20 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -197,12 +197,10 @@ X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) { - int param_type; + int param_type = V_ASN1_NULL; - if (md->flags & EVP_MD_FLAG_DIGALGID_ABSENT) + if ((EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT) != 0) param_type = V_ASN1_UNDEF; - else - param_type = V_ASN1_NULL; X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); } -- 2.20.1