diff options
author | jsing <> | 2015-06-20 14:17:07 +0000 |
---|---|---|
committer | jsing <> | 2015-06-20 14:17:07 +0000 |
commit | a3c861524df1287716573ed93beb78825e335694 (patch) | |
tree | d824a1f953487fcae5731454872b6d4045b283c6 | |
parent | 3f48d4479f75106f8388a706f87896d30cee1a9e (diff) | |
download | openbsd-a3c861524df1287716573ed93beb78825e335694.tar.gz openbsd-a3c861524df1287716573ed93beb78825e335694.tar.bz2 openbsd-a3c861524df1287716573ed93beb78825e335694.zip |
Have ECPKParameters_print() include the NIST curve name, if known.
From OpenSSL.
ok miod@ (a while ago).
-rw-r--r-- | src/lib/libcrypto/ec/eck_prn.c | 11 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/ec/eck_prn.c | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c index aa13d8b08c..06cdd69591 100644 --- a/src/lib/libcrypto/ec/eck_prn.c +++ b/src/lib/libcrypto/ec/eck_prn.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eck_prn.c,v 1.10 2014/07/12 16:03:37 miod Exp $ */ | 1 | /* $OpenBSD: eck_prn.c,v 1.11 2015/06/20 14:17:07 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -161,6 +161,7 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) | |||
161 | *cofactor = NULL; | 161 | *cofactor = NULL; |
162 | const unsigned char *seed; | 162 | const unsigned char *seed; |
163 | size_t seed_len = 0; | 163 | size_t seed_len = 0; |
164 | const char *nname; | ||
164 | 165 | ||
165 | static const char *gen_compressed = "Generator (compressed):"; | 166 | static const char *gen_compressed = "Generator (compressed):"; |
166 | static const char *gen_uncompressed = "Generator (uncompressed):"; | 167 | static const char *gen_uncompressed = "Generator (uncompressed):"; |
@@ -190,6 +191,14 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) | |||
190 | goto err; | 191 | goto err; |
191 | if (BIO_printf(bp, "\n") <= 0) | 192 | if (BIO_printf(bp, "\n") <= 0) |
192 | goto err; | 193 | goto err; |
194 | |||
195 | nname = EC_curve_nid2nist(nid); | ||
196 | if (nname) { | ||
197 | if (!BIO_indent(bp, off, 128)) | ||
198 | goto err; | ||
199 | if (BIO_printf(bp, "NIST CURVE: %s\n", nname) <= 0) | ||
200 | goto err; | ||
201 | } | ||
193 | } else { | 202 | } else { |
194 | /* explicit parameters */ | 203 | /* explicit parameters */ |
195 | int is_char_two = 0; | 204 | int is_char_two = 0; |
diff --git a/src/lib/libssl/src/crypto/ec/eck_prn.c b/src/lib/libssl/src/crypto/ec/eck_prn.c index aa13d8b08c..06cdd69591 100644 --- a/src/lib/libssl/src/crypto/ec/eck_prn.c +++ b/src/lib/libssl/src/crypto/ec/eck_prn.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eck_prn.c,v 1.10 2014/07/12 16:03:37 miod Exp $ */ | 1 | /* $OpenBSD: eck_prn.c,v 1.11 2015/06/20 14:17:07 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -161,6 +161,7 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) | |||
161 | *cofactor = NULL; | 161 | *cofactor = NULL; |
162 | const unsigned char *seed; | 162 | const unsigned char *seed; |
163 | size_t seed_len = 0; | 163 | size_t seed_len = 0; |
164 | const char *nname; | ||
164 | 165 | ||
165 | static const char *gen_compressed = "Generator (compressed):"; | 166 | static const char *gen_compressed = "Generator (compressed):"; |
166 | static const char *gen_uncompressed = "Generator (uncompressed):"; | 167 | static const char *gen_uncompressed = "Generator (uncompressed):"; |
@@ -190,6 +191,14 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) | |||
190 | goto err; | 191 | goto err; |
191 | if (BIO_printf(bp, "\n") <= 0) | 192 | if (BIO_printf(bp, "\n") <= 0) |
192 | goto err; | 193 | goto err; |
194 | |||
195 | nname = EC_curve_nid2nist(nid); | ||
196 | if (nname) { | ||
197 | if (!BIO_indent(bp, off, 128)) | ||
198 | goto err; | ||
199 | if (BIO_printf(bp, "NIST CURVE: %s\n", nname) <= 0) | ||
200 | goto err; | ||
201 | } | ||
193 | } else { | 202 | } else { |
194 | /* explicit parameters */ | 203 | /* explicit parameters */ |
195 | int is_char_two = 0; | 204 | int is_char_two = 0; |