]> git.ipfire.org Git - thirdparty/strongswan.git/commit
signature-params: Reject RSASSA-PSS params that result in negative salt len
authorTobias Brunner <tobias@strongswan.org>
Tue, 28 Sep 2021 15:52:08 +0000 (17:52 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 14 Oct 2021 16:59:07 +0000 (18:59 +0200)
commit03fbceb3f5f614426b0589072b3387360659a7be
tree6e4eb2923205abd9df0ef72d8d10c9832fc3fd6d
parent2403154f95fcbecdb2d25bf70f28bf83c5981b05
signature-params: Reject RSASSA-PSS params that result in negative salt len

The `salt_len` member in the struct is of type `ssize_t` because we use
negative values for special automatic salt lengths when generating
signatures.  This change ensures that `salt_len` will not overflow the
`len` fields of chunks (`size_t`), which could lead to integer overflows
when validating signatures (see the next commit).

Fixes: a22316520b91 ("signature-params: Add functions to parse/build ASN.1 RSASSA-PSS params")
src/libstrongswan/credentials/keys/signature_params.c
src/libstrongswan/tests/suites/test_signature_params.c