[PATCH v5 0/2] KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()

From: Roberto Sassu
Date: Tue Dec 27 2022 - 09:28:51 EST


From: Roberto Sassu <roberto.sassu@xxxxxxxxxx>

Changelog:

v4:
- Replace sg_init_table()/sg_set_buf() with sg_init_one() (suggested by
Eric)

v3:

v2:
- Add patch by Herbert to take only the needed bytes for a MPI from the
scatterlist
- Use only one scatterlist for signature and digest (suggested by Eric)
- Rename key variable to buf (suggested by Eric)
- Rename key_max_len variable to buf_len
- Use size_t for the buf_len variable instead of u32

v1:
- Unconditionally copy the signature and digest to the buffer to keep the
code simple (suggested by Eric)

Herbert Xu (1):
lib/mpi: Fix buffer overrun when SG is too long

Roberto Sassu (1):
KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()

crypto/asymmetric_keys/public_key.c | 38 ++++++++++++++++-------------
lib/mpi/mpicoder.c | 3 ++-
2 files changed, 23 insertions(+), 18 deletions(-)

--
2.25.1