aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hlr_auc_gw.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright notices for the new year 2017Jouni Malinen2017-01-031-2/+2
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* Update copyright notices for the new year 2016Jouni Malinen2016-01-011-2/+2
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Simplify string parsers with str_token()Jouni Malinen2015-12-181-93/+40
| | | | | | The helper function allows these string parsers to be made much simpler. Signed-off-by: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Fix a typo in an error messageJouni Malinen2015-12-181-1/+1
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Remove unnecessary assignmentJouni Malinen2015-12-181-1/+0
| | | | | | | The pos variable is not used after the final parsed item, so no need to set it here. Signed-off-by: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Hide a bogus static analyzer warningJouni Malinen2015-07-181-8/+8
| | | | | | | | | | For some reason, snprintf() was not seen as sufficient to remove potentially tainted string from fgets() before passing this to rename(). This does not make much sense, but anyway, try to get rid of the warning by using a separate buffer for the internally written file names. (CID 72690) Signed-off-by: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Allow Milenage RES length to be reducedJouni Malinen2015-04-031-5/+27
| | | | | | | | | Some USIM use shorter RES length than the 64-bit default from Milenage. Such cases did not interoperate with the hlr_auc_gw implementation. Make it possible to configure the RES length 4..8 octets, i.e., 32 to 64 bits) to support such USIM. Signed-off-by: Jouni Malinen <j@w1.fi>
* Check os_snprintf() result more consistently - automatic 1Jouni Malinen2014-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts os_snprintf() result validation cases to use os_snprintf_error() where the exact rule used in os_snprintf_error() was used. These changes were done automatically with spatch using the following semantic patch: @@ identifier E1; expression E2,E3,E4,E5,E6; statement S1; @@ ( E1 = os_snprintf(E2, E3, ...); | int E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else if (E6) E1 = os_snprintf(E2, E3, ...); else E1 = 0; | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else if (E6) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... E1 = os_snprintf(E2, E3, ...); } ) ? os_free(E4); - if (E1 < 0 || \( E1 >= E3 \| (size_t) E1 >= E3 \| (unsigned int) E1 >= E3 \| E1 >= (int) E3 \)) + if (os_snprintf_error(E3, E1)) ( S1 | { ... } ) Signed-off-by: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Add GSM-AUTH-REQ commandJouni Malinen2013-10-201-0/+56
| | | | | | | This can be used instead of SIM-REQ-AUTH to derive Kc and SRES values from a previously assigned set of RAND values. Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Fix max_chal value validationJouni Malinen2013-09-291-1/+1
| | | | | | This was supposed to be at maximum EAP_SIM_MAX_CHAL (3). Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Add support for processing command line operationsJouni Malinen2013-09-291-66/+116
| | | | | | | | | This allows hlr_auc_gw to be used to run a single operation without having to use it as a server. This can be useful, e.g., for generating GSM authentication triplets for external programs. For example: ./hlr_auc_gw -m hlr_auc_gw.milenage_db "SIM-REQ-AUTH 232010000000000" Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Update file comments to mention MilenageJouni Malinen2013-09-291-3/+7
| | | | | | | | The notes about using only fixed GSM authentication triplets were not really up-to-date with the implementation. Milenage and GSM-Milenage were available for EAP-SIM, EAP-AKA, and EAP-AKA'. Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Fix unknown-IMSI determination with SQLiteJouni Malinen2012-09-021-0/+5
| | | | | | | Need to explicitly check that the SQL query returns a match before returning values. Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Add SQLite database support for Milenage informationJouni Malinen2012-08-191-2/+184
| | | | | | | | An SQLite database can now be used to manage the Milenage information instead of a text file. The new hlr_auc_gw.txt document describes how this is configured and used. Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Return FAILURE if IMSI for AKA is not knownJouni Malinen2012-08-191-1/+10
| | | | | | | Instead of no response, send a FAILURE response as AKA-RESP-AUTH if the requested IMSI is not known. Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Use 5 bit IND for SQN updatesJouni Malinen2012-05-051-5/+41
| | | | | | | | | | | Change the SQN generation mechanism to use not time-based Profile 2 as described in 3GPP TS 33.102 Annex C.3.2. The previous implementation used void IND (i.e.., all of SQN was SEQ1). The new default uses 5 bits of SQN as IND. The length of IND can be configured on the command line with the new -i<IND len in bits> parameter. -i0 would make hlr_auc_gw behave in the same way as the previous implementation. Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Add support for updating Milenage file SQNJouni Malinen2012-05-031-5/+90
| | | | | | | | If the new command line argument -u is used, hlr_auc_gw will update the Milenage file SQN numbers when exiting based on what was the last SQN used during the process runtime. Signed-hostap: Jouni Malinen <j@w1.fi>
* hlr_auc_gw: Fix CONFIG_WPA_TRACE=y buildJouni Malinen2012-05-031-4/+9
| | | | | | Need to initialize tracing code and use correct free() wrapper. Signed-hostap: Jouni Malinen <j@w1.fi>
* Make bind failure messages uniqueBen Greear2012-04-061-1/+1
| | | | | | This helps someone know which part of the code is complaining. Signed-hostap: Ben Greear <greearb@candelatech.com>
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-111-8/+2
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* Annotate places depending on strong random numbersJouni Malinen2010-11-231-2/+3
| | | | | | | | | | | | | This commit adds a new wrapper, random_get_bytes(), that is currently defined to use os_get_random() as is. The places using random_get_bytes() depend on the returned value being strong random number, i.e., something that is infeasible for external device to figure out. These values are used either directly as a key or as nonces/challenges that are used as input for key derivation or authentication. The remaining direct uses of os_get_random() do not need as strong random numbers to function correctly.
* Move hlr_auc_gw into hostapd directoryJouni Malinen2009-12-061-0/+714
This is a separate program and is used mainly with hostapd, so it is better to move this into the hostapd subdirectory now that Milenage code has already been moved into src/crypto. Milenage was the only generic component in hlr_auc_gw.