dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43437?usp=email )
Change subject: libipa: remove non spec compliant user consent callback ......................................................................
libipa: remove non spec compliant user consent callback
libipa allows to pass a callback via its configuration struct. This callback is executed before the profile installation and may be used to prompt the user to consent to the profile download.
This is technically a feature that is exclusive to SGP.22. It is not applicable to SGP.32, so let's remove it.
Related: OS#8100 Change-Id: I1882890a5c1c74be1243d9649117ba7220c271d6 --- M include/onomondo/ipa/ipad.h M src/ipa/libipa/proc_indirect_prfle_dwnld.c M src/ipa/libipa/proc_prfle_dwnld.c M src/ipa/main.c 4 files changed, 0 insertions(+), 40 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/37/43437/1
diff --git a/include/onomondo/ipa/ipad.h b/include/onomondo/ipa/ipad.h index eafcee4..77a66df 100644 --- a/include/onomondo/ipa/ipad.h +++ b/include/onomondo/ipa/ipad.h @@ -16,9 +16,6 @@ struct ipa_context; struct ipa_buf;
-/* (deprecated, see github issue #5) */ -typedef bool (*ipa_prfle_inst_consent_cb)(char *sm_dp_plus_address, char *ac_token); - enum ipa_poll_rc { /*! The API user shall call ipa_poll() again immediately. * (there may be still eIM packages waiting to be executed). */ @@ -81,12 +78,6 @@ * consumer eUICC appears as an IoT eUICC on procedure level. */ bool iot_euicc_emu_enabled;
- /*! (deprecated, see github issue #5) Consent to profile installation. - * SGP.32 requires to prompt the user to consent to a profile installation. The API user may pass a callback - * function here to handle the consent request. In case no callback function is provided onomondo-eim will - * automatically consent to any profile installation. */ - ipa_prfle_inst_consent_cb prfle_inst_consent_cb; - /*! Set the Device Capabilities. * As IPAd need to set the device capabilities, it overwrites any other capabilities that might have set by * the modem or IoT device. The upper 5 bits can be set according to section 3.4.2 of SGG.22. The lower 3 diff --git a/src/ipa/libipa/proc_indirect_prfle_dwnld.c b/src/ipa/libipa/proc_indirect_prfle_dwnld.c index 016e9a8..9b233d3 100644 --- a/src/ipa/libipa/proc_indirect_prfle_dwnld.c +++ b/src/ipa/libipa/proc_indirect_prfle_dwnld.c @@ -65,7 +65,6 @@ /* TODO: Check if ProfileMetadata contains Profile Policy Rulses (PPRs) and apply the PPRs as configured on the * eUICC. (This is an optional feature, which we currently do not support, see also proc_euicc_data_req.c) */
- /* TODO: remove this part as it is not required (see also github issue #5) */ /* Execute sub procedure: Sub-procedure Profile Download and Installation – Download Confirmation */ prfle_dwnlod_pars.auth_clnt_ok_dpe = auth_clnt_res->auth_clnt_ok_dpe; get_bnd_prfle_pkg_res = ipa_proc_prfle_dwnlod(ctx, &prfle_dwnlod_pars); @@ -77,17 +76,6 @@ goto error; }
- /* At this point we must ask the user for consent before we proceed with the profile installation. In case the - * user does not consent, we must abort by calling the common cancel session procedure. */ - if (ctx->cfg->prfle_inst_consent_cb - && !ctx->cfg->prfle_inst_consent_cb(activation_code->sm_dp_plus_address, activation_code->ac_token)) { - IPA_LOGP(SIPA, LERROR, "no end user consent for profile installation -- canceling session!\n"); - cmn_cancel_sess_pars.reason = CancelSessionReason_endUserRejection; - cmn_cancel_sess_pars.transaction_id = *auth_clnt_res->transaction_id; - ipa_proc_cmn_cancel_sess(ctx, &cmn_cancel_sess_pars); - goto error; - } - /* Execute sub procedure: Sub-procedure Profile Installation (See also section 3.1.3.3 of SGP.22) */ prfle_inst_pars.bound_profile_package = &get_bnd_prfle_pkg_res->get_bnd_prfle_pkg_ok->boundProfilePackage; if (ipa_proc_prfle_inst(ctx, &prfle_inst_pars) < 0) { diff --git a/src/ipa/libipa/proc_prfle_dwnld.c b/src/ipa/libipa/proc_prfle_dwnld.c index c30442c..f9c5176 100644 --- a/src/ipa/libipa/proc_prfle_dwnld.c +++ b/src/ipa/libipa/proc_prfle_dwnld.c @@ -8,8 +8,6 @@ * See also: GSMA SGP.22, section 3.1.3.2: Sub-procedure Profile Download and Installation – Download Confirmation */
-/* TODO: fix spec reference, see github issue #5 */ - #include <stdio.h> #include <assert.h> #include <string.h> diff --git a/src/ipa/main.c b/src/ipa/main.c index bf2e386..2b15d9b 100644 --- a/src/ipa/main.c +++ b/src/ipa/main.c @@ -37,19 +37,6 @@
bool running = true;
-bool prfle_inst_consent(char *sm_dp_plus_address, char *ac_token) -{ - char user_input; - printf("PLEASE CONSENT TO PROFILE INSTALLATION:\n"); - printf("smdp+: %s\n", sm_dp_plus_address); - printf("ac-token: %s\n", ac_token); - printf("Consent (Y/N)? "); - user_input = getchar(); - if (user_input == 'Y' || user_input == 'y') - return true; - return false; -} - static void print_help(const char *prog_name) { printf("Usage: %s [OPTIONS] [OPERATION]\n", prog_name); @@ -63,7 +50,6 @@ printf(" -n PATH ..................... path to nvstate file (default: %s)\n", DEFAULT_NVSTATE_PATH); printf(" -y NUM ...................... number of retries for ESipa requests (default: %u)\n", DEFAULT_ESIPA_REQ_RETRIES); - printf(" -a .......................... ask end user for consent\n"); printf(" -C .......................... CA (Certificate Authority) Bundle file\n"); printf(" -S .......................... disable HTTPS\n"); printf(" -I .......................... disable SSL certificate verification (insecure)\n"); @@ -222,9 +208,6 @@ case 'y': cfg.esipa_req_retries = atoi(optarg); break; - case 'a': - cfg.prfle_inst_consent_cb = prfle_inst_consent; - break; case '1': getopt_one_euicc_pkg_only = true; break;