Fix null-terminated XAuth passwords, as sent by Android 4

This commit is contained in:
Martin Willi 2012-03-22 15:01:35 +01:00
parent 83d77866f4
commit 3110744a6b
2 changed files with 8 additions and 0 deletions

View File

@ -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");

View File

@ -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);