diff options
| author | miod <> | 2014-10-07 04:58:50 +0000 |
|---|---|---|
| committer | miod <> | 2014-10-07 04:58:50 +0000 |
| commit | fc88184af22bdbd69772cde657e6e4ff86eda1ee (patch) | |
| tree | d395a47a13e0d018cda8d9f6316067e7140163b8 | |
| parent | b8ea56ba39db54b0bb78d6ef58410baefac7add0 (diff) | |
| download | openbsd-fc88184af22bdbd69772cde657e6e4ff86eda1ee.tar.gz openbsd-fc88184af22bdbd69772cde657e6e4ff86eda1ee.tar.bz2 openbsd-fc88184af22bdbd69772cde657e6e4ff86eda1ee.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.c | 10 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/ec/ec_ameth.c | 10 |
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) | |||
| 393 | static int | 393 | static int |
| 394 | ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from) | 394 | ec_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 | ||
| 405 | static int | 399 | static 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) | |||
| 393 | static int | 393 | static int |
| 394 | ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from) | 394 | ec_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 | ||
| 405 | static int | 399 | static int |
