svn commit: samba r1689 - trunk/source/libsmb

vlendec at samba.org vlendec at samba.org
Tue Aug 10 11:23:08 GMT 2004


Author: vlendec
Date: 2004-08-10 11:23:08 +0000 (Tue, 10 Aug 2004)
New Revision: 1689
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=1689&nolog=1
Log:
Forgot asn1.c in last ldap commit
Modified:
   trunk/source/libsmb/asn1.c

Changeset:
Modified: trunk/source/libsmb/asn1.c
===================================================================
--- trunk/source/libsmb/asn1.c	2004-08-10 11:09:13 UTC (rev 1688)
+++ trunk/source/libsmb/asn1.c	2004-08-10 11:23:08 UTC (rev 1689)
@@ -184,6 +184,14 @@
 	return !data->has_error;
 }
 
+BOOL asn1_read_BOOLEAN2(ASN1_DATA *data, BOOL *v)
+{
+	asn1_start_tag(data, ASN1_BOOLEAN);
+	asn1_read_uint8(data, (uint8 *)v);
+	asn1_end_tag(data);
+	return !data->has_error;
+}
+
 /* check a BOOLEAN */
 BOOL asn1_check_BOOLEAN(ASN1_DATA *data, BOOL v)
 {
@@ -367,6 +375,24 @@
 	return True;
 }
 
+/* Get the length to be expected in buf */
+BOOL asn1_object_length(uint8_t *buf, size_t buf_length,
+			uint8 tag, size_t *result)
+{
+	ASN1_DATA data;
+
+	/* Fake the asn1_load to avoid the memdup, this is just to be able to
+	 * re-use the length-reading in asn1_start_tag */
+	ZERO_STRUCT(data);
+	data.data = buf;
+	data.length = buf_length;
+	if (!asn1_start_tag(&data, tag))
+		return False;
+	*result = asn1_tag_remaining(&data)+data.ofs;
+	asn1_end_tag(&data);
+	return True;
+}
+
 /* stop reading a tag */
 BOOL asn1_end_tag(ASN1_DATA *data)
 {



More information about the samba-cvs mailing list