X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Ft_x509.c;h=358829b2f2b5def69f8dbbb991c1b54c4bb02566;hb=f86c5c9ac7b111aa2cf08d2c89d97e6f1b154162;hp=823c20860ce96280a2f590a9141e24494f9d5660;hpb=eb64730b9cb6fe9cb5bfa4b0b54bf8c9193ced2b;p=oweals%2Fopenssl.git diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index 823c20860c..358829b2f2 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -101,14 +101,13 @@ int X509_print(BIO *bp, X509 *x) int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) { long l; - int ret=0,i,j,n; - char *m=NULL,*s, mlch = ' '; + int ret=0,i; + char *m=NULL,mlch = ' '; int nmindent = 0; X509_CINF *ci; ASN1_INTEGER *bs; EVP_PKEY *pkey=NULL; const char *neg; - X509_EXTENSION *ex; ASN1_STRING *str=NULL; if((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) { @@ -228,48 +227,13 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) EVP_PKEY_free(pkey); } - if (cflag & X509_FLAG_NO_EXTENSIONS) - n = 0; - else - n=X509_get_ext_count(x); - if (n > 0) - { - BIO_printf(bp,"%8sX509v3 extensions:\n",""); - for (i=0; ivalue); - } - if (BIO_write(bp,"\n",1) <= 0) goto err; - } - } + if (!(cflag & X509_FLAG_NO_EXTENSIONS)) + X509V3_extensions_print(bp, "X509v3 extensions", + ci->extensions, cflag, 8); if(!(cflag & X509_FLAG_NO_SIGDUMP)) { - i=OBJ_obj2nid(x->sig_alg->algorithm); - if (BIO_printf(bp,"%4sSignature Algorithm: %s","", - (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)) <= 0) goto err; - - n=x->signature->length; - s=(char *)x->signature->data; - for (i=0; isig_alg, x->signature) <= 0) goto err; } if(!(cflag & X509_FLAG_NO_AUX)) { @@ -332,6 +296,26 @@ err: return(0); } +int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig) +{ + unsigned char *s; + int i, n; + if (BIO_puts(bp," Signature Algorithm: ") <= 0) return 0; + if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0) return 0; + + n=sig->length; + s=sig->data; + for (i=0; i