diff options
author | Volker Lendecke <vl@samba.org> | 2009-06-19 17:39:13 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-06-20 18:54:07 +0200 |
commit | ecf8cebf322717d6aea3f9f05ec9d210ffbb4aa6 (patch) | |
tree | 35941bfec459256976e81075553103b4aae88533 /lib | |
parent | 361db1866812f7b189a3ea550e061c3977c15425 (diff) | |
download | samba-ecf8cebf322717d6aea3f9f05ec9d210ffbb4aa6.tar.gz samba-ecf8cebf322717d6aea3f9f05ec9d210ffbb4aa6.tar.bz2 samba-ecf8cebf322717d6aea3f9f05ec9d210ffbb4aa6.zip |
Move asn1_blob() to lib/util/asn1.c
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/asn1.c | 16 | ||||
-rw-r--r-- | lib/util/asn1.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/util/asn1.c b/lib/util/asn1.c index aadaf8643a..08c4060fd1 100644 --- a/lib/util/asn1.c +++ b/lib/util/asn1.c @@ -764,6 +764,22 @@ bool asn1_write_enumerated(struct asn1_data *data, uint8_t v) } /* + Get us the data just written without copying +*/ +bool asn1_blob(const struct asn1_data *asn1, DATA_BLOB *blob) +{ + if (asn1->has_error) { + return false; + } + if (asn1->nesting != NULL) { + return false; + } + blob->data = asn1->data; + blob->length = asn1->length; + return true; +} + +/* 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 0f41ae33e5..b46494b2ea 100644 --- a/lib/util/asn1.h +++ b/lib/util/asn1.h @@ -93,6 +93,7 @@ bool asn1_read_Integer(struct asn1_data *data, int *i); 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); NTSTATUS asn1_full_tag(DATA_BLOB blob, uint8_t tag, size_t *packet_size); #endif /* _ASN_1_H */ |