From: Simon Baatz Date: Thu, 15 May 2014 18:10:39 +0000 (+0200) Subject: SCARD: Fix GSM authentication on USIM X-Git-Tag: hostap_2_2~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c70c37500bb02ef1fb31390cd60dfedde968517b;p=thirdparty%2Fhostap.git SCARD: Fix GSM authentication on USIM scard_gsm_auth() used SIM_CMD_GET_RESPONSE for both SIM and USIM. Convert the command into USIM_CMD_GET_RESPONSE for USIM. Since commit eb324600295 ("Fix switching from EAP-SIM to EAP-AKA/AKA'") EAP-SIM is using the USIM if available. This triggers a probably ancient bug in scard_gsm_auth(), which results in sending the wrong get response command to the USIM. Thus, EAP-SIM stopped to work after this change on USIMs that expect the proper command. Signed-off-by: Simon Baatz --- diff --git a/src/utils/pcsc_funcs.c b/src/utils/pcsc_funcs.c index ee90d25e7..ec0655634 100644 --- a/src/utils/pcsc_funcs.c +++ b/src/utils/pcsc_funcs.c @@ -1237,6 +1237,7 @@ int scard_gsm_auth(struct scard_data *scard, const unsigned char *_rand, cmd[4] = 17; cmd[5] = 16; os_memcpy(cmd + 6, _rand, 16); + get_resp[0] = USIM_CLA; } len = sizeof(resp); ret = scard_transmit(scard, cmd, cmdlen, resp, &len);