diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/t_spki.c')
-rw-r--r-- | src/lib/libcrypto/asn1/t_spki.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/t_spki.c b/src/lib/libcrypto/asn1/t_spki.c index 079c081a81..a73369b949 100644 --- a/src/lib/libcrypto/asn1/t_spki.c +++ b/src/lib/libcrypto/asn1/t_spki.c | |||
@@ -82,11 +82,36 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki) | |||
82 | (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)); | 82 | (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)); |
83 | pkey = X509_PUBKEY_get(spki->spkac->pubkey); | 83 | pkey = X509_PUBKEY_get(spki->spkac->pubkey); |
84 | if(!pkey) BIO_printf(out, " Unable to load public key\n"); | 84 | if(!pkey) BIO_printf(out, " Unable to load public key\n"); |
85 | else | 85 | else { |
86 | #ifndef OPENSSL_NO_RSA | ||
87 | if (pkey->type == EVP_PKEY_RSA) | ||
88 | { | ||
89 | BIO_printf(out," RSA Public Key: (%d bit)\n", | ||
90 | BN_num_bits(pkey->pkey.rsa->n)); | ||
91 | RSA_print(out,pkey->pkey.rsa,2); | ||
92 | } | ||
93 | else | ||
94 | #endif | ||
95 | #ifndef OPENSSL_NO_DSA | ||
96 | if (pkey->type == EVP_PKEY_DSA) | ||
86 | { | 97 | { |
87 | EVP_PKEY_print_public(out, pkey, 4, NULL); | 98 | BIO_printf(out," DSA Public Key:\n"); |
88 | EVP_PKEY_free(pkey); | 99 | DSA_print(out,pkey->pkey.dsa,2); |
100 | } | ||
101 | else | ||
102 | #endif | ||
103 | #ifndef OPENSSL_NO_EC | ||
104 | if (pkey->type == EVP_PKEY_EC) | ||
105 | { | ||
106 | BIO_printf(out, " EC Public Key:\n"); | ||
107 | EC_KEY_print(out, pkey->pkey.ec,2); | ||
89 | } | 108 | } |
109 | else | ||
110 | #endif | ||
111 | |||
112 | BIO_printf(out," Unknown Public Key:\n"); | ||
113 | EVP_PKEY_free(pkey); | ||
114 | } | ||
90 | chal = spki->spkac->challenge; | 115 | chal = spki->spkac->challenge; |
91 | if(chal->length) | 116 | if(chal->length) |
92 | BIO_printf(out, " Challenge String: %s\n", chal->data); | 117 | BIO_printf(out, " Challenge String: %s\n", chal->data); |