Initial support for Certificate Policies extension: print out works but setting
[oweals/openssl.git] / crypto / asn1 / t_x509.c
index f0534efc09dccb6863bbd0040c785517759b4e57..1ab2caef19d7d966ea497b06bdc25c7f55d1621c 100644 (file)
@@ -100,7 +100,7 @@ X509 *x;
        X509_CINF *ci;
        ASN1_INTEGER *bs;
        EVP_PKEY *pkey=NULL;
-       char *neg;
+       const char *neg;
        X509_EXTENSION *ex;
        ASN1_STRING *str=NULL;
 
@@ -201,42 +201,11 @@ X509 *x;
                        obj=X509_EXTENSION_get_object(ex);
                        i2a_ASN1_OBJECT(bp,obj);
                        j=X509_EXTENSION_get_critical(ex);
-                       if (BIO_printf(bp,": %s\n%16s",j?"critical":"","") <= 0)
+                       if (BIO_printf(bp,": %s\n",j?"critical":"","") <= 0)
                                goto err;
-#if 0
-                       pack_type=X509v3_pack_type_by_OBJ(obj);
-                       data_type=X509v3_data_type_by_OBJ(obj);
-                       
-                       if (pack_type == X509_EXT_PACK_STRING)
-                               {
-                               if (X509v3_unpack_string(
-                                       &str,data_type,
-                                       X509_EXTENSION_get_data(ex)) == NULL)
-                                       {
-                                       /* hmm... */
-                                       goto err;
-                                       }
-                               if (    (data_type == V_ASN1_IA5STRING) ||
-                                       (data_type == V_ASN1_PRINTABLESTRING) ||
-                                       (data_type == V_ASN1_T61STRING))
-                                       {
-                                       if (BIO_write(bp,(char *)str->data,
-                                                       str->length) <= 0)
-                                               goto err;
-                                       }
-                               else if (data_type == V_ASN1_BIT_STRING)
-                                       {
-                                       BIO_printf(bp,"0x");
-                                       for (j=0; j<str->length; j++)
-                                               {
-                                               BIO_printf(bp,"%02X",
-                                                       str->data[j]);
-                                               }
-                                       }
-                               }
-#endif
-                       if(!X509V3_EXT_print(bp, ex, 0))
+                       if(!X509V3_EXT_print(bp, ex, 0, 16))
                                {
+                               BIO_printf(bp, "%16s", "");
                                ASN1_OCTET_STRING_print(bp,ex->value);
                                }
                        if (BIO_write(bp,"\n",1) <= 0) goto err;
@@ -306,6 +275,11 @@ ASN1_TIME *tm;
        return(0);
 }
 
+static const char *mon[12]=
+    {
+    "Jan","Feb","Mar","Apr","May","Jun",
+    "Jul","Aug","Sep","Oct","Nov","Dec"
+    };
 
 int ASN1_GENERALIZEDTIME_print(bp,tm)
 BIO *bp;
@@ -313,9 +287,6 @@ ASN1_GENERALIZEDTIME *tm;
        {
        char *v;
        int gmt=0;
-       static char *mon[12]={
-               "Jan","Feb","Mar","Apr","May","Jun",
-               "Jul","Aug","Sep","Oct","Nov","Dec"};
        int i;
        int y=0,M=0,d=0,h=0,m=0,s=0;
 
@@ -352,9 +323,6 @@ ASN1_UTCTIME *tm;
        {
        char *v;
        int gmt=0;
-       static char *mon[12]={
-               "Jan","Feb","Mar","Apr","May","Jun",
-               "Jul","Aug","Sep","Oct","Nov","Dec"};
        int i;
        int y=0,M=0,d=0,h=0,m=0,s=0;