summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index c28ab18fc0..2b5abbd4bb 100644
--- a/src/lib/libcrypto/ec/ec_lib.c
+++ b/src/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_lib.c,v 1.19 2015/09/10 15:56:25 jsing Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.20 2015/10/13 15:25:18 jsing Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -1102,3 +1102,19 @@ EC_GROUP_have_precompute_mult(const EC_GROUP * group)
1102 return 0; /* cannot tell whether precomputation has 1102 return 0; /* cannot tell whether precomputation has
1103 * been performed */ 1103 * been performed */
1104} 1104}
1105
1106EC_KEY *
1107ECParameters_dup(EC_KEY *key)
1108{
1109 unsigned char *p = NULL;
1110 EC_KEY *k = NULL;
1111 int len;
1112
1113 if (key == NULL)
1114 return (NULL);
1115
1116 if ((len = i2d_ECParameters(key, &p)) > 0)
1117 k = d2i_ECParameters(NULL, (const unsigned char **)&p, len);
1118
1119 return (k);
1120}