Deprecate the recursive includes of bn.h from various API headers (asn1.h,
[openssl.git] / crypto / asn1 / t_spki.c
index d708434fcabb7dd5c35faf95f91e712bd4fd1d14..e84bae64387beccfbbb1100325ff0aaf4df48aa9 100644 (file)
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/x509.h>
-#include <openssl/asn1_mac.h>
+#include <openssl/asn1.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+#include <openssl/bn.h>
 
 /* Print out an SPKI */
 
@@ -76,7 +79,7 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
        pkey = X509_PUBKEY_get(spki->spkac->pubkey);
        if(!pkey) BIO_printf(out, "  Unable to load public key\n");
        else {
-#ifndef NO_RSA
+#ifndef OPENSSL_NO_RSA
                if (pkey->type == EVP_PKEY_RSA)
                        {
                        BIO_printf(out,"  RSA Public Key: (%d bit)\n",
@@ -85,7 +88,7 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
                        }
                else 
 #endif
-#ifndef NO_DSA
+#ifndef OPENSSL_NO_DSA
                if (pkey->type == EVP_PKEY_DSA)
                {
                BIO_printf(out,"  DSA Public Key:\n");
@@ -93,6 +96,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.eckey,2);
+               }
+               else
+#endif
+
                        BIO_printf(out,"  Unknown Public Key:\n");
                EVP_PKEY_free(pkey);
        }