From 70cb5ac03c476110c0348881f49ad0697037ca38 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 27 Dec 2007 07:47:11 -0600 Subject: r26613: Add a function to write a DATA_BLOB into an LDAPString. This respects the length set in the DATA_BLOB, rather than hoping to see NULL termination of the data pointer. (found testing the Ambigious Name Resolution code against OpenLDAP). Andrew Bartlett (This used to be commit bc0022e8c7357b126dc91a945f0e53e4e4108e7d) --- source4/libcli/util/asn1.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/libcli/util') diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c index 58cb5f07be..ca6f0dc031 100644 --- a/source4/libcli/util/asn1.c +++ b/source4/libcli/util/asn1.c @@ -285,6 +285,13 @@ bool asn1_write_LDAPString(struct asn1_data *data, const char *s) return !data->has_error; } +/* write a LDAP string from a DATA_BLOB */ +bool asn1_write_DATA_BLOB_LDAPString(struct asn1_data *data, const DATA_BLOB *s) +{ + asn1_write(data, s->data, s->length); + return !data->has_error; +} + /* write a general string */ bool asn1_write_GeneralString(struct asn1_data *data, const char *s) { -- cgit