Skip to content

Commit 67efa9a

Browse files
committed
provider: RSA: Fix get_params to retrieve max-size, bits, and security-bits
The RSA key management's get_params() function should be able to return the values for max-size, bits, and security-bits if at least the public key is available. The detection whether the key is 'empty', i.e. has neither the public nor the private key components was wrong. This leads to the fact that those parameters were not returned when only the public key was available. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
1 parent acba1d9 commit 67efa9a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/provider/rsa_keymgmt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,9 +1512,9 @@ static int ibmca_keymgmt_rsa_get_params(void *vkey, OSSL_PARAM params[])
15121512
for (parm = params; parm != NULL && parm->key != NULL; parm++)
15131513
ibmca_debug_key(key, "param: %s", parm->key);
15141514

1515-
empty = (!ibmca_keymgmt_rsa_pub_valid(&key->rsa.public) ||
1516-
(!ibmca_keymgmt_rsa_priv_crt_valid(&key->rsa.private_crt) &&
1517-
!ibmca_keymgmt_rsa_priv_me_valid(&key->rsa.private_me)));
1515+
empty = (!ibmca_keymgmt_rsa_pub_valid(&key->rsa.public) &&
1516+
!ibmca_keymgmt_rsa_priv_crt_valid(&key->rsa.private_crt) &&
1517+
!ibmca_keymgmt_rsa_priv_me_valid(&key->rsa.private_me));
15181518

15191519
if (!empty) {
15201520
/* OSSL_PKEY_PARAM_BITS */

0 commit comments

Comments
 (0)