aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-02-13 16:57:01 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-02-13 16:57:01 +0100
commit9377ca3ef4b274df9b25cc56f38d69e70a61985c (patch)
tree1981b69a2d46d03b62be72e23fc3698ad1df3e5f
parent25e716a17f3eb05f73839ba1e38eee26e8b615e0 (diff)
downloadaerogramme-9377ca3ef4b274df9b25cc56f38d69e70a61985c.tar.gz
aerogramme-9377ca3ef4b274df9b25cc56f38d69e70a61985c.zip
Accept authz id == auth idbug/dovecot-auth-resp
-rw-r--r--src/auth.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/auth.rs b/src/auth.rs
index d5cc5ac..064c90c 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -202,11 +202,12 @@ enum State {
const SERVER_MAJOR: u64 = 1;
const SERVER_MINOR: u64 = 2;
+const EMPTY_AUTHZ: &[u8] = &[];
impl State {
async fn try_auth_plain<'a>(&self, data: &'a [u8], login: &ArcLoginProvider) -> AuthRes {
// Check that we can extract user's login+pass
let (ubin, pbin) = match auth_plain(&data) {
- Ok(([], ([], user, pass))) => (user, pass),
+ Ok(([], (authz, user, pass))) if authz == user || authz == EMPTY_AUTHZ => (user, pass),
Ok(_) => {
tracing::error!("Impersonating user is not supported");
return AuthRes::Failed(None, None);