Don't truncate the input when decrypting in pkeyutl
authorMatt Caswell <matt@openssl.org>
Fri, 23 Jun 2023 10:50:17 +0000 (11:50 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 26 Jun 2023 08:35:01 +0000 (09:35 +0100)
commit8ebc73453746e5303d5249986e2e42e7937a67ad
treee59a9270ad71e07828bf9d2a05d999704b21c671
parent8d6ea2d2c3cfdb1f09898ee98362b057893e6f14
Don't truncate the input when decrypting in pkeyutl

The pkeyutl app was truncating the input file for decryption leading to
incorrect results. This was probably ok historically when RSA was being
used for decryption which has short maximum sizes. This is not ok with SM2.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21272)

(cherry picked from commit 849450746f38a5658ef783abb0a8c79ae2861464)
apps/lib/apps.c
apps/pkeyutl.c