diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-01-04 15:16:20 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-01-04 15:16:20 +0000 |
commit | 00f473b3cc959d598ce7676f16b3dcdf01b88014 (patch) | |
tree | 62cf37703fcebdc91a7a3780ebc6d10043d1faaa /engines | |
parent | 356de7146edff8aef5ef2ddaa96fa0c9f7332e61 (diff) |
Check GOST parameters are not NULL (CVE-2012-0027)
Diffstat (limited to 'engines')
-rw-r--r-- | engines/ccgost/gost2001_keyx.c | 4 | ||||
-rw-r--r-- | engines/ccgost/gost94_keyx.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/engines/ccgost/gost2001_keyx.c b/engines/ccgost/gost2001_keyx.c index 00759bcab0..c748102857 100644 --- a/engines/ccgost/gost2001_keyx.c +++ b/engines/ccgost/gost2001_keyx.c @@ -280,6 +280,10 @@ int pkey_GOST01cp_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key, size_t * key_l } param = get_encryption_params(gkt->key_agreement_info->cipher); + if(!param){ + goto err; + } + gost_init(&ctx,param->sblock); OPENSSL_assert(gkt->key_agreement_info->eph_iv->length==8); memcpy(wrappedKey,gkt->key_agreement_info->eph_iv->data,8); diff --git a/engines/ccgost/gost94_keyx.c b/engines/ccgost/gost94_keyx.c index 624be586a5..0d7d3ffe6a 100644 --- a/engines/ccgost/gost94_keyx.c +++ b/engines/ccgost/gost94_keyx.c @@ -261,6 +261,10 @@ int pkey_GOST94cp_decrypt(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *key_len } param = get_encryption_params(gkt->key_agreement_info->cipher); + if(!param){ + goto err; + } + gost_init(&cctx,param->sblock); OPENSSL_assert(gkt->key_agreement_info->eph_iv->length==8); memcpy(wrappedKey,gkt->key_agreement_info->eph_iv->data,8); |