diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-03-11 19:27:03 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-03-11 19:27:03 +0000 |
commit | e62774c3b97b4bf837d0777d7851df67f776d775 (patch) | |
tree | 085d70ebfaef9659d08549dc56f902a620562eef /crypto/rsa | |
parent | f093794e5510190997b49f4617b805e25473df4e (diff) |
alg2 can be NULL
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_ameth.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index dcf4a12585..4daeca18a9 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -617,13 +617,16 @@ static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, /* Finally create string with pss parameter encoding. */ if (!ASN1_item_pack(pss, ASN1_ITEM_rptr(RSA_PSS_PARAMS), &os1)) goto err; - os2 = ASN1_STRING_dup(os1); - if (!os2) - goto err; + if (alg2) + { + os2 = ASN1_STRING_dup(os1); + if (!os2) + goto err; + X509_ALGOR_set0(alg2, OBJ_nid2obj(NID_rsassaPss), + V_ASN1_SEQUENCE, os2); + } X509_ALGOR_set0(alg1, OBJ_nid2obj(NID_rsassaPss), V_ASN1_SEQUENCE, os1); - X509_ALGOR_set0(alg2, OBJ_nid2obj(NID_rsassaPss), - V_ASN1_SEQUENCE, os2); os1 = os2 = NULL; rv = 3; err: |