crypto/ecp_nistz256.c: harmonize error codes.
[oweals/openssl.git] / crypto / ec / eck_prn.c
index 3a523c0451f28a69988cadf848a285638ac927b7..45e0109bb6902e7d75912408e76c99e9e12d47af 100644 (file)
@@ -65,6 +65,7 @@
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/ec.h>
+#include <openssl/bn.h>
 
 #ifndef OPENSSL_NO_FP_API
 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off)
@@ -176,6 +177,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
                {
                /* the curve parameter are given by an asn1 OID */
                int nid;
+               const char *nname;
 
                if (!BIO_indent(bp, off, 128))
                        goto err;
@@ -188,6 +190,14 @@ int 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
                {
@@ -206,7 +216,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
                        reason = ERR_R_MALLOC_FAILURE;
                        goto err;
                        }
-
+#ifndef OPENSSL_NO_EC2M
                if (is_char_two)
                        {
                        if (!EC_GROUP_get_curve_GF2m(x, p, a, b, ctx))
@@ -216,6 +226,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
                                }
                        }
                else /* prime field */
+#endif
                        {
                        if (!EC_GROUP_get_curve_GFp(x, p, a, b, ctx))
                                {