mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-06 00:00:47 -04:00
pluto: Fix for null-terminated XAuth secrets (as sent by Android 4).
This commit is contained in:
parent
5ff8fe5d48
commit
7d85bebc49
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user