Sylvain Munaut | 30a1538 | 2009-12-24 00:27:26 +0100 | [diff] [blame] | 1 | /* 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 Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 9 | * 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 Munaut | 30a1538 | 2009-12-24 00:27:26 +0100 | [diff] [blame] | 11 | * (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 Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 16 | * GNU Affero General Public License for more details. |
Sylvain Munaut | 30a1538 | 2009-12-24 00:27:26 +0100 | [diff] [blame] | 17 | * |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 18 | * 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 Munaut | 30a1538 | 2009-12-24 00:27:26 +0100 | [diff] [blame] | 20 | * |
| 21 | */ |
| 22 | |
| 23 | #include <openbsc/db.h> |
| 24 | #include <openbsc/debug.h> |
Harald Welte | 86dda08 | 2010-12-23 18:07:49 +0100 | [diff] [blame] | 25 | #include <openbsc/auth.h> |
Sylvain Munaut | 30a1538 | 2009-12-24 00:27:26 +0100 | [diff] [blame] | 26 | #include <openbsc/gsm_data.h> |
| 27 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 28 | #include <osmocom/gsm/comp128.h> |
Neels Hofmeyr | b42dc43 | 2016-12-16 14:16:53 +0100 | [diff] [blame] | 29 | #include <osmocom/core/utils.h> |
Sylvain Munaut | 30a1538 | 2009-12-24 00:27:26 +0100 | [diff] [blame] | 30 | |
Daniel Willmann | 62a63f5 | 2015-10-08 16:10:25 +0200 | [diff] [blame] | 31 | #include <openssl/rand.h> |
| 32 | |
Sylvain Munaut | 30a1538 | 2009-12-24 00:27:26 +0100 | [diff] [blame] | 33 | #include <stdlib.h> |
| 34 | |
Neels Hofmeyr | 37984bd | 2016-03-30 11:22:24 +0200 | [diff] [blame] | 35 | const struct value_string auth_action_names[] = { |
Neels Hofmeyr | b42dc43 | 2016-12-16 14:16:53 +0100 | [diff] [blame] | 36 | 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 Hofmeyr | ecdfd6d | 2016-12-16 14:16:41 +0100 | [diff] [blame] | 41 | { 0, NULL } |
Neels Hofmeyr | 37984bd | 2016-03-30 11:22:24 +0200 | [diff] [blame] | 42 | }; |