diff options
author | Nils Larsch <nils@openssl.org> | 2006-01-29 23:12:22 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2006-01-29 23:12:22 +0000 |
commit | 8c5a2bd6bb9a8c2bb3e1b63c03e57bb1115275d1 (patch) | |
tree | 6f47255125d6970ab07881a58be1e7df1e4e9490 /crypto/ec/ec_asn1.c | |
parent | 25a58453ff5b73e7b4d5e2764d7924424694a82a (diff) |
add additional checks + cleanup
Submitted by: David Hartman <david_hartman@symantec.com>
Diffstat (limited to 'crypto/ec/ec_asn1.c')
-rw-r--r-- | crypto/ec/ec_asn1.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c index 5693201a26..dec913b8ad 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c @@ -837,11 +837,6 @@ static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params) /* create the EC_GROUP structure */ ret = EC_GROUP_new_curve_GF2m(p, a, b, NULL); - if (ret == NULL) - { - ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB); - goto err; - } } else if (tmp == NID_X9_62_prime_field) { @@ -860,11 +855,17 @@ static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params) } /* create the EC_GROUP structure */ ret = EC_GROUP_new_curve_GFp(p, a, b, NULL); - if (ret == NULL) - { - ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB); - goto err; - } + } + else + { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_INVALID_FIELD); + goto err; + } + + if (ret == NULL) + { + ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_EC_LIB); + goto err; } /* extract seed (optional) */ |