提交 8ec3fa05 编写于 作者: D Dr. Stephen Henson

fix signature printing routines

上级 0c7246ed
...@@ -333,6 +333,8 @@ int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig) ...@@ -333,6 +333,8 @@ int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
} }
if (sig) if (sig)
return X509_signature_dump(bp, sig, 9); return X509_signature_dump(bp, sig, 9);
else if (BIO_puts(bp, "\n") <= 0)
return 0;
return 1; return 1;
} }
......
...@@ -547,7 +547,15 @@ static int dsa_sig_print(BIO *bp, const X509_ALGOR *sigalg, ...@@ -547,7 +547,15 @@ static int dsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,
int indent, ASN1_PCTX *pctx) int indent, ASN1_PCTX *pctx)
{ {
DSA_SIG *dsa_sig; 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); dsa_sig = d2i_DSA_SIG(NULL, &p, sig->length);
if (dsa_sig) if (dsa_sig)
{ {
......
...@@ -400,6 +400,8 @@ static int rsa_sig_print(BIO *bp, const X509_ALGOR *sigalg, ...@@ -400,6 +400,8 @@ static int rsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,
if (!rv) if (!rv)
return 0; return 0;
} }
else if (!sig && BIO_puts(bp, "\n") <= 0)
return 0;
if (sig) if (sig)
return X509_signature_dump(bp, sig, indent); return X509_signature_dump(bp, sig, indent);
return 1; return 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册