diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-10-07 04:58:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-10-07 04:58:51 +0000 |
commit | 28334dde54a4dedbbefc715d0363711e877257f1 (patch) | |
tree | 0becb30b164b6c67ce5539672b98690a91165dab /lib | |
parent | 1238b990bf7058667f9931bbf43e478452620d15 (diff) |
EC_KEY_set_group() does an EC_GROUP_dup() of its argument, so we don't
need to do it in ec_copy_parameters() prior to invoking EC_KEY_set_group().
ok doug@ jsing@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/crypto/ec/ec_ameth.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libssl/src/crypto/ec/ec_ameth.c b/lib/libssl/src/crypto/ec/ec_ameth.c index 6b4dfdec46a..b4ae1c06237 100644 --- a/lib/libssl/src/crypto/ec/ec_ameth.c +++ b/lib/libssl/src/crypto/ec/ec_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_ameth.c,v 1.13 2014/07/13 15:47:51 logan Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.14 2014/10/07 04:58:50 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -393,13 +393,7 @@ ec_missing_parameters(const EVP_PKEY * pkey) static int ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from) { - EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec)); - if (group == NULL) - return 0; - if (EC_KEY_set_group(to->pkey.ec, group) == 0) - return 0; - EC_GROUP_free(group); - return 1; + return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec)); } static int |