summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiod <>2014-10-07 04:58:50 +0000
committermiod <>2014-10-07 04:58:50 +0000
commit93f7d0ffdf10b7d5b4a44864db24f6cbfac925c1 (patch)
treed395a47a13e0d018cda8d9f6316067e7140163b8
parent9f002a02695c03cc68e80c6df9e37bca5b58ecfa (diff)
downloadopenbsd-93f7d0ffdf10b7d5b4a44864db24f6cbfac925c1.tar.gz
openbsd-93f7d0ffdf10b7d5b4a44864db24f6cbfac925c1.tar.bz2
openbsd-93f7d0ffdf10b7d5b4a44864db24f6cbfac925c1.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@
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c10
-rw-r--r--src/lib/libssl/src/crypto/ec/ec_ameth.c10
2 files changed, 4 insertions, 16 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 6b4dfdec46..b4ae1c0623 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.13 2014/07/13 15:47:51 logan Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.14 2014/10/07 04:58:50 miod Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -393,13 +393,7 @@ ec_missing_parameters(const EVP_PKEY * pkey)
393static int 393static int
394ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from) 394ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from)
395{ 395{
396 EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec)); 396 return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec));
397 if (group == NULL)
398 return 0;
399 if (EC_KEY_set_group(to->pkey.ec, group) == 0)
400 return 0;
401 EC_GROUP_free(group);
402 return 1;
403} 397}
404 398
405static int 399static int
diff --git a/src/lib/libssl/src/crypto/ec/ec_ameth.c b/src/lib/libssl/src/crypto/ec/ec_ameth.c
index 6b4dfdec46..b4ae1c0623 100644
--- a/src/lib/libssl/src/crypto/ec/ec_ameth.c
+++ b/src/lib/libssl/src/crypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.13 2014/07/13 15:47:51 logan Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.14 2014/10/07 04:58:50 miod Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -393,13 +393,7 @@ ec_missing_parameters(const EVP_PKEY * pkey)
393static int 393static int
394ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from) 394ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from)
395{ 395{
396 EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec)); 396 return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec));
397 if (group == NULL)
398 return 0;
399 if (EC_KEY_set_group(to->pkey.ec, group) == 0)
400 return 0;
401 EC_GROUP_free(group);
402 return 1;
403} 397}
404 398
405static int 399static int