aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-06 18:24:56 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-10-07 04:23:36 +0200
commit44ebf4c956ac1b6986e3ce16fd8606d9da2b0037 (patch)
treeb294a875d03909eac928b4af07bf8da5ee47415e
parent6c724f9e6df914489cc9cd01ff5db5b21cc29c78 (diff)
db_get_auth_data cosmetic
-rw-r--r--src/db_auc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/db_auc.c b/src/db_auc.c
index 76d1396..58d20e8 100644
--- a/src/db_auc.c
+++ b/src/db_auc.c
@@ -120,17 +120,13 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi,
aud2g->algo = sqlite3_column_int(stmt, 1);
ki = sqlite3_column_text(stmt, 2);
-#if 0
- if (sqlite3_column_bytes(stmt, 2) != sizeof(aud2g->u.gsm.ki)) {
- LOGAUC(imsi, LOGL_ERROR, "Error reading Ki: %d\n", rc);
- goto end_2g;
- }
-#endif
+
osmo_hexparse((void*)ki, (void*)&aud2g->u.gsm.ki, sizeof(aud2g->u.gsm.ki));
aud2g->type = OSMO_AUTH_TYPE_GSM;
+ /* FIXME: verify that size of ki matches the required key size for algo. */
} else
LOGAUC(imsi, LOGL_DEBUG, "No 2G Auth Data\n");
-//end_2g:
+
if (sqlite3_column_type(stmt, 3) == SQLITE_INTEGER) {
/* we do have some 3G authentication data */
const uint8_t *k, *op, *opc;