Navigation Menu

Skip to content

Commit

Permalink
signature-params: Properly handle MGF1 algorithm identifier without p…
Browse files Browse the repository at this point in the history
…arameters

Credit to OSS-Fuzz.

Fixes: CVE-2018-6459
  • Loading branch information
tobiasbrunner committed Feb 19, 2018
1 parent 0bb4d21 commit 40da179
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libstrongswan/credentials/keys/signature_params.c
Expand Up @@ -280,13 +280,17 @@ bool rsa_pss_params_parse(chunk_t asn1, int level0, rsa_pss_params_t *params)
case RSASSA_PSS_PARAMS_MGF_ALG:
if (object.len)
{
chunk_t hash;
chunk_t hash = chunk_empty;

alg = asn1_parse_algorithmIdentifier(object, level, &hash);
if (alg != OID_MGF1)
{
goto end;
}
if (!hash.len)
{
goto end;
}
alg = asn1_parse_algorithmIdentifier(hash, level+1, NULL);
params->mgf1_hash = hasher_algorithm_from_oid(alg);
if (params->mgf1_hash == HASH_UNKNOWN)
Expand Down

0 comments on commit 40da179

Please sign in to comment.