PR: 1422
[oweals/openssl.git] / crypto / asn1 / t_spki.c
index 5abfbc815ea9e09a4949d0a0c6c4c7082fee7407..a73369b949203b2810089bd253ae2ede76fc1d29 100644 (file)
@@ -1,5 +1,5 @@
 /* t_spki.c */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project 1999.
  */
 /* ====================================================================
 #include "cryptlib.h"
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
+#ifndef OPENSSL_NO_RSA
+#include <openssl/rsa.h>
+#endif
+#ifndef OPENSSL_NO_DSA
+#include <openssl/dsa.h>
+#endif
+#include <openssl/bn.h>
 
 /* Print out an SPKI */
 
@@ -93,6 +100,15 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
                }
                else
 #endif
+#ifndef OPENSSL_NO_EC
+               if (pkey->type == EVP_PKEY_EC)
+               {
+                       BIO_printf(out, "  EC Public Key:\n");
+                       EC_KEY_print(out, pkey->pkey.ec,2);
+               }
+               else
+#endif
+
                        BIO_printf(out,"  Unknown Public Key:\n");
                EVP_PKEY_free(pkey);
        }