summaryrefslogtreecommitdiffstats
path: root/lib/util
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-19 18:20:20 +0200
committerVolker Lendecke <vl@samba.org>2009-06-20 18:54:07 +0200
commit22cb9bdfd3c3a6a036db08c9c10d7c2530167fc3 (patch)
treebe209568a457fbb0a28554e8c9d8a5c639dd934e /lib/util
parentecf8cebf322717d6aea3f9f05ec9d210ffbb4aa6 (diff)
downloadsamba-22cb9bdfd3c3a6a036db08c9c10d7c2530167fc3.tar.gz
samba-22cb9bdfd3c3a6a036db08c9c10d7c2530167fc3.tar.xz
samba-22cb9bdfd3c3a6a036db08c9c10d7c2530167fc3.zip
Move asn1_load_nocopy() to lib/util/asn1.c
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/asn1.c10
-rw-r--r--lib/util/asn1.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/util/asn1.c b/lib/util/asn1.c
index 08c4060fd10..184aeec9091 100644
--- a/lib/util/asn1.c
+++ b/lib/util/asn1.c
@@ -780,6 +780,16 @@ bool asn1_blob(const struct asn1_data *asn1, DATA_BLOB *blob)
}
/*
+ Fill in an asn1 struct without making a copy
+*/
+void asn1_load_nocopy(struct asn1_data *data, uint8_t *buf, size_t len)
+{
+ ZERO_STRUCTP(data);
+ data->data = buf;
+ data->length = len;
+}
+
+/*
check if a ASN.1 blob is a full tag
*/
NTSTATUS asn1_full_tag(DATA_BLOB blob, uint8_t tag, size_t *packet_size)
diff --git a/lib/util/asn1.h b/lib/util/asn1.h
index b46494b2ea6..b147cccdee0 100644
--- a/lib/util/asn1.h
+++ b/lib/util/asn1.h
@@ -94,6 +94,7 @@ bool asn1_read_enumerated(struct asn1_data *data, int *v);
bool asn1_check_enumerated(struct asn1_data *data, int v);
bool asn1_write_enumerated(struct asn1_data *data, uint8_t v);
bool asn1_blob(const struct asn1_data *asn1, DATA_BLOB *blob);
+void asn1_load_nocopy(struct asn1_data *data, uint8_t *buf, size_t len);
NTSTATUS asn1_full_tag(DATA_BLOB blob, uint8_t tag, size_t *packet_size);
#endif /* _ASN_1_H */