All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/6] plugins: remove dependency on ELL plugins
  2020-09-16 19:39 [PATCH v2 1/6] plugins: remove dependency on ELL plugins James Prestwood
@ 2020-09-16 19:33 ` Denis Kenzior
  2020-09-16 19:39 ` [PATCH v2 2/6] test-runner: remove ofono/hardcoded IWD options James Prestwood
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2020-09-16 19:33 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]

Hi James,

On 9/16/20 2:39 PM, James Prestwood wrote:
> There has been a desire to remove the ELL plugin dependency from
> IWD which is the only consumer of the plugin API. This removes
> the dependency and prepares the tree for converting the existing
> ofono plugin into a regular module.
> 
> sim_hardcoded was removed completely. This was originall implemented
> before full ofono support purely to test the IWD side of EAP-SIM/AKA.
> Since the ofono plugin (module-to-be) is now fully implemented there
> really isn't a need for sim_hardcoded.
> ---
>   Makefile.am              |   8 +-
>   bootstrap-configure      |   1 -
>   configure.ac             |   5 -
>   plugins/sim_hardcoded.c  | 399 ---------------------------------------
>   src/main.c               |  16 --
>   {plugins => src}/ofono.c |   0
>   6 files changed, 1 insertion(+), 428 deletions(-)
>   delete mode 100644 plugins/sim_hardcoded.c
>   rename {plugins => src}/ofono.c (100%)
> 
> -v2:
>   * Removed sim_hardcoded all together
> 

All applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/6] plugins: remove dependency on ELL plugins
@ 2020-09-16 19:39 James Prestwood
  2020-09-16 19:33 ` Denis Kenzior
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: James Prestwood @ 2020-09-16 19:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 14902 bytes --]

There has been a desire to remove the ELL plugin dependency from
IWD which is the only consumer of the plugin API. This removes
the dependency and prepares the tree for converting the existing
ofono plugin into a regular module.

sim_hardcoded was removed completely. This was originall implemented
before full ofono support purely to test the IWD side of EAP-SIM/AKA.
Since the ofono plugin (module-to-be) is now fully implemented there
really isn't a need for sim_hardcoded.
---
 Makefile.am              |   8 +-
 bootstrap-configure      |   1 -
 configure.ac             |   5 -
 plugins/sim_hardcoded.c  | 399 ---------------------------------------
 src/main.c               |  16 --
 {plugins => src}/ofono.c |   0
 6 files changed, 1 insertion(+), 428 deletions(-)
 delete mode 100644 plugins/sim_hardcoded.c
 rename {plugins => src}/ofono.c (100%)

-v2:
 * Removed sim_hardcoded all together

diff --git a/Makefile.am b/Makefile.am
index 5f16920f..d85d3470 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -185,7 +185,6 @@ if DAEMON
 libexec_PROGRAMS += src/iwd
 
 src_iwd_SOURCES = src/main.c linux/nl80211.h src/iwd.h src/missing.h \
-					src/plugin.h src/plugin.c \
 					src/netdev.h src/netdev.c \
 					src/wiphy.h src/wiphy.c \
 					src/device.c \
@@ -235,14 +234,9 @@ src_iwd_SOURCES = src/main.c linux/nl80211.h src/iwd.h src/missing.h \
 src_iwd_LDADD = $(ell_ldadd) -ldl
 src_iwd_DEPENDENCIES = $(ell_dependencies)
 
-if SIM_HARDCODED
-builtin_modules += sim_hardcoded
-builtin_sources += plugins/sim_hardcoded.c
-endif
-
 if OFONO
 builtin_modules += ofono
-builtin_sources += plugins/ofono.c
+builtin_sources += src/ofono.c
 endif
 
 if DBUS_POLICY
diff --git a/bootstrap-configure b/bootstrap-configure
index 195f2e48..7b907a28 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -13,6 +13,5 @@ fi
 		--enable-hwsim \
 		--enable-tools \
 		--enable-ofono \
-		--enable-sim-hardcoded \
 		--disable-dbus-policy \
 		--disable-systemd-service $*
diff --git a/configure.ac b/configure.ac
index bf7e94df..78db15e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,11 +291,6 @@ AC_ARG_ENABLE([ofono], AC_HELP_STRING([--enable-ofono],
 					[enable_ofono=${enableval}])
 AM_CONDITIONAL(OFONO, test "${enable_ofono}" = "yes")
 
-AC_ARG_ENABLE([sim_hardcoded], AC_HELP_STRING([--enable-sim-hardcoded],
-				[enable hard coded SIM keys]),
-					[enable_sim_hardcoded=${enableval}])
-AM_CONDITIONAL(SIM_HARDCODED, test "${enable_sim_hardcoded}" = "yes")
-
 AC_CONFIG_FILES(Makefile)
 
 AC_OUTPUT
diff --git a/plugins/sim_hardcoded.c b/plugins/sim_hardcoded.c
deleted file mode 100644
index 463c39fe..00000000
--- a/plugins/sim_hardcoded.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- *
- *  Wireless daemon for Linux
- *
- *  Copyright (C) 2017-2019  Intel Corporation. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include <ell/ell.h>
-#include <ell/plugin.h>
-
-#include "src/simauth.h"
-
-struct hardcoded_sim {
-	char *identity;
-	uint8_t sim_supported;
-	uint8_t kc[NUM_RANDS_MAX][EAP_SIM_KC_LEN];
-	uint8_t sres[NUM_RANDS_MAX][EAP_SIM_SRES_LEN];
-	uint8_t aka_supported;
-	uint8_t ki[EAP_AKA_KI_LEN];
-	uint8_t opc[EAP_AKA_OPC_LEN];
-	uint8_t amf[EAP_AKA_AMF_LEN];
-	uint8_t sqn[EAP_AKA_SQN_LEN];
-	struct iwd_sim_auth *auth;
-};
-
-static struct hardcoded_sim *sim;
-
-/*
- * Helper to XOR an array
- * to - result of XOR array
- * a - array 1
- * b - array 2
- * len - size of array
- */
-#define XOR(to, a, b, len) \
-	for (i = 0; i < len; i++) { \
-		to[i] = a[i] ^ b[i]; \
-	}
-
-static int get_milenage(const uint8_t *opc, const uint8_t *k,
-		const uint8_t *rand, const uint8_t *sqn, const uint8_t *amf,
-		const uint8_t *autn_in, uint8_t *autn, uint8_t *ck, uint8_t *ik,
-		uint8_t *res, uint8_t *auts)
-{
-	/* algorithm variables: TEMP, IN1, OUT1, OUT2, OUT5 (OUT3/4 == IK/CK) */
-	uint8_t temp[16];
-	uint8_t in1[16];
-	uint8_t out1[16], out2[16], out5[16];
-	/* other variables */
-	struct l_cipher *aes;
-	int i;
-	uint8_t tmp1[16];
-	uint8_t tmp2[16];
-	uint8_t sqn_autn[6];
-
-	aes = l_cipher_new(L_CIPHER_AES, k, 16);
-
-	/* temp = TEMP = E[RAND ^ OPc]k */
-	XOR(tmp1, rand, opc, 16);
-	l_cipher_encrypt(aes, tmp1, temp, 16);
-
-	/* IN1[0-47] = SQN[0-47] */
-	memcpy(in1, sqn, 6);
-	/* IN1[48-63] = AMF[0-15] */
-	memcpy(in1 + 6, amf, 2);
-	/* IN1[64-111] = SQN[0-47] */
-	memcpy(in1 + 8, sqn, 6);
-	/* IN1[112-127] = AMF[0-15] */
-	memcpy(in1 + 14, amf, 2);
-
-	/*
-	 * f1 and f1* output OUT1
-	 */
-	/*
-	 * tmp1 = rot(IN1 ^ OPc)r1
-	 * r1 = 64 bits = 8 bytes
-	 */
-	for (i = 0; i < 16; i++)
-		tmp1[(i + 8) % 16] = in1[i] ^ opc[i];
-
-	/* tmp2 = TEMP ^ tmp1 */
-	XOR(tmp2, temp, tmp1, 16);
-	/* tmp2 = E[tmp2]k */
-	l_cipher_encrypt(aes, tmp2, tmp1, 16);
-	/* out1 = OUT1 = tmp1 ^ opc */
-	XOR(out1, tmp1, opc, 16);
-
-	/*
-	 * f2 outputs OUT2 (RES | AK)
-	 *
-	 * r2 = 0 == no rotation
-	 */
-	/* tmp1 = rot(TEMP ^ OPc)r2 */
-	XOR(tmp1, temp, opc, 16);
-	/* tmp1 ^ c2. c2 at bit 127 == 1 */
-	tmp1[15] ^= 1;
-	l_cipher_encrypt(aes, tmp1, out2, 16);
-
-	/* get RES from OUT2 */
-	XOR(out2, out2, opc, 16);
-	memcpy(res, out2 + 8, 8);
-
-	/* check input autn (AUTN ^ AK = SQN)*/
-	XOR(sqn_autn, autn_in, out2, 6);
-
-	/* if SQN was not correct, generate AUTS */
-	if (memcmp(sqn_autn, sqn, 6)) {
-		/*
-		 * f5* outputs AK' (OUT5)
-		 */
-		for (i = 0; i < 16; i++)
-			tmp1[(i + 4) % 16] = temp[i] ^ opc[i];
-
-		/* tmp1 ^ c5. c5 at bit 124 == 1 */
-		tmp1[15] ^= 1 << 3;
-		l_cipher_encrypt(aes, tmp1, out5, 16);
-		/* out5 ^ opc */
-		XOR(out5, out5, opc, 16);
-
-		XOR(auts, sqn, out5, 6);
-
-		/* run f1 with zero'd AMF to finish AUTS */
-		in1[6] = 0x00;
-		in1[7] = 0x00;
-		in1[14] = 0x00;
-		in1[15] = 0x00;
-
-		for (i = 0; i < 16; i++)
-			tmp1[(i + 8) % 16] = in1[i] ^ opc[i];
-
-		/* tmp2 = TEMP ^ tmp1 */
-		XOR(tmp2, temp, tmp1, 16);
-		/* tmp2 = E[tmp2]k */
-		l_cipher_encrypt(aes, tmp2, tmp1, 16);
-		/* out1 = OUT1 = tmp1 ^ opc */
-		XOR(out1, tmp1, opc, 16);
-
-		memcpy(auts + 6, in1 + 8, 8);
-
-		return -1;
-	}
-
-	/* AUTN = (SQN ^ AK) | AMF | MAC_A */
-	XOR(autn, sqn, out2, 6);
-	memcpy(autn + 6, amf, 2);
-	memcpy(autn + 8, out1, 8);
-
-	if (memcmp(autn, autn_in, 16))
-		return -2;
-
-	/*
-	 * f3 outputs CK (OUT3)
-	 *
-	 * tmp1 = rot(TEMP ^ OPc)r3
-	 *
-	 * r3 = 32 bits = 4 bytes
-	 */
-	for (i = 0; i < 16; i++)
-		tmp1[(i + 12) % 16] = temp[i] ^ opc[i];
-
-	/* tmp1 ^ c3. c3 at bit 126 == 1 */
-	tmp1[15] ^= 1 << 1;
-	l_cipher_encrypt(aes, tmp1, ck, 16);
-	/* ck ^ opc */
-	XOR(ck, ck, opc, 16);
-
-	/*
-	 * f4 outputs IK (OUT4)
-	 *
-	 * tmp1 = rot(TEMP ^ OPc)r4
-	 *
-	 * r4 = 64 bits = 8 bytes
-	 */
-	for (i = 0; i < 16; i++)
-		tmp1[(i + 8) % 16] = temp[i] ^ opc[i];
-
-	/* tmp1 ^ c4. c4@bit 125 == 1 */
-	tmp1[15] ^= 1 << 2;
-	l_cipher_encrypt(aes, tmp1, ik, 16);
-	/* ik ^ opc */
-	XOR(ik, ik, opc, 16);
-
-	l_cipher_free(aes);
-
-	return 0;
-}
-
-static int check_milenage(struct iwd_sim_auth *auth, const uint8_t *rand,
-		const uint8_t *autn, sim_auth_check_milenage_cb_t cb,
-		void *data)
-{
-	uint8_t res[8];
-	uint8_t ck[16];
-	uint8_t ik[16];
-	uint8_t _autn[16];
-	uint8_t auts[14];
-	int ret;
-
-	if (!sim->aka_supported)
-		return -ENOTSUP;
-
-	ret = get_milenage(sim->opc, sim->ki, rand, sim->sqn, sim->amf,
-			autn, _autn, ck, ik, res, auts);
-
-	/* ret == 0, success; ret == -1, sync failure; ret == -2, failure */
-	if (ret == 0)
-		cb(res, ck, ik, NULL, data);
-	else if (ret == -1)
-		cb(NULL, NULL, NULL, auts, data);
-	else
-		cb(NULL, NULL, NULL, NULL, data);
-
-	return 0;
-
-}
-
-static int run_gsm(struct iwd_sim_auth *auth, const uint8_t *rands,
-		int num_rands, sim_auth_run_gsm_cb_t cb, void *data)
-{
-	if (!sim->sim_supported)
-		return -ENOTSUP;
-
-	cb((const uint8_t *)sim->sres, (const uint8_t *)sim->kc, data);
-
-	return 0;
-}
-
-static struct iwd_sim_auth_driver hardcoded_sim_driver = {
-		.name = "Hardcoded SIM driver",
-		.check_milenage = check_milenage,
-		.run_gsm = run_gsm
-};
-
-static int sim_hardcoded_init(void)
-{
-	void *kc;
-	void *sres;
-	void *ki;
-	void *opc;
-	void *amf;
-	void *sqn;
-	const char *str;
-	size_t len;
-	struct l_settings *key_settings;
-	const char *config_path = getenv("IWD_SIM_KEYS");
-
-	if (!config_path) {
-		l_debug("IWD_SIM_KEYS not set in env");
-		return -ENOENT;
-	}
-
-	key_settings = l_settings_new();
-
-	if (!l_settings_load_from_file(key_settings, config_path)) {
-		l_error("No %s file found", config_path);
-		l_settings_free(key_settings);
-		return -ENOENT;
-	}
-
-	sim = l_new(struct hardcoded_sim, 1);
-
-	if (l_settings_has_group(key_settings, "SIM")) {
-		str = l_settings_get_value(key_settings, "SIM", "Kc");
-		if (!str) {
-			l_debug("Kc value must be present for SIM");
-			goto try_aka;
-		}
-
-		kc = l_util_from_hexstring(str, &len);
-		memcpy(sim->kc, kc, len);
-		l_free(kc);
-
-		str = l_settings_get_value(key_settings, "SIM", "SRES");
-		if (!str) {
-			l_debug("SRES value must be present for SIM");
-			goto try_aka;
-		}
-
-		sres = l_util_from_hexstring(str, &len);
-		memcpy(sim->sres, sres, NUM_RANDS_MAX * EAP_SIM_SRES_LEN);
-		l_free(sres);
-
-		str = l_settings_get_value(key_settings, "SIM", "Identity");
-		if (!str) {
-			l_debug("Identity setting must be present for SIM");
-			goto try_aka;
-		}
-
-		sim->identity = l_strdup(str);
-
-		sim->sim_supported = 1;
-	}
-
-try_aka:
-	if (l_settings_has_group(key_settings, "AKA")) {
-		str = l_settings_get_value(key_settings, "AKA", "KI");
-		if (!str) {
-			l_debug("KI value must be present for AKA");
-			goto end;
-		}
-
-		ki = l_util_from_hexstring(str, &len);
-		memcpy(sim->ki, ki, EAP_AKA_KI_LEN);
-		l_free(ki);
-
-		str = l_settings_get_value(key_settings, "AKA", "OPC");
-		if (!str) {
-			l_debug("OPC value must be preset for AKA");
-			goto end;
-		}
-
-		opc = l_util_from_hexstring(str, &len);
-		memcpy(sim->opc, opc, EAP_AKA_OPC_LEN);
-		l_free(opc);
-
-		str = l_settings_get_value(key_settings, "AKA", "AMF");
-		if (!str) {
-			l_debug("AMF value must be present for AKA");
-			goto end;
-		}
-
-		amf = l_util_from_hexstring(str, &len);
-		memcpy(sim->amf, amf, EAP_AKA_AMF_LEN);
-		l_free(amf);
-
-		str = l_settings_get_value(key_settings, "AKA", "SQN");
-		if (!str) {
-			l_debug("SQN value must be present for AKA");
-			goto end;
-		}
-
-		sqn = l_util_from_hexstring(str, &len);
-		memcpy(sim->sqn, sqn, EAP_AKA_SQN_LEN);
-		l_free(sqn);
-
-		str = l_settings_get_value(key_settings, "AKA", "Identity");
-		if (!str) {
-			l_debug("Identity setting must be present for AKA");
-			goto end;
-		}
-
-		sim->identity = l_strdup(str);
-
-		sim->aka_supported = 1;
-	}
-end:
-	l_settings_free(key_settings);
-
-	if (!sim->sim_supported && !sim->aka_supported) {
-		l_debug("error parsing config file, values missing");
-
-		return -EINVAL;
-	}
-
-	sim->auth = iwd_sim_auth_create(&hardcoded_sim_driver);
-
-	iwd_sim_auth_set_nai(sim->auth, sim->identity);
-	iwd_sim_auth_set_capabilities(sim->auth, sim->sim_supported,
-							sim->aka_supported);
-
-	iwd_sim_auth_register(sim->auth);
-
-	return 0;
-}
-
-static void sim_hardcoded_exit(void)
-{
-	iwd_sim_auth_remove(sim->auth);
-
-	if (sim)
-		l_free(sim->identity);
-
-	l_free(sim);
-}
-
-L_PLUGIN_DEFINE(__iwd_builtin_sim_hardcoded, sim_hardcoded,
-		"Hardcoded SIM driver", "1.0", L_PLUGIN_PRIORITY_DEFAULT,
-		sim_hardcoded_init, sim_hardcoded_exit)
diff --git a/src/main.c b/src/main.c
index 3216f508..2ee6188c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -40,7 +40,6 @@
 #include "src/eap.h"
 #include "src/eapol.h"
 #include "src/rfkill.h"
-#include "src/plugin.h"
 #include "src/storage.h"
 #include "src/anqp.h"
 
@@ -54,8 +53,6 @@ static const char *interfaces;
 static const char *nointerfaces;
 static const char *phys;
 static const char *nophys;
-static const char *plugins;
-static const char *noplugins;
 static const char *debugopt;
 static bool terminating;
 static bool nl80211_complete;
@@ -140,8 +137,6 @@ static void usage(void)
 		"\t-I, --nointerfaces     Interfaces to ignore\n"
 		"\t-p, --phys             Phys to manage\n"
 		"\t-P, --nophys           Phys to ignore\n"
-		"\t-l, --plugin           Plugins to include\n"
-		"\t-L, --noplugin         Plugins to exclude\n"
 		"\t-d, --debug            Enable debug output\n"
 		"\t-v, --version          Show version\n"
 		"\t-h, --help             Show help options\n");
@@ -154,8 +149,6 @@ static const struct option main_options[] = {
 	{ "nointerfaces", required_argument, NULL, 'I' },
 	{ "phys",         required_argument, NULL, 'p' },
 	{ "nophys",       required_argument, NULL, 'P' },
-	{ "plugin",       required_argument, NULL, 'l' },
-	{ "noplugin",     required_argument, NULL, 'L' },
 	{ "debug",        optional_argument, NULL, 'd' },
 	{ "help",         no_argument,       NULL, 'h' },
 	{ }
@@ -179,8 +172,6 @@ static void nl80211_appeared(const struct l_genl_family_info *info,
 		l_main_quit();
 		return;
 	}
-
-	plugin_init(plugins, noplugins);
 }
 
 static void request_name_callback(struct l_dbus *dbus, bool success,
@@ -393,12 +384,6 @@ int main(int argc, char *argv[])
 		case 'P':
 			nophys = optarg;
 			break;
-		case 'l':
-			plugins = optarg;
-			break;
-		case 'L':
-			noplugins = optarg;
-			break;
 		case 'd':
 			if (optarg)
 				debugopt = optarg;
@@ -504,7 +489,6 @@ int main(int argc, char *argv[])
 
 	exit_status = l_main_run_with_signal(signal_handler, NULL);
 
-	plugin_exit();
 	iwd_modules_exit();
 	dbus_exit();
 	l_dbus_destroy(dbus);
diff --git a/plugins/ofono.c b/src/ofono.c
similarity index 100%
rename from plugins/ofono.c
rename to src/ofono.c
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/6] test-runner: remove ofono/hardcoded IWD options
  2020-09-16 19:39 [PATCH v2 1/6] plugins: remove dependency on ELL plugins James Prestwood
  2020-09-16 19:33 ` Denis Kenzior
@ 2020-09-16 19:39 ` James Prestwood
  2020-09-16 19:39 ` [PATCH v2 3/6] ofono: convert to module James Prestwood
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: James Prestwood @ 2020-09-16 19:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

---
 tools/test-runner | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tools/test-runner b/tools/test-runner
index 8a257be1..a320a3f0 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -609,7 +609,6 @@ class TestContext:
 			return
 		elif sim_keys != 'ofono':
 			os.environ['IWD_SIM_KEYS'] = sim_keys
-			self.iwd_extra_options = '--plugin=sim_hardcoded'
 			return
 
 		if not find_binary(['ofonod']) or not find_binary(['phonesim']):
@@ -618,8 +617,6 @@ class TestContext:
 
 		Process(['ifconfig', 'lo', 'up'], wait=True)
 
-		self.iwd_extra_options = '--plugin=ofono'
-
 		os.environ['OFONO_PHONESIM_CONFIG'] = '/tmp/phonesim.conf'
 
 		phonesim_args = ['phonesim', '-p', '12345', '/usr/share/phonesim/default.xml']
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/6] ofono: convert to module
  2020-09-16 19:39 [PATCH v2 1/6] plugins: remove dependency on ELL plugins James Prestwood
  2020-09-16 19:33 ` Denis Kenzior
  2020-09-16 19:39 ` [PATCH v2 2/6] test-runner: remove ofono/hardcoded IWD options James Prestwood
@ 2020-09-16 19:39 ` James Prestwood
  2020-09-16 19:39 ` [PATCH v2 4/6] plugin: remove plugin source James Prestwood
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: James Prestwood @ 2020-09-16 19:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

---
 src/ofono.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/ofono.c b/src/ofono.c
index 186dac71..3855edb3 100644
--- a/src/ofono.c
+++ b/src/ofono.c
@@ -30,11 +30,12 @@
 #include <errno.h>
 
 #include <ell/ell.h>
-#include <ell/plugin.h>
 #include <ell/dbus.h>
 
 #include "src/dbus.h"
 #include "src/simauth.h"
+#include "src/module.h"
+#include "src/iwd.h"
 
 /*
  * This plugin takes care of all the communication with ofono in order to
@@ -783,5 +784,5 @@ static void ofono_exit(void)
 	l_dbus_remove_watch(dbus, ofono_watch);
 }
 
-L_PLUGIN_DEFINE(__iwd_builtin_ofono, ofono, "oFono plugin", "1.0",
-		L_PLUGIN_PRIORITY_DEFAULT, ofono_init, ofono_exit)
+IWD_MODULE(ofono, ofono_init, ofono_exit);
+IWD_MODULE_DEPENDS(ofono, simauth);
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 4/6] plugin: remove plugin source
  2020-09-16 19:39 [PATCH v2 1/6] plugins: remove dependency on ELL plugins James Prestwood
                   ` (2 preceding siblings ...)
  2020-09-16 19:39 ` [PATCH v2 3/6] ofono: convert to module James Prestwood
@ 2020-09-16 19:39 ` James Prestwood
  2020-09-16 19:39 ` [PATCH v2 5/6] auto-t: remove sim_hardcoded tests James Prestwood
  2020-09-16 19:39 ` [PATCH v2 6/6] auto-t: update EAP-PEAP-SIM test to use ofono James Prestwood
  5 siblings, 0 replies; 7+ messages in thread
From: James Prestwood @ 2020-09-16 19:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 3861 bytes --]

---
 src/plugin.c | 97 ----------------------------------------------------
 src/plugin.h | 24 -------------
 2 files changed, 121 deletions(-)
 delete mode 100644 src/plugin.c
 delete mode 100644 src/plugin.h

diff --git a/src/plugin.c b/src/plugin.c
deleted file mode 100644
index b5dc828a..00000000
--- a/src/plugin.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *
- *  Wireless daemon for Linux
- *
- *  Copyright (C) 2017-2019  Intel Corporation. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <fnmatch.h>
-
-#include <ell/ell.h>
-#include <ell/plugin.h>
-
-#include "src/builtin.h"
-#include "src/plugin.h"
-
-static bool check_plugin(struct l_plugin_desc *desc,
-						char **include, char **exclude)
-{
-	char *pattern;
-	unsigned int i;
-
-	if (!include)
-		goto check_blacklist;
-
-	for (i = 0; (pattern = include[i]); i++) {
-		if (fnmatch(pattern, desc->name, 0) != 0)
-			continue;
-
-		goto check_blacklist;
-	}
-
-	l_debug("whitelist filtered plugin: %s", desc->name);
-	return false;
-
-check_blacklist:
-	if (!exclude)
-		return true;
-
-	for (i = 0; (pattern = exclude[i]); i++) {
-		if (fnmatch(pattern, desc->name, 0) == 0) {
-			l_debug("blacklist filtered plugin: %s", desc->name);
-			return false;
-		}
-	}
-
-	return true;
-}
-
-int plugin_init(const char *include, const char *exclude)
-{
-	char **inc = NULL;
-	char **exc = NULL;
-	int i;
-
-	if (include)
-		inc = l_strsplit_set(include, ",");
-
-	if (exclude)
-		exc = l_strsplit_set(exclude, ",");
-
-	for (i = 0; __iwd_builtin[i]; i++) {
-		if (check_plugin(__iwd_builtin[i], inc, exc))
-			l_plugin_add(__iwd_builtin[i],
-					__iwd_builtin[i]->version);
-	}
-
-	l_plugin_load(NULL, NULL, NULL);
-
-	l_strfreev(inc);
-	l_strfreev(exc);
-
-	return 1;
-}
-
-void plugin_exit(void)
-{
-	l_plugin_unload();
-}
diff --git a/src/plugin.h b/src/plugin.h
deleted file mode 100644
index 1c1cbc07..00000000
--- a/src/plugin.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *
- *  Wireless daemon for Linux
- *
- *  Copyright (C) 2017-2019  Intel Corporation. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-int plugin_init(const char *include, const char *exclude);
-void plugin_exit(void);
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 5/6] auto-t: remove sim_hardcoded tests
  2020-09-16 19:39 [PATCH v2 1/6] plugins: remove dependency on ELL plugins James Prestwood
                   ` (3 preceding siblings ...)
  2020-09-16 19:39 ` [PATCH v2 4/6] plugin: remove plugin source James Prestwood
@ 2020-09-16 19:39 ` James Prestwood
  2020-09-16 19:39 ` [PATCH v2 6/6] auto-t: update EAP-PEAP-SIM test to use ofono James Prestwood
  5 siblings, 0 replies; 7+ messages in thread
From: James Prestwood @ 2020-09-16 19:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 15423 bytes --]

---
 .../testEAP-AKA-prime/connection_test.py      | 61 ---------------
 autotests/testEAP-AKA-prime/hw.conf           |  8 --
 autotests/testEAP-AKA-prime/sim.db            |  1 -
 autotests/testEAP-AKA-prime/sim.eap_user      |  1 -
 autotests/testEAP-AKA-prime/sim_keys.conf     |  6 --
 autotests/testEAP-AKA-prime/ssidEAP-AKA.8021x |  5 --
 autotests/testEAP-AKA-prime/ssidEAP-AKA.conf  | 16 ----
 autotests/testEAP-AKA/connection_test.py      | 75 -------------------
 autotests/testEAP-AKA/hw.conf                 |  8 --
 autotests/testEAP-AKA/sim.db                  |  1 -
 autotests/testEAP-AKA/sim.eap_user            |  1 -
 autotests/testEAP-AKA/sim_keys.conf           |  6 --
 autotests/testEAP-AKA/ssidEAP-AKA.8021x       |  5 --
 autotests/testEAP-AKA/ssidEAP-AKA.conf        | 16 ----
 autotests/testEAP-SIM/connection_test.py      | 74 ------------------
 autotests/testEAP-SIM/hw.conf                 |  8 --
 autotests/testEAP-SIM/sim.db                  |  1 -
 autotests/testEAP-SIM/sim.eap_user            |  1 -
 autotests/testEAP-SIM/sim_keys.conf           |  4 -
 autotests/testEAP-SIM/ssidEAP-SIM.8021x       |  5 --
 autotests/testEAP-SIM/ssidEAP-SIM.conf        | 16 ----
 21 files changed, 319 deletions(-)
 delete mode 100644 autotests/testEAP-AKA-prime/connection_test.py
 delete mode 100644 autotests/testEAP-AKA-prime/hw.conf
 delete mode 100644 autotests/testEAP-AKA-prime/sim.db
 delete mode 100644 autotests/testEAP-AKA-prime/sim.eap_user
 delete mode 100644 autotests/testEAP-AKA-prime/sim_keys.conf
 delete mode 100644 autotests/testEAP-AKA-prime/ssidEAP-AKA.8021x
 delete mode 100644 autotests/testEAP-AKA-prime/ssidEAP-AKA.conf
 delete mode 100644 autotests/testEAP-AKA/connection_test.py
 delete mode 100644 autotests/testEAP-AKA/hw.conf
 delete mode 100644 autotests/testEAP-AKA/sim.db
 delete mode 100644 autotests/testEAP-AKA/sim.eap_user
 delete mode 100644 autotests/testEAP-AKA/sim_keys.conf
 delete mode 100644 autotests/testEAP-AKA/ssidEAP-AKA.8021x
 delete mode 100644 autotests/testEAP-AKA/ssidEAP-AKA.conf
 delete mode 100644 autotests/testEAP-SIM/connection_test.py
 delete mode 100644 autotests/testEAP-SIM/hw.conf
 delete mode 100644 autotests/testEAP-SIM/sim.db
 delete mode 100644 autotests/testEAP-SIM/sim.eap_user
 delete mode 100644 autotests/testEAP-SIM/sim_keys.conf
 delete mode 100644 autotests/testEAP-SIM/ssidEAP-SIM.8021x
 delete mode 100644 autotests/testEAP-SIM/ssidEAP-SIM.conf

diff --git a/autotests/testEAP-AKA-prime/connection_test.py b/autotests/testEAP-AKA-prime/connection_test.py
deleted file mode 100644
index 8367022c..00000000
--- a/autotests/testEAP-AKA-prime/connection_test.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/python3
-
-import unittest
-import sys
-
-sys.path.append('../util')
-import iwd
-from iwd import IWD
-from iwd import NetworkType
-from hlrauc import AuthCenter
-
-class Test(unittest.TestCase):
-
-    def test_connection_success(self):
-        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
-
-        wd = IWD()
-
-        devices = wd.list_devices(1)
-        device = devices[0]
-
-        condition = 'not obj.scanning'
-        wd.wait_for_object_condition(device, condition)
-
-        device.scan()
-
-        condition = 'not obj.scanning'
-        wd.wait_for_object_condition(device, condition)
-
-        ordered_network = device.get_ordered_network('ssidEAP-AKA')
-
-        self.assertEqual(ordered_network.type, NetworkType.eap)
-
-        condition = 'not obj.connected'
-        wd.wait_for_object_condition(ordered_network.network_object, condition)
-
-        try:
-                ordered_network.network_object.connect()
-        except:
-                auth.stop()
-                raise
-
-        condition = 'obj.state == DeviceState.connected'
-        wd.wait_for_object_condition(device, condition)
-
-        device.disconnect()
-
-        condition = 'not obj.connected'
-        wd.wait_for_object_condition(ordered_network.network_object, condition)
-
-        auth.stop()
-    @classmethod
-    def setUpClass(cls):
-        IWD.copy_to_storage('ssidEAP-AKA.8021x')
-
-    @classmethod
-    def tearDownClass(cls):
-        IWD.clear_storage()
-
-if __name__ == '__main__':
-    unittest.main(exit=True)
diff --git a/autotests/testEAP-AKA-prime/hw.conf b/autotests/testEAP-AKA-prime/hw.conf
deleted file mode 100644
index 61dcc807..00000000
--- a/autotests/testEAP-AKA-prime/hw.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-[SETUP]
-num_radios=2
-max_test_exec_interval_sec=40
-tmpfs_extra_stuff=sim.eap_user:sim.db:sim_keys.conf
-sim_keys=/tmp/sim_keys.conf
-
-[HOSTAPD]
-rad0=ssidEAP-AKA.conf
diff --git a/autotests/testEAP-AKA-prime/sim.db b/autotests/testEAP-AKA-prime/sim.db
deleted file mode 100644
index 526e4bb1..00000000
--- a/autotests/testEAP-AKA-prime/sim.db
+++ /dev/null
@@ -1 +0,0 @@
-32010000000000:90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581:61df:000000000021
\ No newline at end of file
diff --git a/autotests/testEAP-AKA-prime/sim.eap_user b/autotests/testEAP-AKA-prime/sim.eap_user
deleted file mode 100644
index 915c8fb0..00000000
--- a/autotests/testEAP-AKA-prime/sim.eap_user
+++ /dev/null
@@ -1 +0,0 @@
-"632010000000000(a)example.com"	AKA'
\ No newline at end of file
diff --git a/autotests/testEAP-AKA-prime/sim_keys.conf b/autotests/testEAP-AKA-prime/sim_keys.conf
deleted file mode 100644
index fe7a6399..00000000
--- a/autotests/testEAP-AKA-prime/sim_keys.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-[AKA]
-Identity=32010000000000(a)example.com
-KI=90dca4eda45b53cf0f12d7c9c3bc6a89
-OPC=cb9cccc4b9258e6dca4760379fb82581
-AMF=61df
-SQN=000000000021
diff --git a/autotests/testEAP-AKA-prime/ssidEAP-AKA.8021x b/autotests/testEAP-AKA-prime/ssidEAP-AKA.8021x
deleted file mode 100644
index 6e88da6b..00000000
--- a/autotests/testEAP-AKA-prime/ssidEAP-AKA.8021x
+++ /dev/null
@@ -1,5 +0,0 @@
-[Security]
-EAP-Method=AKA'
-
-[Settings]
-AutoConnect=false
diff --git a/autotests/testEAP-AKA-prime/ssidEAP-AKA.conf b/autotests/testEAP-AKA-prime/ssidEAP-AKA.conf
deleted file mode 100644
index 01f01f45..00000000
--- a/autotests/testEAP-AKA-prime/ssidEAP-AKA.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-hw_mode=g
-channel=1
-
-driver=nl80211
-ieee8021x=1
-eap_server=1
-ssid=ssidEAP-AKA
-eap_user_file=/tmp/sim.eap_user
-eap_sim_db=unix:/tmp/hlrauc.sock
-wpa=2
-wpa_key_mgmt=WPA-EAP
-wpa_pairwise=TKIP CCMP
-rsn_pairwise=CCMP TKIP
-wpa_passphrase=secret123
-channel=1
-eap_sim_aka_result_ind=1
diff --git a/autotests/testEAP-AKA/connection_test.py b/autotests/testEAP-AKA/connection_test.py
deleted file mode 100644
index 122fd6b7..00000000
--- a/autotests/testEAP-AKA/connection_test.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/python3
-
-import unittest
-import sys
-
-sys.path.append('../util')
-import iwd
-from iwd import IWD
-from iwd import NetworkType
-from hlrauc import AuthCenter
-
-from hostapd import HostapdCLI
-
-class Test(unittest.TestCase):
-
-    def test_connection_success(self):
-        hostapd = HostapdCLI(config='ssidEAP-AKA.conf')
-
-        self.assertIsNotNone(hostapd)
-
-        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
-
-        wd = IWD()
-
-        devices = wd.list_devices(1)
-        device = devices[0]
-
-        condition = 'not obj.scanning'
-        wd.wait_for_object_condition(device, condition)
-
-        device.scan()
-
-        condition = 'not obj.scanning'
-        wd.wait_for_object_condition(device, condition)
-
-        ordered_network = device.get_ordered_network('ssidEAP-AKA')
-
-        self.assertEqual(ordered_network.type, NetworkType.eap)
-
-        condition = 'not obj.connected'
-        wd.wait_for_object_condition(ordered_network.network_object, condition)
-
-        try:
-                ordered_network.network_object.connect()
-        except:
-                auth.stop()
-                raise
-
-        condition = 'obj.state == DeviceState.connected'
-        wd.wait_for_object_condition(device, condition)
-
-        hostapd.eapol_reauth(device.address)
-
-        hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
-        hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
-
-        condition = 'obj.state == DeviceState.connected'
-        wd.wait_for_object_condition(device, condition)
-
-        device.disconnect()
-
-        condition = 'not obj.connected'
-        wd.wait_for_object_condition(ordered_network.network_object, condition)
-
-        auth.stop()
-    @classmethod
-    def setUpClass(cls):
-        IWD.copy_to_storage('ssidEAP-AKA.8021x')
-
-    @classmethod
-    def tearDownClass(cls):
-        IWD.clear_storage()
-
-if __name__ == '__main__':
-    unittest.main(exit=True)
diff --git a/autotests/testEAP-AKA/hw.conf b/autotests/testEAP-AKA/hw.conf
deleted file mode 100644
index 61dcc807..00000000
--- a/autotests/testEAP-AKA/hw.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-[SETUP]
-num_radios=2
-max_test_exec_interval_sec=40
-tmpfs_extra_stuff=sim.eap_user:sim.db:sim_keys.conf
-sim_keys=/tmp/sim_keys.conf
-
-[HOSTAPD]
-rad0=ssidEAP-AKA.conf
diff --git a/autotests/testEAP-AKA/sim.db b/autotests/testEAP-AKA/sim.db
deleted file mode 100644
index 526e4bb1..00000000
--- a/autotests/testEAP-AKA/sim.db
+++ /dev/null
@@ -1 +0,0 @@
-32010000000000:90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581:61df:000000000021
\ No newline at end of file
diff --git a/autotests/testEAP-AKA/sim.eap_user b/autotests/testEAP-AKA/sim.eap_user
deleted file mode 100644
index ef82f9f1..00000000
--- a/autotests/testEAP-AKA/sim.eap_user
+++ /dev/null
@@ -1 +0,0 @@
-"032010000000000(a)example.com"	AKA
diff --git a/autotests/testEAP-AKA/sim_keys.conf b/autotests/testEAP-AKA/sim_keys.conf
deleted file mode 100644
index fe7a6399..00000000
--- a/autotests/testEAP-AKA/sim_keys.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-[AKA]
-Identity=32010000000000(a)example.com
-KI=90dca4eda45b53cf0f12d7c9c3bc6a89
-OPC=cb9cccc4b9258e6dca4760379fb82581
-AMF=61df
-SQN=000000000021
diff --git a/autotests/testEAP-AKA/ssidEAP-AKA.8021x b/autotests/testEAP-AKA/ssidEAP-AKA.8021x
deleted file mode 100644
index 304eb276..00000000
--- a/autotests/testEAP-AKA/ssidEAP-AKA.8021x
+++ /dev/null
@@ -1,5 +0,0 @@
-[Security]
-EAP-Method=AKA
-
-[Settings]
-AutoConnect=false
diff --git a/autotests/testEAP-AKA/ssidEAP-AKA.conf b/autotests/testEAP-AKA/ssidEAP-AKA.conf
deleted file mode 100644
index 01f01f45..00000000
--- a/autotests/testEAP-AKA/ssidEAP-AKA.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-hw_mode=g
-channel=1
-
-driver=nl80211
-ieee8021x=1
-eap_server=1
-ssid=ssidEAP-AKA
-eap_user_file=/tmp/sim.eap_user
-eap_sim_db=unix:/tmp/hlrauc.sock
-wpa=2
-wpa_key_mgmt=WPA-EAP
-wpa_pairwise=TKIP CCMP
-rsn_pairwise=CCMP TKIP
-wpa_passphrase=secret123
-channel=1
-eap_sim_aka_result_ind=1
diff --git a/autotests/testEAP-SIM/connection_test.py b/autotests/testEAP-SIM/connection_test.py
deleted file mode 100644
index a7615b52..00000000
--- a/autotests/testEAP-SIM/connection_test.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/python3
-
-import unittest
-import sys
-
-sys.path.append('../util')
-import iwd
-from iwd import IWD
-from iwd import NetworkType
-from hlrauc import AuthCenter
-
-from hostapd import HostapdCLI
-
-class Test(unittest.TestCase):
-
-    def test_connection_success(self):
-        hostapd = HostapdCLI(config='ssidEAP-SIM.conf')
-
-        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
-
-        wd = IWD()
-
-        devices = wd.list_devices(1)
-        device = devices[0]
-
-        condition = 'not obj.scanning'
-        wd.wait_for_object_condition(device, condition)
-
-        device.scan()
-
-        condition = 'not obj.scanning'
-        wd.wait_for_object_condition(device, condition)
-
-        ordered_network = device.get_ordered_network('ssidEAP-SIM')
-
-        self.assertEqual(ordered_network.type, NetworkType.eap)
-
-        condition = 'not obj.connected'
-        wd.wait_for_object_condition(ordered_network.network_object, condition)
-
-        try:
-                ordered_network.network_object.connect()
-        except:
-                auth.stop()
-                raise
-
-        condition = 'obj.state == DeviceState.connected'
-        wd.wait_for_object_condition(device, condition)
-
-        hostapd.eapol_reauth(device.address)
-
-        hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
-        hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
-
-        condition = 'obj.state == DeviceState.connected'
-        wd.wait_for_object_condition(device, condition)
-
-        device.disconnect()
-
-        condition = 'not obj.connected'
-        wd.wait_for_object_condition(ordered_network.network_object, condition)
-
-        auth.stop()
-
-    @classmethod
-    def setUpClass(cls):
-        IWD.copy_to_storage('ssidEAP-SIM.8021x')
-
-    @classmethod
-    def tearDownClass(cls):
-        IWD.clear_storage()
-
-if __name__ == '__main__':
-    unittest.main(exit=True)
diff --git a/autotests/testEAP-SIM/hw.conf b/autotests/testEAP-SIM/hw.conf
deleted file mode 100644
index d725e38a..00000000
--- a/autotests/testEAP-SIM/hw.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-[SETUP]
-num_radios=2
-max_test_exec_interval_sec=40
-tmpfs_extra_stuff=sim.eap_user:sim.db:sim_keys.conf
-sim_keys=/tmp/sim_keys.conf
-
-[HOSTAPD]
-rad0=ssidEAP-SIM.conf
diff --git a/autotests/testEAP-SIM/sim.db b/autotests/testEAP-SIM/sim.db
deleted file mode 100644
index 04f0ac8e..00000000
--- a/autotests/testEAP-SIM/sim.db
+++ /dev/null
@@ -1 +0,0 @@
-32010000000000:D0D1D2D3D4D5D6D7:E1E2E3E4:DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
\ No newline at end of file
diff --git a/autotests/testEAP-SIM/sim.eap_user b/autotests/testEAP-SIM/sim.eap_user
deleted file mode 100644
index 17f7e1ae..00000000
--- a/autotests/testEAP-SIM/sim.eap_user
+++ /dev/null
@@ -1 +0,0 @@
-"132010000000000(a)example.com"	SIM
diff --git a/autotests/testEAP-SIM/sim_keys.conf b/autotests/testEAP-SIM/sim_keys.conf
deleted file mode 100644
index 000760ad..00000000
--- a/autotests/testEAP-SIM/sim_keys.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-[SIM]
-Identity=32010000000000(a)example.com
-Kc=d0d1d2d3d4d5d6d7d0d1d2d3d4d5d6d7d0d1d2d3d4d5d6d7
-SRES=e1e2e3e4e1e2e3e4e1e2e3e4
diff --git a/autotests/testEAP-SIM/ssidEAP-SIM.8021x b/autotests/testEAP-SIM/ssidEAP-SIM.8021x
deleted file mode 100644
index 1dcdbcb6..00000000
--- a/autotests/testEAP-SIM/ssidEAP-SIM.8021x
+++ /dev/null
@@ -1,5 +0,0 @@
-[Security]
-EAP-Method=SIM
-
-[Settings]
-AutoConnect=false
diff --git a/autotests/testEAP-SIM/ssidEAP-SIM.conf b/autotests/testEAP-SIM/ssidEAP-SIM.conf
deleted file mode 100644
index 6071e301..00000000
--- a/autotests/testEAP-SIM/ssidEAP-SIM.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-hw_mode=g
-channel=1
-
-driver=nl80211
-ieee8021x=1
-eap_server=1
-ssid=ssidEAP-SIM
-eap_user_file=/tmp/sim.eap_user
-eap_sim_db=unix:/tmp/hlrauc.sock
-wpa=2
-wpa_key_mgmt=WPA-EAP
-wpa_pairwise=TKIP CCMP
-rsn_pairwise=CCMP TKIP
-wpa_passphrase=secret123
-channel=1
-eap_sim_aka_result_ind=1
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 6/6] auto-t: update EAP-PEAP-SIM test to use ofono
  2020-09-16 19:39 [PATCH v2 1/6] plugins: remove dependency on ELL plugins James Prestwood
                   ` (4 preceding siblings ...)
  2020-09-16 19:39 ` [PATCH v2 5/6] auto-t: remove sim_hardcoded tests James Prestwood
@ 2020-09-16 19:39 ` James Prestwood
  5 siblings, 0 replies; 7+ messages in thread
From: James Prestwood @ 2020-09-16 19:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 3123 bytes --]

---
 autotests/misc/secrets/eap-user-peap-sim.text | 2 +-
 autotests/testEAP-PEAP-SIM/connection_test.py | 6 ++++++
 autotests/testEAP-PEAP-SIM/hw.conf            | 4 +---
 autotests/testEAP-PEAP-SIM/sim.db             | 2 +-
 autotests/testEAP-PEAP-SIM/sim.eap_user       | 2 +-
 autotests/testEAP-PEAP-SIM/sim_keys.conf      | 4 ----
 6 files changed, 10 insertions(+), 10 deletions(-)
 delete mode 100644 autotests/testEAP-PEAP-SIM/sim_keys.conf

diff --git a/autotests/misc/secrets/eap-user-peap-sim.text b/autotests/misc/secrets/eap-user-peap-sim.text
index b3875a5c..76820116 100644
--- a/autotests/misc/secrets/eap-user-peap-sim.text
+++ b/autotests/misc/secrets/eap-user-peap-sim.text
@@ -1,4 +1,4 @@
 # Phase 1 users
 *	PEAP
 # Phase 2
-"132010000000000(a)example.com"	SIM	[2]
+"112345678(a)phonesim.org"	SIM	[2]
diff --git a/autotests/testEAP-PEAP-SIM/connection_test.py b/autotests/testEAP-PEAP-SIM/connection_test.py
index e4f03dc2..37398c15 100644
--- a/autotests/testEAP-PEAP-SIM/connection_test.py
+++ b/autotests/testEAP-PEAP-SIM/connection_test.py
@@ -9,6 +9,7 @@ import iwd
 from iwd import IWD
 from iwd import NetworkType
 from hlrauc import AuthCenter
+from ofono import Ofono
 
 class Test(unittest.TestCase):
     def validate_connection(self, wd):
@@ -44,6 +45,11 @@ class Test(unittest.TestCase):
 
     def test_connection_success(self):
         auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
+
+        ofono = Ofono()
+        ofono.enable_modem('/phonesim')
+        ofono.wait_for_sim_auth()
+
         wd = IWD(True)
 
         try:
diff --git a/autotests/testEAP-PEAP-SIM/hw.conf b/autotests/testEAP-PEAP-SIM/hw.conf
index f98429f4..659ba0e0 100644
--- a/autotests/testEAP-PEAP-SIM/hw.conf
+++ b/autotests/testEAP-PEAP-SIM/hw.conf
@@ -1,9 +1,7 @@
 [SETUP]
 num_radios=2
 start_iwd=0
-max_test_exec_interval_sec=60
-tmpfs_extra_stuff=sim.eap_user:sim.db:sim_keys.conf:../misc/certs:../misc/secrets
-sim_keys=/tmp/sim_keys.conf
+sim_keys=ofono
 
 [HOSTAPD]
 rad0=ssidEAP-PEAP-SIM.conf
diff --git a/autotests/testEAP-PEAP-SIM/sim.db b/autotests/testEAP-PEAP-SIM/sim.db
index b7f51e66..fbf79786 100644
--- a/autotests/testEAP-PEAP-SIM/sim.db
+++ b/autotests/testEAP-PEAP-SIM/sim.db
@@ -1 +1 @@
-32010000000000:D0D1D2D3D4D5D6D7:E1E2E3E4:DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
+12345678:673fb8cd35f98800:1fb1e3b5:DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
diff --git a/autotests/testEAP-PEAP-SIM/sim.eap_user b/autotests/testEAP-PEAP-SIM/sim.eap_user
index 17f7e1ae..dabb81a8 100644
--- a/autotests/testEAP-PEAP-SIM/sim.eap_user
+++ b/autotests/testEAP-PEAP-SIM/sim.eap_user
@@ -1 +1 @@
-"132010000000000(a)example.com"	SIM
+"112345678(a)phonesim.org"	SIM
diff --git a/autotests/testEAP-PEAP-SIM/sim_keys.conf b/autotests/testEAP-PEAP-SIM/sim_keys.conf
deleted file mode 100644
index 000760ad..00000000
--- a/autotests/testEAP-PEAP-SIM/sim_keys.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-[SIM]
-Identity=32010000000000(a)example.com
-Kc=d0d1d2d3d4d5d6d7d0d1d2d3d4d5d6d7d0d1d2d3d4d5d6d7
-SRES=e1e2e3e4e1e2e3e4e1e2e3e4
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-16 19:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 19:39 [PATCH v2 1/6] plugins: remove dependency on ELL plugins James Prestwood
2020-09-16 19:33 ` Denis Kenzior
2020-09-16 19:39 ` [PATCH v2 2/6] test-runner: remove ofono/hardcoded IWD options James Prestwood
2020-09-16 19:39 ` [PATCH v2 3/6] ofono: convert to module James Prestwood
2020-09-16 19:39 ` [PATCH v2 4/6] plugin: remove plugin source James Prestwood
2020-09-16 19:39 ` [PATCH v2 5/6] auto-t: remove sim_hardcoded tests James Prestwood
2020-09-16 19:39 ` [PATCH v2 6/6] auto-t: update EAP-PEAP-SIM test to use ofono James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.