From d86336c8674ec086143235bd674ed4f19294336b Mon Sep 17 00:00:00 2001 From: SG <13872653+mmguero@users.noreply.github.com> Date: Tue, 18 May 2021 12:06:38 -0600 Subject: [PATCH] something in 51ec8fd broke something, this branch is debugging it --- analyzer/protocol/ldap/ldap.spicy | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/analyzer/protocol/ldap/ldap.spicy b/analyzer/protocol/ldap/ldap.spicy index d4aa48e5..0894953b 100644 --- a/analyzer/protocol/ldap/ldap.spicy +++ b/analyzer/protocol/ldap/ldap.spicy @@ -204,30 +204,31 @@ type SaslCredentials = unit() { }; type BindRequest = unit(inout message: Message) { - version: asn1::ASN1Message(True) &convert=$$.body.num_value; name: asn1::ASN1Message(True) &convert=$$.body.str_value { message.obj = self.name; } var authType: BindAuthType = BindAuthType::NOT_SET; var simpleCreds: string = ""; + var saslData: bytes; - authentication: asn1::ASN1Message(True) { - if (self.authentication?.application_id) { - self.authType = cast(cast(self.authentication.application_id)); + : asn1::ASN1Message(True) { + if ($$?.application_id) { + self.authType = cast(cast($$.application_id)); } if ((self.authType == BindAuthType::BIND_AUTH_SIMPLE) && - (|self.authentication.application_data| > 0)) { - self.simpleCreds = self.authentication.application_data.decode(); + (|$$.application_data| > 0)) { + self.simpleCreds = $$.application_data.decode(); if (|self.simpleCreds| > 0) { message.arg = self.simpleCreds; } + } else { + self.saslData == $$.application_data; } } - saslCreds: SaslCredentials() &parse-from=self.authentication.application_data if (self.authType == BindAuthType::BIND_AUTH_SASL) { + saslCreds: SaslCredentials() &parse-from=self.saslData if (self?.saslData) { message.arg = self.saslCreds.mechanism; } - } &requires=((self?.authType) && (self.authType != BindAuthType::NOT_SET)); type BindResponse = unit(inout message: Message) {