diff options
author | Vignesh Raghavendra <vigneshr@ti.com> | 2022-09-07 22:32:45 +0530 |
---|---|---|
committer | Vignesh Raghavendra <vigneshr@ti.com> | 2022-09-07 22:32:45 +0530 |
commit | 86de41e58edb56eb92da5de21a6d053cac7ed1a2 (patch) | |
tree | 70855f76c375ddc8e140f5f32a8b97a06dfd1e92 /crypto | |
parent | f9344bef79dc600e7c3651e4f4a3c5b196614f87 (diff) | |
parent | 18ed766f3642fa75262885462d3052ad7c8c87a2 (diff) |
Merge tag 'v5.10.140' of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux into ti-linux-5.10.y-cicd
This is the 5.10.140 stable release
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmMPexEACgkQONu9yGCS
# aT7SIg//QPmoJq2ho7oqDXzdxW67Eay3QZEPDoBol34RxEXoAUpxFB1nQlC3u1aI
# OyPNXqQSPkObkXRMAVYStTZWgN3iUngorbsDOM+svGpAxt9zC/6d7JGNdhstaQLG
# p/OoWaV7qwnNUsvndhohdmwU9TqjwpbvQwSa570uWQ47nIoxMyIz0iR80GjBSNGf
# a2QiJg4OsaVxqxoySB6I6qAceRMbLOZVxW6p963IYC9Fj4j1NmhsPDIy95aidEN5
# RG+Ng9GnuYRo0ktlhSje9YKyE5bYhUNCi6GWsCyArAFo0db/2GzRFweZRy5w7MC/
# IaFQf93pDZinIBfDJliXfFMBx4YLdI3IHdtILPJvF7d1U5n6pG44knrPkPHzNouf
# Ife8SckAPLzZeffobIcOXgoZqM3Xj/5mpHWffPQ2wIpL0ylf4bshPiC8mIRoyblh
# ufrzUV6r7uBesp18c6nhjwAKgNVaw4w9+CpDk0qLlDELKNfENJ9wMRAJpcifYJKL
# jJVWJh2wXG4kBWbp/2SetMkNNEeqn/PQUVY843uRE2iE76J2lzly5/+gI4DsSN6+
# z2ZQL5tzguZvLw0s+si+doU+orbpzXluJncNdJyw8+1A7J2kxSn/Xfks9X3BKDyi
# 69pxUx627rMJZi4Pwsc1tyoeTVj32EAmUqronHD9tsQKsujIX0M=
# =DO69
# -----END PGP SIGNATURE-----
* tag 'v5.10.140' of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux: (1242 commits)
Linux 5.10.140
bpf: Don't use tnum_range on array range checking for poke descriptors
scsi: storvsc: Remove WQ_MEM_RECLAIM from storvsc_error_wq
scsi: ufs: core: Enable link lost interrupt
perf/x86/intel/uncore: Fix broken read_counter() for SNB IMC PMU
perf python: Fix build when PYTHON_CONFIG is user supplied
blk-mq: fix io hung due to missing commit_rqs
Documentation/ABI: Mention retbleed vulnerability info file for sysfs
arm64: Fix match_list for erratum 1286807 on Arm Cortex-A76
md: call __md_stop_writes in md_stop
Revert "md-raid: destroy the bitmap after destroying the thread"
mm/hugetlb: fix hugetlb not supporting softdirty tracking
xen/privcmd: fix error exit of privcmd_ioctl_dm_op()
ACPI: processor: Remove freq Qos request for all CPUs
s390: fix double free of GS and RI CBs on fork() failure
asm-generic: sections: refactor memory_intersects
loop: Check for overflow while configuring loop
x86/bugs: Add "unknown" reporting for MMIO Stale Data
x86/unwind/orc: Unwind ftrace trampolines with correct ORC entry
perf/x86/lbr: Enable the branch type for the Arch LBR by default
...
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asymmetric_keys/public_key.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c index 788a4ba1e2e7..cf9b7ac36202 100644 --- a/crypto/asymmetric_keys/public_key.c +++ b/crypto/asymmetric_keys/public_key.c @@ -260,6 +260,10 @@ static int cert_sig_digest_update(const struct public_key_signature *sig, BUG_ON(!sig->data); + /* SM2 signatures always use the SM3 hash algorithm */ + if (!sig->hash_algo || strcmp(sig->hash_algo, "sm3") != 0) + return -EINVAL; + ret = sm2_compute_z_digest(tfm_pkey, SM2_DEFAULT_USERID, SM2_DEFAULT_USERID_LEN, dgst); if (ret) @@ -356,8 +360,7 @@ int public_key_verify_signature(const struct public_key *pkey, if (ret) goto error_free_key; - if (sig->pkey_algo && strcmp(sig->pkey_algo, "sm2") == 0 && - sig->data_size) { + if (strcmp(pkey->pkey_algo, "sm2") == 0 && sig->data_size) { ret = cert_sig_digest_update(sig, tfm); if (ret) goto error_free_key; |