From: tb Date: Thu, 9 Nov 2023 08:20:10 +0000 (+0000) Subject: Use X509_ALGOR_set0_by_nid() in rsa_mgf1md_to_maskGenAlgorithm() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6b23e18ab46e2a89db1d0a4515dee5986511cf9b;p=openbsd Use X509_ALGOR_set0_by_nid() in rsa_mgf1md_to_maskGenAlgorithm() ok jsing --- diff --git a/lib/libcrypto/rsa/rsa_ameth.c b/lib/libcrypto/rsa/rsa_ameth.c index b5e96be61c3..46681c63485 100644 --- a/lib/libcrypto/rsa/rsa_ameth.c +++ b/lib/libcrypto/rsa/rsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_ameth.c,v 1.49 2023/11/08 19:30:38 tb Exp $ */ +/* $OpenBSD: rsa_ameth.c,v 1.50 2023/11/09 08:20:10 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -616,7 +616,6 @@ rsa_mgf1md_to_maskGenAlgorithm(const EVP_MD *mgf1md, X509_ALGOR **out_alg) X509_ALGOR *alg = NULL; X509_ALGOR *inner_alg = NULL; ASN1_STRING *astr = NULL; - ASN1_OBJECT *aobj; int ret = 0; X509_ALGOR_free(*out_alg); @@ -634,9 +633,7 @@ rsa_mgf1md_to_maskGenAlgorithm(const EVP_MD *mgf1md, X509_ALGOR **out_alg) if ((alg = X509_ALGOR_new()) == NULL) goto err; - if ((aobj = OBJ_nid2obj(NID_mgf1)) == NULL) - goto err; - if (!X509_ALGOR_set0(alg, aobj, V_ASN1_SEQUENCE, astr)) + if (!X509_ALGOR_set0_by_nid(alg, NID_mgf1, V_ASN1_SEQUENCE, astr)) goto err; astr = NULL;