This commit is contained in:
Eugene Pankov 2022-08-06 01:01:44 +02:00
parent 1271dee26d
commit 087b943372
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
2 changed files with 4 additions and 6 deletions

View file

@ -43,12 +43,10 @@ impl CredentialPolicy for UserRequireCredentialsPolicy {
} else {
CredentialPolicyResponse::Ok
}
} else if valid_credentials.is_empty() {
CredentialPolicyResponse::NeedMoreCredentials
} else {
if valid_credentials.is_empty() {
CredentialPolicyResponse::NeedMoreCredentials
} else {
CredentialPolicyResponse::Ok
}
CredentialPolicyResponse::Ok
}
}
}

View file

@ -981,7 +981,7 @@ impl ServerSession {
let selector: AuthSelector = ssh_username.expose_secret().into();
info!("Keyboard-interactive auth as {:?}", selector);
let cred = response.map(|otp| AuthCredential::Otp(otp));
let cred = response.map(AuthCredential::Otp);
match self.try_auth(&selector, cred).await {
Ok(AuthResult::Accepted { .. }) => russh::server::Auth::Accept,