summaryrefslogtreecommitdiff
path: root/source4/libcli/util
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-09-01 14:49:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:29 -0500
commit3e454a5891b73c9b021406bdb662127e1a3180dc (patch)
tree5034912de533454ce95534f1d95ad63250e7c7ae /source4/libcli/util
parent4a17f26292a92c07af99ab1a160f81d853c704d2 (diff)
downloadsamba-3e454a5891b73c9b021406bdb662127e1a3180dc.tar.gz
samba-3e454a5891b73c9b021406bdb662127e1a3180dc.tar.bz2
samba-3e454a5891b73c9b021406bdb662127e1a3180dc.zip
r2173: Fix asn1 BOOLEANs. Thanks to Love Hornquist-Astrand.
Volker (This used to be commit 53f58c053b643c8b45d2f9394faf8cfdd5005f6d)
Diffstat (limited to 'source4/libcli/util')
-rw-r--r--source4/libcli/util/asn1.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c
index 7e313bcd4a..b5db9b157e 100644
--- a/source4/libcli/util/asn1.c
+++ b/source4/libcli/util/asn1.c
@@ -221,22 +221,13 @@ BOOL asn1_write_ContextSimple(ASN1_DATA *data, uint8_t num, DATA_BLOB *blob)
/* write a BOOLEAN */
BOOL asn1_write_BOOLEAN(ASN1_DATA *data, BOOL v)
{
- asn1_write_uint8(data, ASN1_BOOLEAN);
- asn1_write_uint8(data, v);
- return !data->has_error;
-}
-
-/* write a BOOLEAN - hmm, I suspect this one is the correct one, and the
- above boolean is bogus. Need to check */
-BOOL asn1_write_BOOLEAN2(ASN1_DATA *data, BOOL v)
-{
asn1_push_tag(data, ASN1_BOOLEAN);
- asn1_write_uint8(data, v);
+ asn1_write_uint8(data, v ? 0xFF : 0);
asn1_pop_tag(data);
return !data->has_error;
}
-BOOL asn1_read_BOOLEAN2(ASN1_DATA *data, BOOL *v)
+BOOL asn1_read_BOOLEAN(ASN1_DATA *data, BOOL *v)
{
asn1_start_tag(data, ASN1_BOOLEAN);
asn1_read_uint8(data, (uint8 *)v);