blob: 9064ce6c4e6f1de8a4261ebe213776c0a2816261 [file] [log] [blame]
Sylvain Munaut30a15382009-12-24 00:27:26 +01001/* Authentication related functions */
2
3/*
4 * (C) 2010 by Sylvain Munaut <tnt@246tNt.com>
5 *
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
Harald Welte9af6ddf2011-01-01 15:25:50 +01009 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
Sylvain Munaut30a15382009-12-24 00:27:26 +010011 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Harald Welte9af6ddf2011-01-01 15:25:50 +010016 * GNU Affero General Public License for more details.
Sylvain Munaut30a15382009-12-24 00:27:26 +010017 *
Harald Welte9af6ddf2011-01-01 15:25:50 +010018 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Sylvain Munaut30a15382009-12-24 00:27:26 +010020 *
21 */
22
23#include <openbsc/db.h>
24#include <openbsc/debug.h>
Harald Welte86dda082010-12-23 18:07:49 +010025#include <openbsc/auth.h>
Sylvain Munaut30a15382009-12-24 00:27:26 +010026#include <openbsc/gsm_data.h>
27
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +010028#include <osmocom/gsm/comp128.h>
Neels Hofmeyrb42dc432016-12-16 14:16:53 +010029#include <osmocom/core/utils.h>
Sylvain Munaut30a15382009-12-24 00:27:26 +010030
Daniel Willmann62a63f52015-10-08 16:10:25 +020031#include <openssl/rand.h>
32
Sylvain Munaut30a15382009-12-24 00:27:26 +010033#include <stdlib.h>
34
Neels Hofmeyr37984bd2016-03-30 11:22:24 +020035const struct value_string auth_action_names[] = {
Neels Hofmeyrb42dc432016-12-16 14:16:53 +010036 OSMO_VALUE_STRING(AUTH_ERROR),
37 OSMO_VALUE_STRING(AUTH_NOT_AVAIL),
38 OSMO_VALUE_STRING(AUTH_DO_AUTH_THEN_CIPH),
39 OSMO_VALUE_STRING(AUTH_DO_CIPH),
40 OSMO_VALUE_STRING(AUTH_DO_AUTH),
Neels Hofmeyrecdfd6d2016-12-16 14:16:41 +010041 { 0, NULL }
Neels Hofmeyr37984bd2016-03-30 11:22:24 +020042};