diff options
-rw-r--r-- | src/libstrongswan/credentials/keys/signature_params.c | 6 | ||||
-rw-r--r-- | src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/libstrongswan/credentials/keys/signature_params.c b/src/libstrongswan/credentials/keys/signature_params.c index d89bd2c96..837de8443 100644 --- a/src/libstrongswan/credentials/keys/signature_params.c +++ b/src/libstrongswan/credentials/keys/signature_params.c @@ -322,7 +322,11 @@ bool rsa_pss_params_parse(chunk_t asn1, int level0, rsa_pss_params_t *params) case RSASSA_PSS_PARAMS_SALT_LEN: if (object.len) { - params->salt_len = (size_t)asn1_parse_integer_uint64(object); + params->salt_len = (ssize_t)asn1_parse_integer_uint64(object); + if (params->salt_len < 0) + { + goto end; + } } break; case RSASSA_PSS_PARAMS_TRAILER: diff --git a/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c b/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c index f9bd1d314..3a7750908 100644 --- a/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c +++ b/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c @@ -168,7 +168,7 @@ static bool verify_emsa_pss_signature(private_gmp_rsa_public_key_t *this, int i; bool success = FALSE; - if (!params) + if (!params || params->salt_len < 0) { return FALSE; } |