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/ecdsa | |
parent | 25a58453ff5b73e7b4d5e2764d7924424694a82a (diff) |
add additional checks + cleanup
Submitted by: David Hartman <david_hartman@symantec.com>
Diffstat (limited to 'crypto/ecdsa')
-rw-r--r-- | crypto/ecdsa/ecs_lib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/ecdsa/ecs_lib.c b/crypto/ecdsa/ecs_lib.c index ab96a6dc9c..1fb9bc9600 100644 --- a/crypto/ecdsa/ecs_lib.c +++ b/crypto/ecdsa/ecs_lib.c @@ -206,10 +206,14 @@ int ECDSA_size(const EC_KEY *r) ASN1_INTEGER bs; BIGNUM *order=NULL; unsigned char buf[4]; - const EC_GROUP *group = EC_KEY_get0_group(r); + const EC_GROUP *group; - if (r == NULL || group == NULL) + if (r == NULL) + return 0; + group = EC_KEY_get0_group(r); + if (group == NULL) return 0; + if ((order = BN_new()) == NULL) return 0; if (!EC_GROUP_get_order(group,order,NULL)) { |