r20259: add function to start a fake tag so that asn1_read_OID_String()
authorStefan Metzmacher <metze@samba.org>
Tue, 19 Dec 2006 19:28:49 +0000 (19:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:29:28 +0000 (14:29 -0500)
can work alone

metze
(This used to be commit ea70f6ff07930951d98a952b03963d0ba358fec4)

source4/libcli/util/asn1.c

index c8e2d6f301dac34ae38d3b15e7efc29dd5e59d28..83044f8e3086c62feb40cd74d04921815a8a7520 100644 (file)
@@ -423,6 +423,25 @@ BOOL asn1_start_tag(struct asn1_data *data, uint8_t tag)
        return !data->has_error;
 }
 
+BOOL asn1_start_fake_tag(struct asn1_data *data)
+{
+       struct nesting *nesting;
+
+       nesting = talloc(NULL, struct nesting);
+       if (!nesting) {
+               data->has_error = True;
+               return False;
+       }
+
+       nesting->start = data->ofs;
+       nesting->taglen = data->length - data->ofs;
+       nesting->next = data->nesting;
+       data->nesting = nesting;
+       if (asn1_tag_remaining(data) == -1) {
+               return False;
+       }
+       return !data->has_error;
+}
 
 /* stop reading a tag */
 BOOL asn1_end_tag(struct asn1_data *data)