Merge from the ASN1 branch of new ASN1 code
[openssl.git] / crypto / asn1 / t_req.c
index ea1af092db3fb09c44c44bf6d4e7f54de0a3aa92..b80ea1857fcd3f3bfc39a9f4a95ff06545062157 100644 (file)
@@ -145,13 +145,10 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
        if (BIO_puts(bp,str) <= 0) goto err;
 
        sk=x->req_info->attributes;
-       if ((sk == NULL) || (sk_X509_ATTRIBUTE_num(sk) == 0))
+       if (sk_X509_ATTRIBUTE_num(sk) == 0)
                {
-               if (!x->req_info->req_kludge)
-                       {
-                       sprintf(str,"%12sa0:00\n","");
-                       if (BIO_puts(bp,str) <= 0) goto err;
-                       }
+               sprintf(str,"%12sa0:00\n","");
+               if (BIO_puts(bp,str) <= 0) goto err;
                }
        else
                {
@@ -170,7 +167,13 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
                        if (BIO_puts(bp,str) <= 0) goto err;
                        if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0)
                        {
-                       if (a->set)
+                       if (a->single)
+                               {
+                               t=a->value.single;
+                               type=t->type;
+                               bs=t->value.bit_string;
+                               }
+                       else
                                {
                                ii=0;
                                count=sk_ASN1_TYPE_num(a->value.set);
@@ -179,12 +182,6 @@ get_next:
                                type=at->type;
                                bs=at->value.asn1_string;
                                }
-                       else
-                               {
-                               t=a->value.single;
-                               type=t->type;
-                               bs=t->value.bit_string;
-                               }
                        }
                        for (j=25-j; j>0; j--)
                                if (BIO_write(bp," ",1) != 1) goto err;