From 98fe7ec81d575a97dbc30ee4b0177b0f6964e45a Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 8 Nov 2023 19:30:38 +0000 Subject: More minor cleanup in rsa_alg_set_oaep_padding() Test and assign one more instance replace a useless comment by an empty line. --- src/lib/libcrypto/rsa/rsa_ameth.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/rsa/rsa_ameth.c b/src/lib/libcrypto/rsa/rsa_ameth.c index cbdf7a36e9..b5e96be61c 100644 --- a/src/lib/libcrypto/rsa/rsa_ameth.c +++ b/src/lib/libcrypto/rsa/rsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_ameth.c,v 1.48 2023/11/08 19:14:43 tb Exp $ */ +/* $OpenBSD: rsa_ameth.c,v 1.49 2023/11/08 19:30:38 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -938,8 +938,7 @@ rsa_alg_set_oaep_padding(X509_ALGOR *alg, EVP_PKEY_CTX *pkey_ctx) /* XXX - why do we not set oaep->maskHash here? */ if (labellen > 0) { - oaep->pSourceFunc = X509_ALGOR_new(); - if (oaep->pSourceFunc == NULL) + if ((oaep->pSourceFunc = X509_ALGOR_new()) == NULL) goto err; if ((ostr = ASN1_OCTET_STRING_new()) == NULL) goto err; @@ -949,7 +948,7 @@ rsa_alg_set_oaep_padding(X509_ALGOR *alg, EVP_PKEY_CTX *pkey_ctx) V_ASN1_OCTET_STRING, ostr); ostr = NULL; } - /* create string with pss parameter encoding. */ + if ((astr = ASN1_item_pack(oaep, &RSA_OAEP_PARAMS_it, NULL)) == NULL) goto err; X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaesOaep), V_ASN1_SEQUENCE, astr); -- cgit v1.2.3-55-g6feb