jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43060?usp=email )
Change subject: V1.2: Add function to set Device Capabilities
......................................................................
V1.2: Add function to set Device Capabilities
Add new library function to set the SGP.22 Device Capabilities. Also
add an option to the command line interface to call the library
function.
The IoT device (modem) may and the IPA must set Device Capabilities.
They cannot be set independently. The IoT device would overwrite what
IPA has set and vice versa. Therefore add a library function for the
IoT device that takes care about setting the required capabilities for
IPA.
Reference: SGP.22 Section 3.4.2
Related: SYS#8101
Change-Id: I866787b8cda9a87a9f2e0db4965fbb554d339a6c
---
M include/onomondo/ipa/ipad.h
M src/ipa/libipa/euicc.c
M src/ipa/main.c
3 files changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/60/43060/1
diff --git a/include/onomondo/ipa/ipad.h b/include/onomondo/ipa/ipad.h
index ff3bd68..d5d4b58 100644
--- a/include/onomondo/ipa/ipad.h
+++ b/include/onomondo/ipa/ipad.h
@@ -86,6 +86,12 @@
* 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 Capabilites.
+ * 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
+ * bit are set automatically by this IPAd. */
+ uint8_t device_capabilities;
};
struct ipa_context *ipa_new_ctx(struct ipa_config *cfg, struct ipa_buf *nvstate);
diff --git a/src/ipa/libipa/euicc.c b/src/ipa/libipa/euicc.c
index efda3c7..ac03d0f 100644
--- a/src/ipa/libipa/euicc.c
+++ b/src/ipa/libipa/euicc.c
@@ -532,11 +532,12 @@
* \returns 0 on success, negative on error. */
int ipa_euicc_init_es10x(struct ipa_context *ctx)
{
- const uint8_t termcap_euicc[] = { 0xA9, 0x03, 0x83, 0x01, 0x07 };
+ uint8_t termcap_euicc[] = { 0xA9, 0x03, 0x83, 0x01, 0x07 };
const uint8_t termcap_iot[] = { 0xA9, 0x03, 0x84, 0x01, 0x01 };
int rc;
/* Set capabilites to enable support for eUICC functions. */
+ termcap_euicc[4] |= ctx->cfg->device_capabilities;
rc = send_termcap(ctx, termcap_euicc, sizeof(termcap_euicc));
if (rc < 0)
return rc;
diff --git a/src/ipa/main.c b/src/ipa/main.c
index 3e7b7a7..840aaba 100644
--- a/src/ipa/main.c
+++ b/src/ipa/main.c
@@ -64,6 +64,7 @@
printf(" -I ......................... disable SSL certificate verification (insecure)\n");
printf(" -E ......................... emulate IoT eUICC (compatibility mode to use consumer eUICCs)\n");
printf(" -1 ......................... force the IPAd to process only one eUICC package (debug, use with caution)\n");
+ printf(" -D ......................... set SGP.22 device capabilites other than the 3 that are required by this IPAd\n");
}
struct ipa_buf *load_ber_from_file(char *dir, char *file)
@@ -260,6 +261,9 @@
case '1':
getopt_one_euicc_pkg_only = true;
break;
+ case 'D':
+ cfg.device_capabilities = atoi(optarg);
+ break;
default:
printf("unhandled option: %c!\n", opt);
break;
@@ -280,6 +284,7 @@
printf(" iot_euicc_emu_enabled = %u\n", cfg.iot_euicc_emu_enabled);
printf(" esipa_req_retries = %u\n", cfg.esipa_req_retries);
printf(" refresh_flag = %u\n", cfg.refresh_flag);
+ printf(" device_capabilities = %u\n", cfg.device_capabilities);
printf("\n");
if (cfg.eim_cabundle) {
--
To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43060?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: onomondo-ipa
Gerrit-Branch: master
Gerrit-Change-Id: I866787b8cda9a87a9f2e0db4965fbb554d339a6c
Gerrit-Change-Number: 43060
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>