From: tb Date: Wed, 1 Nov 2023 20:41:12 +0000 (+0000) Subject: Use X509_ALGOR_set0_by_nid() in X509_ALGOR_set_evp_md() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d781822394e40621101778573b197bbb39bc8d5b;p=openbsd Use X509_ALGOR_set0_by_nid() in X509_ALGOR_set_evp_md() ok jsing --- diff --git a/lib/libcrypto/asn1/x_algor.c b/lib/libcrypto/asn1/x_algor.c index 5ad1263b278..d9a6cf9d8ea 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.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