dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-eim/+/43936?usp=email )
Change subject: eim_cfg: rename parameter "Style"
......................................................................
eim_cfg: rename parameter "Style"
The function gen_eim_configuration_data has a parameter "Style".
This parameter sets which format the generated eIM configuration
should have. Let's call this parameter "Format", which describes
better what it is for. Let's also put a comment that explains
how the function works.
Related: SYS#8287
Change-Id: I34e2d1a7267d766b599da484c113f8e0bf68af21
---
M src/eim_cfg.erl
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/36/43936/1
diff --git a/src/eim_cfg.erl b/src/eim_cfg.erl
index d026eee..dc2adac 100644
--- a/src/eim_cfg.erl
+++ b/src/eim_cfg.erl
@@ -9,7 +9,10 @@
-include_lib("public_key/include/public_key.hrl").
-export([gen_eim_configuration_data/1]).
-gen_eim_configuration_data(Style) ->
+% Generate an encoded eIM configuration string, which can be used to program the eIM configuration into an eUICC,
+% either via ES10b:AddInitialEim or ESep:addEim (eUICC package, eCO). The Format parameter selects how the output data
+% shall be formatted. Two formats are possible: request: AddInitialEimRequest, single: EimConfigurationData
+gen_eim_configuration_data(Format) ->
{ok, EimId} = application:get_env(onomondo_eim, eim_id),
{ok, EimFqdn} = application:get_env(onomondo_eim, eim_fqdn),
{ok, EimCertPath} = utils:get_env_priv_file_path(onomondo_eim, eim_cert),
@@ -58,7 +61,7 @@
AddInitialEimRequest = #{eimConfigurationDataList => EimConfigurationDataList},
Encoded =
- case Style of
+ case Format of
request ->
% Formatted as AddInitialEimRequest
{ok, Asn1Encoded} = 'SGP32Definitions':encode(
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/43936?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I34e2d1a7267d766b599da484c113f8e0bf68af21
Gerrit-Change-Number: 43936
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-eim/+/43937?usp=email )
Change subject: eim_cfg: split eimPublicKey loading into separete function
......................................................................
eim_cfg: split eimPublicKey loading into separete function
When the eIM configuration is generated, the public eIM key is
loaded from the eIM certificate. Let's put this part into a
separate function and make this function public. (We will need
the function to be public in a follow up patch).
Related: SYS#8287
Change-Id: I6b62603e581ea204a55de6bcdb10adcd785642ca
---
M src/eim_cfg.erl
1 file changed, 21 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/37/43937/1
diff --git a/src/eim_cfg.erl b/src/eim_cfg.erl
index dc2adac..1104853 100644
--- a/src/eim_cfg.erl
+++ b/src/eim_cfg.erl
@@ -7,24 +7,20 @@
-module(eim_cfg).
-include_lib("public_key/include/public_key.hrl").
--export([gen_eim_configuration_data/1]).
+-export([get_eimPublicKey_from_eim_cert/0, gen_eim_configuration_data/1]).
-% Generate an encoded eIM configuration string, which can be used to program the eIM configuration into an eUICC,
-% either via ES10b:AddInitialEim or ESep:addEim (eUICC package, eCO). The Format parameter selects how the output data
-% shall be formatted. Two formats are possible: request: AddInitialEimRequest, single: EimConfigurationData
-gen_eim_configuration_data(Format) ->
- {ok, EimId} = application:get_env(onomondo_eim, eim_id),
- {ok, EimFqdn} = application:get_env(onomondo_eim, eim_fqdn),
+% Load the eimPublicKey from the configured eIM certificate (see sys.config).
+get_eimPublicKey_from_eim_cert() ->
+ % Load eIM certificate and extract public key.
{ok, EimCertPath} = utils:get_env_priv_file_path(onomondo_eim, eim_cert),
{ok, EimCertPem} = file:read_file(EimCertPath),
[{'Certificate', EimCertBer, not_encrypted}] = public_key:pem_decode(EimCertPem),
{ok, EimCert} = 'PKIX1Explicit88':decode('Certificate', EimCertBer),
- EimCert_TbsCertificate = maps:get(tbsCertificate, EimCert),
- EimCert_SubjectPublicKeyInfo = maps:get(subjectPublicKeyInfo, EimCert_TbsCertificate),
- {ok, CounterValue} = application:get_env(onomondo_eim, counter_value),
+ EimCertTbsCertificate = maps:get(tbsCertificate, EimCert),
+ EimCertSubjectPublicKeyInfo = maps:get(subjectPublicKeyInfo, EimCertTbsCertificate),
- % Check certificate type
- EimCert_algorithm = maps:get(algorithm, EimCert_SubjectPublicKeyInfo),
+ % Make sure that the algorithm is suitable and supported by this eIM.
+ EimCertAlgorithm = maps:get(algorithm, EimCertSubjectPublicKeyInfo),
BrainpoolP256r1 = #{
algorithm => {1, 2, 840, 10045, 2, 1},
parameters => <<6, 9, 43, 36, 3, 3, 2, 8, 1, 1, 7>>
@@ -33,12 +29,23 @@
algorithm => {1, 2, 840, 10045, 2, 1},
parameters => <<6, 8, 42, 134, 72, 206, 61, 3, 1, 7>>
},
- case EimCert_algorithm of
+ case EimCertAlgorithm of
BrainpoolP256r1 -> ok;
Prime256v1 -> ok;
_ -> throw("Incorrect eIM certificate, only BrainpoolP256r1 or Prime256v1 may be used!")
end,
+ EimCertSubjectPublicKeyInfo.
+
+% Generate an encoded eIM configuration string, which can be used to program the eIM configuration into an eUICC,
+% either via ES10b:AddInitialEim or ESep:addEim (eUICC package, eCO). The Format parameter selects how the output data
+% shall be formatted. Two formats are possible: request: AddInitialEimRequest, single: EimConfigurationData
+gen_eim_configuration_data(Format) ->
+ {ok, EimId} = application:get_env(onomondo_eim, eim_id),
+ {ok, EimFqdn} = application:get_env(onomondo_eim, eim_fqdn),
+ EimCertSubjectPublicKeyInfo = get_eimPublicKey_from_eim_cert(),
+ {ok, CounterValue} = application:get_env(onomondo_eim, counter_value),
+
% Generate eIM configuration
EimConfigurationData = #{
eimId => EimId,
@@ -49,7 +56,7 @@
% Optional: instruct the eUICC to calculate an association token
associationToken => -1,
% Mandatory
- eimPublicKeyData => {eimPublicKey, EimCert_SubjectPublicKeyInfo},
+ eimPublicKeyData => {eimPublicKey, EimCertSubjectPublicKeyInfo},
% This eIM implementation currently only supports ESipa via HTTPs where the only supported eIM Package
% transfer procedure is the eIM Package Retrieval procedure (see also SGP.32, section 3.1.1.1.
eimSupportedProtocol => [eimRetrieveHttps],
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/43937?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I6b62603e581ea204a55de6bcdb10adcd785642ca
Gerrit-Change-Number: 43937
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43935?usp=email )
Change subject: es10b_add_init_eim: improve log output
......................................................................
es10b_add_init_eim: improve log output
When the IoT eUICC emulation is active, the AddInitialEim has to
complete the eIM configuration before storing it. The completion
process assignes values to fields that are normally populated by
the eUICC.
Let's print a log line to make the user aware that this process
happens, so that there is no confusion about the completed eIM
configuration that is printed in the log lines after. Let's also
add another comment that explains what the completion is about.
Related: SYS#8287
Change-Id: Ife69835b378ae67c021bd1ad7dddd9f7259ebc47
---
M src/ipa/libipa/es10b_add_init_eim.c
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/35/43935/1
diff --git a/src/ipa/libipa/es10b_add_init_eim.c b/src/ipa/libipa/es10b_add_init_eim.c
index 2efa02d..a63cc22 100644
--- a/src/ipa/libipa/es10b_add_init_eim.c
+++ b/src/ipa/libipa/es10b_add_init_eim.c
@@ -130,10 +130,17 @@
struct AddInitialEimRequest *complete_eim_cfg_list(struct ipa_context *ctx, const struct AddInitialEimRequest *req)
{
+ /* The eIM configuration that is supplied with an AddInitialEimRequest is typically only a template and may
+ * lack certain values, which are normally computed by the eUICC (e.g. the associationToken). This function
+ * goes through all eIM configurations in the supplied AddInitialEimRequest and completes them. (This function
+ * must only be called from the IoT eUICC emulation code paths. It has no relevance for native IoT eUICCs) */
+
struct AddInitialEimRequest *req_dup;
unsigned int i;
int rc;
+ IPA_LOGP_ES10X("AddInitialEim", LINFO, "IoT eUICC emulation active, completing eIM configuration...\n");
+
req_dup = ipa_asn1c_dup(&asn_DEF_AddInitialEimRequest, req);
for (i = 0; i < req_dup->eimConfigurationDataList.list.count; i++) {
--
To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43935?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: Ife69835b378ae67c021bd1ad7dddd9f7259ebc47
Gerrit-Change-Number: 43935
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43934?usp=email )
Change subject: es10b_add_init_eim: display original eIM config before loading
......................................................................
es10b_add_init_eim: display original eIM config before loading
The log displays the messages exchanged between the host and the
eUICC. However, when the IoT eUICC emulation is active, the
AddInitialEim will display the eIM configuration as it is stored.
This is a modified version of the eIM configuration.
In some cases it is very important to monitor the exact eIM
configuration as it is loaded from the input file. So let's log
the unmodifed eIM configuration before carrying out any action.
Related: SYS#8287
Change-Id: I8d9600c8701ea98258dd035ab0fd32a9ab96efa2
---
M src/ipa/libipa/es10b_add_init_eim.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/34/43934/1
diff --git a/src/ipa/libipa/es10b_add_init_eim.c b/src/ipa/libipa/es10b_add_init_eim.c
index ba9e3c1..2efa02d 100644
--- a/src/ipa/libipa/es10b_add_init_eim.c
+++ b/src/ipa/libipa/es10b_add_init_eim.c
@@ -238,6 +238,10 @@
struct ipa_es10b_add_init_eim_res *ipa_es10b_add_init_eim(struct ipa_context *ctx,
const struct ipa_es10b_add_init_eim_req *req)
{
+ IPA_LOGP_ES10X("AddInitialEim", LDEBUG,
+ "The following eIM configuration is programmed into the eUICC:\n");
+ ipa_asn1c_dump(&asn_DEF_AddInitialEimRequest, &req->req, 1, SES10X, LDEBUG);
+
if (ctx->cfg->iot_euicc_emu_enabled)
return add_init_eim_iot_emu(ctx, req);
else
--
To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43934?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: I8d9600c8701ea98258dd035ab0fd32a9ab96efa2
Gerrit-Change-Number: 43934
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: jolly, osmith, pespin.
Hello Jenkins Builder, osmith, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1d/+/43686?usp=email
to look at the new patch set (#3).
Change subject: Use VTY node definition from libosmocore
......................................................................
Use VTY node definition from libosmocore
Depends-on: I497ee1503fed1681fae217bfe4d7be9b1580448f (libosmocore)
Change-Id: I1e176362eba4966ad6c249831d6a82d0ed4ea6d5
---
M TODO-RELEASE
M src/octoi/octoi.c
M src/octoi/octoi.h
M src/octoi/octoi_clnt_vty.c
M src/octoi/octoi_srv_vty.c
5 files changed, 43 insertions(+), 51 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/86/43686/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/43686?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I1e176362eba4966ad6c249831d6a82d0ed4ea6d5
Gerrit-Change-Number: 43686
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: jolly, osmith, pespin.
Hello Jenkins Builder, osmith, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1d/+/43686?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by osmith, Code-Review+1 by pespin, Verified+1 by Jenkins Builder
Change subject: Use VTY node defintion from libosmocore
......................................................................
Use VTY node defintion from libosmocore
Depends-on: I497ee1503fed1681fae217bfe4d7be9b1580448f (libosmocore)
Change-Id: I1e176362eba4966ad6c249831d6a82d0ed4ea6d5
---
M TODO-RELEASE
M src/octoi/octoi.c
M src/octoi/octoi.h
M src/octoi/octoi_clnt_vty.c
M src/octoi/octoi_srv_vty.c
5 files changed, 43 insertions(+), 51 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/86/43686/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/43686?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I1e176362eba4966ad6c249831d6a82d0ed4ea6d5
Gerrit-Change-Number: 43686
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>