From 3853f820e630641d302435933241875a64b5980c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 19 Dec 2006 19:28:49 +0000 Subject: r20259: add function to start a fake tag so that asn1_read_OID_String() can work alone metze (This used to be commit ea70f6ff07930951d98a952b03963d0ba358fec4) --- source4/libcli/util/asn1.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source4/libcli/util') diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c index c8e2d6f301..83044f8e30 100644 --- a/source4/libcli/util/asn1.c +++ b/source4/libcli/util/asn1.c @@ -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) -- cgit