projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fixes to various ASN1_INTEGER routines for negative case.
[openssl.git]
/
crypto
/
asn1
/
f_int.c
diff --git
a/crypto/asn1/f_int.c
b/crypto/asn1/f_int.c
index 6b090f6740c2c1f6a142773ae8787eee576651d9..48cc3bfb90d52bb66ca13f0b84d549f3be3f6130 100644
(file)
--- 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
{