summaryrefslogtreecommitdiff
path: root/source4/libcli/ldap
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/ldap')
-rw-r--r--source4/libcli/ldap/ldap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c
index 043faabf2f..7d1758a8fa 100644
--- a/source4/libcli/ldap/ldap.c
+++ b/source4/libcli/ldap/ldap.c
@@ -933,9 +933,13 @@ BOOL ldap_decode(struct asn1_data *data, struct ldap_message *msg)
asn1_start_tag(data, ASN1_CONTEXT(3));
r->mechanism = LDAP_AUTH_MECH_SASL;
asn1_read_OctetString_talloc(msg, data, &r->creds.SASL.mechanism);
- asn1_read_OctetString(data, &r->creds.SASL.secblob);
- if (r->creds.SASL.secblob.data) {
- talloc_steal(msg, r->creds.SASL.secblob.data);
+ if (asn1_peek_tag(data, ASN1_OCTET_STRING)) { /* optional */
+ asn1_read_OctetString(data, &r->creds.SASL.secblob);
+ if (r->creds.SASL.secblob.data) {
+ talloc_steal(msg, r->creds.SASL.secblob.data);
+ }
+ } else {
+ r->creds.SASL.secblob = data_blob(NULL, 0);
}
asn1_end_tag(data);
}