| Index: openssl/crypto/asn1/t_x509.c
|
| ===================================================================
|
| --- openssl/crypto/asn1/t_x509.c (revision 105093)
|
| +++ openssl/crypto/asn1/t_x509.c (working copy)
|
| @@ -111,7 +111,6 @@
|
| ASN1_INTEGER *bs;
|
| EVP_PKEY *pkey=NULL;
|
| const char *neg;
|
| - ASN1_STRING *str=NULL;
|
|
|
| if((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
|
| mlch = '\n';
|
| @@ -215,34 +214,10 @@
|
| ERR_print_errors(bp);
|
| }
|
| else
|
| -#ifndef OPENSSL_NO_RSA
|
| - if (pkey->type == EVP_PKEY_RSA)
|
| {
|
| - BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","",
|
| - BN_num_bits(pkey->pkey.rsa->n));
|
| - RSA_print(bp,pkey->pkey.rsa,16);
|
| + EVP_PKEY_print_public(bp, pkey, 16, NULL);
|
| + EVP_PKEY_free(pkey);
|
| }
|
| - else
|
| -#endif
|
| -#ifndef OPENSSL_NO_DSA
|
| - if (pkey->type == EVP_PKEY_DSA)
|
| - {
|
| - BIO_printf(bp,"%12sDSA Public Key:\n","");
|
| - DSA_print(bp,pkey->pkey.dsa,16);
|
| - }
|
| - else
|
| -#endif
|
| -#ifndef OPENSSL_NO_EC
|
| - if (pkey->type == EVP_PKEY_EC)
|
| - {
|
| - BIO_printf(bp, "%12sEC Public Key:\n","");
|
| - EC_KEY_print(bp, pkey->pkey.ec, 16);
|
| - }
|
| - else
|
| -#endif
|
| - BIO_printf(bp,"%12sUnknown Public Key:\n","");
|
| -
|
| - EVP_PKEY_free(pkey);
|
| }
|
|
|
| if (!(cflag & X509_FLAG_NO_EXTENSIONS))
|
| @@ -259,7 +234,6 @@
|
| }
|
| ret=1;
|
| err:
|
| - if (str != NULL) ASN1_STRING_free(str);
|
| if (m != NULL) OPENSSL_free(m);
|
| return(ret);
|
| }
|
| @@ -329,14 +303,15 @@
|
| return 1;
|
| }
|
|
|
| -int ASN1_STRING_print(BIO *bp, ASN1_STRING *v)
|
| +int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v)
|
| {
|
| int i,n;
|
| - char buf[80],*p;
|
| + char buf[80];
|
| + const char *p;
|
|
|
| if (v == NULL) return(0);
|
| n=0;
|
| - p=(char *)v->data;
|
| + p=(const char *)v->data;
|
| for (i=0; i<v->length; i++)
|
| {
|
| if ((p[i] > '~') || ((p[i] < ' ') &&
|
| @@ -358,7 +333,7 @@
|
| return(1);
|
| }
|
|
|
| -int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm)
|
| +int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
|
| {
|
| if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);
|
| if(tm->type == V_ASN1_GENERALIZEDTIME)
|
| @@ -373,7 +348,7 @@
|
| "Jul","Aug","Sep","Oct","Nov","Dec"
|
| };
|
|
|
| -int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
|
| +int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
|
| {
|
| char *v;
|
| int gmt=0;
|
| @@ -421,15 +396,15 @@
|
| return(0);
|
| }
|
|
|
| -int ASN1_UTCTIME_print(BIO *bp, ASN1_UTCTIME *tm)
|
| +int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm)
|
| {
|
| - char *v;
|
| + const char *v;
|
| int gmt=0;
|
| int i;
|
| int y=0,M=0,d=0,h=0,m=0,s=0;
|
|
|
| i=tm->length;
|
| - v=(char *)tm->data;
|
| + v=(const char *)tm->data;
|
|
|
| if (i < 10) goto err;
|
| if (v[i-1] == 'Z') gmt=1;
|
|
|