1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r2122: merge from trunk (-r 2120):

Fix bug found by Love H?\195?\182rnquist ?\195?\133strand: asn1_write_Integer needs to push
stuff little endian.
(This used to be commit 79bee828fb)
This commit is contained in:
Stefan Metzmacher 2004-08-31 06:21:14 +00:00 committed by Gerald (Jerry) Carter
parent eed08c84e2
commit 776d90d801

View File

@ -107,15 +107,23 @@ BOOL asn1_pop_tag(ASN1_DATA *data)
return True;
}
static void push_int_littleendian(ASN1_DATA *data, int i)
{
uint8_t lowest = i & 0xFF;
i = i >> 8;
if (i != 0)
push_int_littleendian(data, i);
asn1_write_uint8(data, lowest);
}
/* write an integer */
BOOL asn1_write_Integer(ASN1_DATA *data, int i)
{
if (!asn1_push_tag(data, ASN1_INTEGER)) return False;
do {
asn1_write_uint8(data, i);
i = i >> 8;
} while (i);
push_int_littleendian(data, i);
return asn1_pop_tag(data);
}