]> git.ipfire.org Git - thirdparty/openssl.git/commit
s390x: Check and fail on invalid malformed ECDSA signatures
authorHolger Dengler <dengler@linux.ibm.com>
Wed, 26 Nov 2025 15:18:49 +0000 (16:18 +0100)
committerTomas Mraz <tomas@openssl.org>
Wed, 3 Dec 2025 13:32:07 +0000 (14:32 +0100)
commit8e28ea9e6244fb425b948780903a37cde338c2b4
tree51fdd01f141bd4fc41c9b43a55a6452ae1d965b2
parentbcaa2a3af60c3c1f282b621522bbc316341bf692
s390x: Check and fail on invalid malformed ECDSA signatures

Check parameters of ECDSA signatures on verify and fail for invalid
malformed signatures in the code path for s390x accelerators. Handle
condition code of kdsa instruction for detecting invalid parameters.

For NIST P521 curves, kdsa ignores completely the upper 14 bytes of
the sections for r and s in the parameter-block, so adapt the offset
and length for bignum conversions for these curves. This will detect
cases of malformed signatures which are not covered by the kdsa
parameter checking.

Fixes: #29173
Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29214)
crypto/ec/ecp_s390x_nistp.c