提交 b09eb246 编写于 作者: R Rich Salz

RT3246: req command prints version number wrong

Make X509_REQ_print_ex do the same thing that
X509_REQ_print does.
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 c7497f34
...@@ -90,7 +90,7 @@ int X509_REQ_print_fp(FILE *fp, X509_REQ *x) ...@@ -90,7 +90,7 @@ int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long cflag) int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long cflag)
{ {
unsigned long l; long l;
int i; int i;
const char *neg; const char *neg;
X509_REQ_INFO *ri; X509_REQ_INFO *ri;
...@@ -117,12 +117,8 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long ...@@ -117,12 +117,8 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long
} }
if(!(cflag & X509_FLAG_NO_VERSION)) if(!(cflag & X509_FLAG_NO_VERSION))
{ {
neg=(ri->version->type == V_ASN1_NEG_INTEGER)?"-":""; l = X509_REQ_get_version(x);
l=0; if(BIO_printf(bp,"%8sVersion: %ld (0x%lx)\n","",l+1, l) <= 0)
for (i=0; i<ri->version->length; i++)
{ l<<=8; l+=ri->version->data[i]; }
if(BIO_printf(bp,"%8sVersion: %s%lu (%s0x%lx)\n","",neg,l,neg,
l) <= 0)
goto err; goto err;
} }
if(!(cflag & X509_FLAG_NO_SUBJECT)) if(!(cflag & X509_FLAG_NO_SUBJECT))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册