diff options
Diffstat (limited to 'src/pluto/plugins/xauth/xauth_default_verifier.c')
-rw-r--r-- | src/pluto/plugins/xauth/xauth_default_verifier.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pluto/plugins/xauth/xauth_default_verifier.c b/src/pluto/plugins/xauth/xauth_default_verifier.c index 776f77134..ca2e36aa0 100644 --- a/src/pluto/plugins/xauth/xauth_default_verifier.c +++ b/src/pluto/plugins/xauth/xauth_default_verifier.c @@ -43,6 +43,13 @@ METHOD(xauth_verifier_t, verify_secret, bool, if (get_xauth_secret(user, server, &xauth_secret)) { success = chunk_equals(secret, xauth_secret); + + if (!success && secret.len && secret.ptr[secret.len - 1] == 0) + { /* fix for null-terminated passwords (e.g. from Android 4) */ + secret.len--; + success = chunk_equals(secret, xauth_secret); + } + chunk_clear(&xauth_secret); } return success; |