This push fixes a 6.5 regression in crypto/asymmetric_keys.

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEn51F/lCuNhUwmDeSxycdCkmxi6cFAmUvXwwACgkQxycdCkmx
 i6fX1hAAg+c2XOHo6sZcTGVK4JwIvTqNNnUL+8azLOYGfk+/I0f9RkMKSnDjZEfY
 LnIRHBpiuLhveNuYJsQBxab870dqMgVfxxQpVmCY7BkjTT5E3elUA5t82G9NBwcW
 I+Am2YLQAlbKumDtzGUnYxKmW2Q5p+XDY38rZWfH1quwqQFMnbQP4bprURJQ2ALb
 IYTbYo9s1PdRCO0cKpxNGlsJLXyhEDGOnR4+tt68N5NR8nKFfXL1BT6/sQHk10Px
 KTDD5gbkK82QmWmyH0sinXGFIECuee5hhkyh8Zt+mtnYPILBIPr5qNJ3QVmOhc/H
 xvsIBgrkdvb0Hiv3+t2RS38i6cjTYurOmdSviNCJhirh5C2A/ph7eMQWSq/h5blJ
 mUfM/wGa6aB8DnD+UfMyf5BvqNEj6UskicDWen3X9DqG7VGf2JHSapPKEjdCipfV
 4xJ6RFVI7/3K+KMLDvTKUFO7oIpM/BQLlW35I3B9Se2WaYwHM2nZ7aV7c1SMf7dn
 6D6O2WDh1og8dMG5+EImf4dK+RbCU39ynKYIffS7VI6qjUULGpdqjmN9qmhJJSYf
 ufAxNZRs5XNRZRjgUxA0FIjOQlJgPWBy7QNoqz1jAfeVCX59FhzXTxFEC+P/j0CO
 GxUl1lOeJE9Ye9QQ87/QdmyGd2qYez5hx9NSs03s2KUsobUStAE=
 =v00R
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2023-10-21 09:49:13 -07:00
commit f1de9aced8

View File

@ -81,14 +81,13 @@ software_key_determine_akcipher(const struct public_key *pkey,
* RSA signatures usually use EMSA-PKCS1-1_5 [RFC3447 sec 8.2].
*/
if (strcmp(encoding, "pkcs1") == 0) {
*sig = op == kernel_pkey_sign ||
op == kernel_pkey_verify;
if (!hash_algo) {
*sig = false;
n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME,
"pkcs1pad(%s)",
pkey->pkey_algo);
} else {
*sig = op == kernel_pkey_sign ||
op == kernel_pkey_verify;
n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME,
"pkcs1pad(%s,%s)",
pkey->pkey_algo, hash_algo);