diff options
author | Andy Polyakov <appro@openssl.org> | 2012-01-11 21:12:47 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2012-01-11 21:12:47 +0000 |
commit | 958e6a75a1e15d155c1bfb9b8d0a0d960489d97f (patch) | |
tree | b4fabe5e7557a7bd19de2ce9788a47afc109f65b /crypto/asn1 | |
parent | 397977726cd563b2e47089d569c36d7284cb7ad0 (diff) |
asn1/t_x509.c: fix serial number print, harmonize with a_int.c [from HEAD].
PR: 2675
Submitted by: Annie Yousar
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_int.c | 4 | ||||
-rw-r--r-- | crypto/asn1/t_x509.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 3348b8762c..ad0d2506f6 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -386,8 +386,8 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a) if (a->length > (int)sizeof(long)) { - /* hmm... a bit ugly */ - return(0xffffffffL); + /* hmm... a bit ugly, return all ones */ + return -1; } if (a->data == NULL) return 0; diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index db88f3a3e1..4f5d28f1ab 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -138,10 +138,10 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) if (BIO_write(bp," Serial Number:",22) <= 0) goto err; bs=X509_get_serialNumber(x); - if (bs->length <= 4) + if (bs->length <= sizeof(long)) { l=ASN1_INTEGER_get(bs); - if (l < 0) + if (bs->type == V_ASN1_NEG_INTEGER) { l= -l; neg="-"; |