libseckey: Fix incorrect flag checking related to RSA X9.31

Use a bit-wise AND, not a logical AND to mask the flag out of the flags
field.

Assisted-by: IBM Bob:2.0.0
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2026-06-30 15:23:55 +02:00
committed by Jan Höppner
parent b1d44876bd
commit cf51aa1421

View File

@@ -708,7 +708,7 @@ static int sk_ep11_rsa_sign(const unsigned char *key_token,
case RSA_X931_PADDING:
mech.mechanism = CKM_RSA_X9_31;
if ((hdr->flags && PKEY_TYPE_EP11_FLAG_X9_31) == 0) {
if ((hdr->flags & PKEY_TYPE_EP11_FLAG_X9_31) == 0) {
sk_debug(debug, "ERROR: no RSA X9.31 key");
return -EINVAL;
}