From ce9d1abb74f054f6752922e3f136c8dc3683a95f Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Mon, 4 Jul 2016 16:55:25 -0700 Subject: [PATCH] SCRAM-SHA-1 returns BADPROT for a bad password. So we need to handle the case of receiving SASL_BADPROT messages in addition to SASL_NOSUSER and SASL_BADAUTH. This patch is a bit limited in that it assumes that BADPROT is always because of a bad password, but could be caused by other currently untested code paths. --- tests/wocky-test-sasl-auth-server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/wocky-test-sasl-auth-server.c b/tests/wocky-test-sasl-auth-server.c index 6be3e38..f5a3252 100644 --- a/tests/wocky-test-sasl-auth-server.c +++ b/tests/wocky-test-sasl-auth-server.c @@ -494,6 +494,11 @@ check_sasl_return (TestSaslAuthServer *self, int ret) g_assert_cmpint (priv->problem, ==, SERVER_PROBLEM_INVALID_PASSWORD); not_authorized (self); return FALSE; + case SASL_BADPROT: + /* SCRAM-SHA-1 returns BADPROT for mismatched password */ + g_assert_cmpint (priv->problem, ==, SERVER_PROBLEM_INVALID_PASSWORD); + not_authorized (self); + return FALSE; case SASL_NOUSER: /* Unknown user */ g_assert_cmpint (priv->problem, ==, SERVER_PROBLEM_INVALID_USERNAME); -- 2.8.1