print outermost signature algorithm parameters too
authorDr. Stephen Henson <steve@openssl.org>
Sun, 7 Mar 2010 17:02:47 +0000 (17:02 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 7 Mar 2010 17:02:47 +0000 (17:02 +0000)
crypto/asn1/t_x509.c
crypto/rsa/rsa_ameth.c

index d7eab16339428f5e09bda947003bce081d8681e4..bd22a8dd4fbdda38a77493f4dd36c9619c473d31 100644 (file)
@@ -168,12 +168,16 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
 
        if(!(cflag & X509_FLAG_NO_SIGNAME))
                {
+               if(X509_signature_print(bp, x->sig_alg, NULL) <= 0)
+                       goto err;
+#if 0
                if (BIO_printf(bp,"%8sSignature Algorithm: ","") <= 0) 
                        goto err;
                if (i2a_ASN1_OBJECT(bp, ci->signature->algorithm) <= 0)
                        goto err;
                if (BIO_puts(bp, "\n") <= 0)
                        goto err;
+#endif
                }
 
        if(!(cflag & X509_FLAG_NO_ISSUER))
@@ -327,8 +331,9 @@ int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
                                return ameth->sig_print(bp, sigalg, sig, 9, 0);
                        }
                }
-
-       return X509_signature_dump(bp, sig, 9);
+       if (sig)
+               return X509_signature_dump(bp, sig, 9);
+       return 1;
 }
 
 int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v)
index e25240d3f78119e8cbc07eb8497e740dd346934e..2ec302c5608dbdfc7fad9d16b79dccb722b4cccd 100644 (file)
@@ -400,8 +400,9 @@ static int rsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,
                if (!rv)
                        return 0;
                }
-
-       return X509_signature_dump(bp, sig, indent);
+       if (sig)
+               return X509_signature_dump(bp, sig, indent);
+       return 1;
        }
 
 static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)