From 32c5b4f0c21cae06db8122932866fa5e18e065ee Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 1 Nov 2023 20:41:12 +0000 Subject: Use X509_ALGOR_set0_by_nid() in X509_ALGOR_set_evp_md() ok jsing --- src/lib/libcrypto/asn1/x_algor.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 5ad1263b27..d9a6cf9d8e 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.37 2023/11/01 20:37:42 tb Exp $ */ +/* $OpenBSD: x_algor.c,v 1.38 2023/11/01 20:41:12 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -256,16 +256,16 @@ X509_ALGOR_get0(const ASN1_OBJECT **out_aobj, int *out_type, int X509_ALGOR_set_evp_md(X509_ALGOR *alg, const EVP_MD *md) { - ASN1_OBJECT *aobj; - int param_type = V_ASN1_NULL; + int parameter_type = V_ASN1_NULL; + int nid = EVP_MD_type(md); if ((EVP_MD_flags(md) & EVP_MD_FLAG_DIGALGID_ABSENT) != 0) - param_type = V_ASN1_UNDEF; + parameter_type = V_ASN1_UNDEF; - if ((aobj = OBJ_nid2obj(EVP_MD_type(md))) == NULL) + if (!X509_ALGOR_set0_by_nid(alg, nid, parameter_type, NULL)) return 0; - return X509_ALGOR_set0(alg, aobj, param_type, NULL); + return 1; } void -- cgit v1.2.3-55-g6feb