ldap: Replace if with switch on bool

The change from a2a535d0c9 used
zeek/spicy#1841, but Zeek 7.0 does not have that functionality
yet. Replace with switch ( bool ).
This commit is contained in:
Arne Welzel 2025-05-06 09:45:25 +02:00
parent ceb798b42a
commit bdcb1c8a44

View file

@ -484,8 +484,8 @@ type BindRequest = unit(inout message: Message, ctx: Ctx&) {
} }
} }
if ( |self.authData| > 0 ) { switch ( |self.authData| > 0 ) {
switch ( self.authType ) { True -> switch ( self.authType ) {
BindAuthType::BIND_AUTH_SIMPLE -> BindAuthType::BIND_AUTH_SIMPLE ->
: void { : void {
self.simpleCreds = self.authData.decode(); self.simpleCreds = self.authData.decode();
@ -502,10 +502,10 @@ type BindRequest = unit(inout message: Message, ctx: Ctx&) {
sicilyMessage: SicilyMessage { sicilyMessage: SicilyMessage {
message.arg = self.sicilyMessage.signature_decoded; message.arg = self.sicilyMessage.signature_decoded;
} }
* -> : void;
};
* -> : void; * -> : void;
} &parse-from=self.authData; } &parse-from=self.authData;
};
} &requires=(self?.authType && (self.authType != BindAuthType::Undef)); } &requires=(self?.authType && (self.authType != BindAuthType::Undef));
type ServerSaslCreds = unit { type ServerSaslCreds = unit {