summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-10-07 04:58:50 +0000
committermiod <miod@openbsd.org>2014-10-07 04:58:50 +0000
commit59593f803c31e2b1e8796b5e136dacf5d34f2a4f (patch)
tree2a7c2d664947c2dac30177593cbd1b30559c8498 /lib/libssl/src
parentRare to find a gem this amazing missed by tedu. (diff)
downloadwireguard-openbsd-59593f803c31e2b1e8796b5e136dacf5d34f2a4f.tar.xz
wireguard-openbsd-59593f803c31e2b1e8796b5e136dacf5d34f2a4f.zip
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/libssl/src')
-rw-r--r--lib/libssl/src/crypto/ec/ec_ameth.c10
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