Skip to content

Commit f1de9ac

Browse files
committed
Merge tag 'v6.6-p5' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu: "Fix a 6.5 regression in crypto/asymmetric_keys" * tag 'v6.6-p5' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: KEYS: asymmetric: Fix sign/verify on pkcs1pad without a hash
2 parents 5722119 + b119503 commit f1de9ac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crypto/asymmetric_keys/public_key.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@ software_key_determine_akcipher(const struct public_key *pkey,
8181
* RSA signatures usually use EMSA-PKCS1-1_5 [RFC3447 sec 8.2].
8282
*/
8383
if (strcmp(encoding, "pkcs1") == 0) {
84+
*sig = op == kernel_pkey_sign ||
85+
op == kernel_pkey_verify;
8486
if (!hash_algo) {
85-
*sig = false;
8687
n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME,
8788
"pkcs1pad(%s)",
8889
pkey->pkey_algo);
8990
} else {
90-
*sig = op == kernel_pkey_sign ||
91-
op == kernel_pkey_verify;
9291
n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME,
9392
"pkcs1pad(%s,%s)",
9493
pkey->pkey_algo, hash_algo);

0 commit comments

Comments
 (0)