summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2015-06-20 14:17:07 +0000
committerjsing <jsing@openbsd.org>2015-06-20 14:17:07 +0000
commite216474b78d60cd3fe50ea104eaab003d214b7d3 (patch)
tree311c01962ee84937a8ab5504dea086cf9b7ad305 /lib/libssl/src
parentLess mdc2. (diff)
downloadwireguard-openbsd-e216474b78d60cd3fe50ea104eaab003d214b7d3.tar.xz
wireguard-openbsd-e216474b78d60cd3fe50ea104eaab003d214b7d3.zip
Have ECPKParameters_print() include the NIST curve name, if known.
From OpenSSL. ok miod@ (a while ago).
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/ec/eck_prn.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libssl/src/crypto/ec/eck_prn.c b/lib/libssl/src/crypto/ec/eck_prn.c
index aa13d8b08c4..06cdd69591f 100644
--- a/lib/libssl/src/crypto/ec/eck_prn.c
+++ b/lib/libssl/src/crypto/ec/eck_prn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eck_prn.c,v 1.10 2014/07/12 16:03:37 miod Exp $ */
+/* $OpenBSD: eck_prn.c,v 1.11 2015/06/20 14:17:07 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -161,6 +161,7 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off)
*cofactor = NULL;
const unsigned char *seed;
size_t seed_len = 0;
+ const char *nname;
static const char *gen_compressed = "Generator (compressed):";
static const char *gen_uncompressed = "Generator (uncompressed):";
@@ -190,6 +191,14 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off)
goto err;
if (BIO_printf(bp, "\n") <= 0)
goto err;
+
+ nname = EC_curve_nid2nist(nid);
+ if (nname) {
+ if (!BIO_indent(bp, off, 128))
+ goto err;
+ if (BIO_printf(bp, "NIST CURVE: %s\n", nname) <= 0)
+ goto err;
+ }
} else {
/* explicit parameters */
int is_char_two = 0;