]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/rsa/rsa_lib.c
rsa_get0_all_params(): Allow zero CRT params
[thirdparty/openssl.git] / crypto / rsa / rsa_lib.c
index 39d7f5f54afbd0d8e6dbbc82f780734d63302eb9..08ce8b4ef81efd4d4f7cf36eed9cb6457eee5d1c 100644 (file)
@@ -780,6 +780,10 @@ int rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
     if (r == NULL)
         return 0;
 
+    /* If |p| is NULL, there are no CRT parameters */
+    if (RSA_get0_p(r) == NULL)
+        return 1;
+
     sk_BIGNUM_const_push(primes, RSA_get0_p(r));
     sk_BIGNUM_const_push(primes, RSA_get0_q(r));
     sk_BIGNUM_const_push(exps, RSA_get0_dmp1(r));