aboutsummaryrefslogtreecommitdiff
path: root/crypto/asn1/f_int.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-01-19 14:21:48 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-01-19 14:21:48 +0000
commit8e8972bb680c7f91b9f615dc0fee3b1eb2cbed57 (patch)
tree96ac394f7e28b1de2e2eefd0121bd1f412323d1f /crypto/asn1/f_int.c
parent57108f0ad573347af91681568dc790f606fd0a5b (diff)
downloadopenssl-8e8972bb680c7f91b9f615dc0fee3b1eb2cbed57.zip
openssl-8e8972bb680c7f91b9f615dc0fee3b1eb2cbed57.tar.gz
openssl-8e8972bb680c7f91b9f615dc0fee3b1eb2cbed57.tar.bz2
Fixes to various ASN1_INTEGER routines for negative case.
Enhance s2i_ASN1_INTEGER().
Diffstat (limited to 'crypto/asn1/f_int.c')
-rw-r--r--crypto/asn1/f_int.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/asn1/f_int.c b/crypto/asn1/f_int.c
index 6b090f6..48cc3bf 100644
--- a/crypto/asn1/f_int.c
+++ b/crypto/asn1/f_int.c
@@ -69,10 +69,16 @@ int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)
if (a == NULL) return(0);
+ if (a->type & V_ASN1_NEG)
+ {
+ if (BIO_write(bp, "-", 1) != 1) goto err;
+ n = 1;
+ }
+
if (a->length == 0)
{
if (BIO_write(bp,"00",2) != 2) goto err;
- n=2;
+ n += 2;
}
else
{