]> git.ipfire.org Git - thirdparty/strongswan.git/commit
gmp: Reject RSASSA-PSS signatures with negative salt length
authorTobias Brunner <tobias@strongswan.org>
Tue, 28 Sep 2021 16:00:01 +0000 (18:00 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 14 Oct 2021 16:59:07 +0000 (18:59 +0200)
commit234302a108b490635fb961ebd1404340c46cefc3
treeb651a6f5f756a3cf2a8e9560e383d559b4c8dbfd
parent03fbceb3f5f614426b0589072b3387360659a7be
gmp: Reject RSASSA-PSS signatures with negative salt length

The `salt_len` field is signed because negative values are used to indicate
automatic salt lengths when generating signatures.  This must never be the
case when validating them.

Not checking this could lead to an integer overflow below.  The value is
assigned to the `len` field of a chunk (`size_t`), which is further used
in calculations to check the padding structure and (if that is passed by
a matching crafted signature value) eventually a memcpy() that will result
in a segmentation fault.

Fixes: 7d6b81648b2d ("gmp: Add support for RSASSA-PSS signature verification")
Fixes: CVE-2021-41990
src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c