ldap: Clean up from code review

Co-authored-by: Benjamin Bannier <benjamin.bannier@corelight.com>
This commit is contained in:
Arne Welzel 2025-04-15 20:07:23 +02:00
parent 07bf7f8b18
commit b8e573a3b9
3 changed files with 40 additions and 27 deletions

View file

@ -376,17 +376,23 @@ event LDAP::bind_request(c: connection,
if ( m?$opcode )
Reporter::conn_weird("LDAP_bind_opcode_already_set", c, m$opcode, "LDAP");
if (authType == LDAP::BindAuthType_BIND_AUTH_SIMPLE) {
switch ( authType ) {
case LDAP::BindAuthType_BIND_AUTH_SIMPLE:
m$opcode = BIND_SIMPLE;
} else if (authType == LDAP::BindAuthType_BIND_AUTH_SASL) {
break;
case LDAP::BindAuthType_BIND_AUTH_SASL:
m$opcode = BIND_SASL;
} else if (authType == LDAP::BindAuthType_SICILY_NEGOTIATE ) {
m$opcode = "sicily_negotiate";
} else if (authType == LDAP::BindAuthType_SICILY_RESPONSE ) {
m$opcode = "sicily_response";
} else {
break;
case LDAP::BindAuthType_SICILY_NEGOTIATE:
m$opcode = BIND_SICILY_NEGOTIATE;
break;
case LDAP::BindAuthType_SICILY_RESPONSE:
m$opcode = BIND_SICILY_RESPONSE;
break;
default:
Reporter::conn_weird("LDAP_unknown_auth_type", c, cat(authType), "LDAP");
m$opcode = cat(authType);
break;
}
}