Skip to content

Commit

Permalink
something in 51ec8fd broke something, this branch is debugging it
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed May 18, 2021
1 parent 292186c commit d86336c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions analyzer/protocol/ldap/ldap.spicy
Original file line number Diff line number Diff line change
Expand Up @@ -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<BindAuthType>(cast<uint8>(self.authentication.application_id));
: asn1::ASN1Message(True) {
if ($$?.application_id) {
self.authType = cast<BindAuthType>(cast<uint8>($$.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) {
Expand Down

0 comments on commit d86336c

Please sign in to comment.