diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/plugins/xauth_eap/xauth_eap.c | 4 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_generic/xauth_generic.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libcharon/plugins/xauth_eap/xauth_eap.c b/src/libcharon/plugins/xauth_eap/xauth_eap.c index e59084344..7ccb80205 100644 --- a/src/libcharon/plugins/xauth_eap/xauth_eap.c +++ b/src/libcharon/plugins/xauth_eap/xauth_eap.c @@ -217,6 +217,10 @@ METHOD(xauth_method_t, process, status_t, this->peer->destroy(this->peer); this->peer = id; } + if (pass.len && pass.ptr[pass.len - 1] == 0) + { /* fix null-terminated passwords (Android etc.) */ + pass.len -= 1; + } name = lib->settings->get_str(lib->settings, "charon.plugins.xauth-eap.backend", "radius"); diff --git a/src/libcharon/plugins/xauth_generic/xauth_generic.c b/src/libcharon/plugins/xauth_generic/xauth_generic.c index 907de4322..f0e675ac0 100644 --- a/src/libcharon/plugins/xauth_generic/xauth_generic.c +++ b/src/libcharon/plugins/xauth_generic/xauth_generic.c @@ -136,6 +136,10 @@ METHOD(xauth_method_t, process_server, status_t, this->peer->destroy(this->peer); this->peer = id; } + if (pass.len && pass.ptr[pass.len - 1] == 0) + { /* fix null-terminated passwords (Android etc.) */ + pass.len -= 1; + } enumerator = lib->credmgr->create_shared_enumerator(lib->credmgr, SHARED_EAP, this->server, this->peer); |