summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/asn1/t_spki.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/src/crypto/asn1/t_spki.c')
-rw-r--r--lib/libssl/src/crypto/asn1/t_spki.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/libssl/src/crypto/asn1/t_spki.c b/lib/libssl/src/crypto/asn1/t_spki.c
index f135754535e..0265461b040 100644
--- a/lib/libssl/src/crypto/asn1/t_spki.c
+++ b/lib/libssl/src/crypto/asn1/t_spki.c
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -70,38 +70,40 @@
/* Print out an SPKI */
-int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
+int
+NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
{
EVP_PKEY *pkey;
ASN1_IA5STRING *chal;
int i, n;
char *s;
+
BIO_printf(out, "Netscape SPKI:\n");
- i=OBJ_obj2nid(spki->spkac->pubkey->algor->algorithm);
- BIO_printf(out," Public Key Algorithm: %s\n",
- (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i));
+ i = OBJ_obj2nid(spki->spkac->pubkey->algor->algorithm);
+ BIO_printf(out, " Public Key Algorithm: %s\n",
+ (i == NID_undef) ? "UNKNOWN" : OBJ_nid2ln(i));
pkey = X509_PUBKEY_get(spki->spkac->pubkey);
- if(!pkey)
+ if (!pkey)
BIO_printf(out, " Unable to load public key\n");
else {
EVP_PKEY_print_public(out, pkey, 4, NULL);
EVP_PKEY_free(pkey);
}
chal = spki->spkac->challenge;
- if(chal->length)
+ if (chal->length)
BIO_printf(out, " Challenge String: %s\n", chal->data);
- i=OBJ_obj2nid(spki->sig_algor->algorithm);
- BIO_printf(out," Signature Algorithm: %s",
- (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i));
+ i = OBJ_obj2nid(spki->sig_algor->algorithm);
+ BIO_printf(out, " Signature Algorithm: %s",
+ (i == NID_undef) ? "UNKNOWN" : OBJ_nid2ln(i));
- n=spki->signature->length;
- s=(char *)spki->signature->data;
- for (i=0; i<n; i++) {
- if ((i%18) == 0)
- BIO_write(out,"\n ",7);
- BIO_printf(out,"%02x%s",(unsigned char)s[i],
- ((i+1) == n)?"":":");
+ n = spki->signature->length;
+ s = (char *)spki->signature->data;
+ for (i = 0; i < n; i++) {
+ if ((i % 18) == 0)
+ BIO_write(out, "\n ", 7);
+ BIO_printf(out, "%02x%s", (unsigned char)s[i],
+ ((i + 1) == n) ? "" : ":");
}
- BIO_write(out,"\n",1);
+ BIO_write(out, "\n", 1);
return 1;
}