aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/t_pkey.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2002-08-09 08:43:04 +0000
committerBodo Möller <bodo@openssl.org>2002-08-09 08:43:04 +0000
commite172d60ddbba3dd37748c8c468064c99213b9e60 (patch)
tree1ededc75b7669b610533758ac42f0ad91f59330b /crypto/asn1/t_pkey.c
parentf8fe7fa4913d34f33fac12181a0fc722ef367238 (diff)
downloadopenssl-e172d60ddbba3dd37748c8c468064c99213b9e60.tar.gz
Add ECDH support.
Additional changes: - use EC_GROUP_get_degree() in apps/req.c - add ECDSA and ECDH to apps/speed.c - adds support for EC curves over binary fields to ECDSA - new function EC_KEY_up_ref() in crypto/ec/ec_key.c - reorganize crypto/ecdsa/ecdsatest.c - add engine support for ECDH - fix a few bugs in ECDSA engine support Submitted by: Douglas Stebila <douglas.stebila@sun.com>
Diffstat (limited to 'crypto/asn1/t_pkey.c')
-rw-r--r--crypto/asn1/t_pkey.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c
index fb01e38d79..873b5d793c 100644
--- a/crypto/asn1/t_pkey.c
+++ b/crypto/asn1/t_pkey.c
@@ -55,6 +55,11 @@
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * Binary polynomial ECC support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
#include <stdio.h>
#include "cryptlib.h"
@@ -333,10 +338,21 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
goto err;
}
- if (!EC_GROUP_get_curve_GFp(x, p, a, b, ctx))
+ if (EC_METHOD_get_field_type(EC_GROUP_method_of(x)) == NID_X9_62_prime_field)
{
- reason = ERR_R_EC_LIB;
- goto err;
+ if (!EC_GROUP_get_curve_GFp(x, p, a, b, ctx))
+ {
+ reason = ERR_R_EC_LIB;
+ goto err;
+ }
+ }
+ else
+ {
+ if (!EC_GROUP_get_curve_GF2m(x, p, a, b, ctx))
+ {
+ reason = ERR_R_EC_LIB;
+ goto err;
+ }
}
if ((point = EC_GROUP_get0_generator(x)) == NULL)