fix signature printing routines
authorDr. Stephen Henson <steve@openssl.org>
Mon, 4 Oct 2010 13:58:41 +0000 (13:58 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 4 Oct 2010 13:58:41 +0000 (13:58 +0000)
crypto/asn1/t_x509.c
crypto/dsa/dsa_ameth.c
crypto/rsa/rsa_ameth.c

index bd22a8dd4fbdda38a77493f4dd36c9619c473d31..db88f3a3e15dddace268e53b6e7cef85ec72d1eb 100644 (file)
@@ -333,6 +333,8 @@ int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
                }
        if (sig)
                return X509_signature_dump(bp, sig, 9);
+       else if (BIO_puts(bp, "\n") <= 0)
+               return 0;
        return 1;
 }
 
index b38e1a4ee99a88481aaca280a44bf8835bfc1f0a..376156ec5ef3a6ad23539296601180f7b4fa1472 100644 (file)
@@ -547,7 +547,15 @@ static int dsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,
                                        int indent, ASN1_PCTX *pctx)
        {
        DSA_SIG *dsa_sig;
-       const unsigned char *p = sig->data;
+       const unsigned char *p;
+       if (!sig)
+               {
+               if (BIO_puts(bp, "\n") <= 0)
+                       return 0;
+               else
+                       return 1;
+               }
+       p = sig->data;
        dsa_sig = d2i_DSA_SIG(NULL, &p, sig->length);
        if (dsa_sig)
                {
index cefac171a535d80383fa61d73f173201540397ec..2460910ab2783e5dc198e6437462a18e32f7f9b8 100644 (file)
@@ -400,6 +400,8 @@ static int rsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,
                if (!rv)
                        return 0;
                }
+       else if (!sig && BIO_puts(bp, "\n") <= 0)
+               return 0;
        if (sig)
                return X509_signature_dump(bp, sig, indent);
        return 1;