Attention is currently required from: dexter.
jolly has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/onomondo-eim/+/42992?usp=email )
Change subject: contrib/tryme_euiccDataRequest: fixup example tag string
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42992?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I5be04c954330638d3e7d78e8f5f280bebb707efa
Gerrit-Change-Number: 42992
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 15 Jul 2026 11:22:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-eim/+/43013?usp=email )
Change subject: esipa_asn1_handler: store IPAd stateChangeCause
......................................................................
esipa_asn1_handler: store IPAd stateChangeCause
The IPAd may pass a notifyStateChange and a stateChangeCause code.
The notifyStateChange flag tells that a state change happened and
the stateChangeCause code tells what the cause was.
let's store the stateChangeCause code as a state in the euicc
table, so that the REST API user can poll for stateChangeCause
codes in suitable intervals.
Change-Id: I3fe64687786d9184ae82cbb12f9d1292fdc945c8
Related: SYS#8100
---
M contrib/tryme_euicc_get_state.sh
M contrib/tryme_euicc_set_state.sh
M include/mnesia_db_euicc.hrl
M src/esipa_asn1_handler.erl
M src/mnesia_db_euicc.erl
5 files changed, 38 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/13/43013/1
diff --git a/contrib/tryme_euicc_get_state.sh b/contrib/tryme_euicc_get_state.sh
index 524d37d..dc96cf0 100755
--- a/contrib/tryme_euicc_get_state.sh
+++ b/contrib/tryme_euicc_get_state.sh
@@ -2,7 +2,7 @@
. ./tryme.cfg
# States we want to retrieve with this request.
-STATES='"counterValue", "consumerEuicc", "signAlgo", "signPubKey"'
+STATES='"counterValue", "consumerEuicc", "signAlgo", "signPubKey", "stateChangeCauseList"'
JSON='{ "eidValue" : "'$EID'", "order" : { "euicc" : { "get" : [ '$STATES' ] } } }'
RC=`./restop.py -c -f euicc -j "$JSON"`
diff --git a/contrib/tryme_euicc_set_state.sh b/contrib/tryme_euicc_set_state.sh
index d016ce1..04d8c51 100755
--- a/contrib/tryme_euicc_set_state.sh
+++ b/contrib/tryme_euicc_set_state.sh
@@ -6,7 +6,8 @@
STATES='[{ "counterValue" : 1000 },
{ "consumerEuicc" : false },
{ "signAlgo" : "prime256v1" },
- { "signPubKey" : "04BD2C55B28B4E801CA0B14F195788FD86C7FF49764C88A2934C69594A26FF647549F3F16060BD9C8D793D95D0126FA429C94966FE7842967263795A73C498F1DB" }]'
+ { "signPubKey" : "04BD2C55B28B4E801CA0B14F195788FD86C7FF49764C88A2934C69594A26FF647549F3F16060BD9C8D793D95D0126FA429C94966FE7842967263795A73C498F1DB" },
+ { "stateChangeCauseList" : [] }]'
JSON='{ "eidValue" : "'$EID'", "order" : { "euicc" : { "set" : '$STATES' } } }'
RC=`./restop.py -c -f euicc -j "$JSON"`
diff --git a/include/mnesia_db_euicc.hrl b/include/mnesia_db_euicc.hrl
index 78f45f1..6fccaf3 100644
--- a/include/mnesia_db_euicc.hrl
+++ b/include/mnesia_db_euicc.hrl
@@ -12,5 +12,7 @@
% Pubkey to authenticate eUICC Package Results (see also SGP.32, section 2.11.2.1)
signPubKey :: binary(),
% Algorithem to authenticate eUICC Package Results (prime256v1 or brainpoolP256r1)
- signAlgo :: binary()
+ signAlgo :: binary(),
+ % A list with the reported IPAd state change cause codes (has to be polled and reset by REST API user)
+ stateChangeCauseList :: list()
}).
diff --git a/src/esipa_asn1_handler.erl b/src/esipa_asn1_handler.erl
index e3a6abf..3d0d6b0 100644
--- a/src/esipa_asn1_handler.erl
+++ b/src/esipa_asn1_handler.erl
@@ -266,13 +266,33 @@
emptyResponse;
%GSMA SGP.32, section 6.3.2.6
handle_asn1(Pid, {getEimPackageRequest, EsipaReq}) ->
- % TODO: The purpose of the notifyStateChange field in the getEimPackageRequest is to inform the eIM that some state
- % in the eUICC has changed and that the eIM (and in particular the REST API user) should perform an update of its
- % local records (eUICC data request, listProfileInfo PSMO etc...) This is a feature that this eIM does not support
- % yet. To implement the feature we could use a flag in the euicc table to tell the REST API user to perform the
- % update. Get the notifyStateChange flag like so: NotifStateChg = maps:is_key(notifyStateChange, EsipaReq).
-
EidValue = maps:get(eidValue, EsipaReq),
+
+ % Store stateChangeCause, but only in case the EID is already known to this eIM as we do not want to record any
+ % information from foreigen eUICCs.
+ case maps:get(notifyStateChange, EsipaReq, none) of
+ 'NULL' ->
+ case mnesia_db_euicc:state_get(utils:binary_to_hex(EidValue), stateChangeCauseList) of
+ {ok, StateChangeCauseList} ->
+ StateChangeCause = maps:get(stateChangeCause, EsipaReq, undefined),
+ case lists:member(StateChangeCause, StateChangeCauseList) of
+ false ->
+ mnesia_db_euicc:state_set(
+ utils:binary_to_hex(EidValue),
+ stateChangeCauseList,
+ StateChangeCauseList ++ [StateChangeCause]
+ );
+ _ ->
+ ok
+ end;
+ _ ->
+ ok
+ end;
+ _ ->
+ ok
+ end,
+
+ % Continue with the processing of the getEimPackageRequest
Work = mnesia_db_work:fetch(utils:binary_to_hex(EidValue), Pid),
EsipaResp =
case Work of
diff --git a/src/mnesia_db_euicc.erl b/src/mnesia_db_euicc.erl
index 5a5634f..2c18990 100644
--- a/src/mnesia_db_euicc.erl
+++ b/src/mnesia_db_euicc.erl
@@ -31,7 +31,8 @@
consumerEuicc = ConsumerEuicc,
associationToken = 1,
signPubKey = <<>>,
- signAlgo = <<"prime256v1">>
+ signAlgo = <<"prime256v1">>,
+ stateChangeCauseList = []
},
Q = qlc:q([X#euicc.eidValue || X <- mnesia:table(euicc), X#euicc.eidValue == EidValue]),
Present = qlc:e(Q),
@@ -111,6 +112,8 @@
mnesia:write(Row#euicc{signPubKey = Value});
signAlgo ->
mnesia:write(Row#euicc{signAlgo = Value});
+ stateChangeCauseList ->
+ mnesia:write(Row#euicc{stateChangeCauseList = Value});
_ ->
throw(badState)
end;
@@ -136,6 +139,8 @@
Row#euicc.signPubKey;
signAlgo ->
Row#euicc.signAlgo;
+ stateChangeCauseList ->
+ Row#euicc.stateChangeCauseList;
_ ->
throw(badState)
end;
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/43013?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: I3fe64687786d9184ae82cbb12f9d1292fdc945c8
Gerrit-Change-Number: 43013
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/onomondo-eim/+/42991?usp=email
to look at the new patch set (#3).
Change subject: mnesia_db_rest: add comment on why we create an euicc entry early
......................................................................
mnesia_db_rest: add comment on why we create an euicc entry early
Even though it is technically not necessary, we ensure that an
entry is present in the euicc table on each REST API call. Let's
add a comment to explain why we do it anyway.
Change-Id: Ifb9340655c5f36e074a1a92c0e234ef62c79b9d8
Related: SYS#8100
---
M src/mnesia_db_rest.erl
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/91/42991/3
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42991?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: Ifb9340655c5f36e074a1a92c0e234ef62c79b9d8
Gerrit-Change-Number: 42991
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Attention is currently required from: laforge.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/onomondo-eim/+/42960?usp=email
to look at the new patch set (#4).
Change subject: mnesia_db_euicc: rename timer_setparam to timer_rest
......................................................................
mnesia_db_euicc: rename timer_setparam to timer_rest
The function timer_setparam is processing REST API orders
in regular intervals. Naming the timer "timer_rest" makes
more sense.
Change-Id: Icfa203477e044ce2cc312d4b6e2693a97191c61d
Related: SYS#8100
---
M src/mnesia_db.erl
M src/mnesia_db_euicc.erl
2 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/60/42960/4
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42960?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: Icfa203477e044ce2cc312d4b6e2693a97191c61d
Gerrit-Change-Number: 42960
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: jolly.
Hello Jenkins Builder, jolly,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/onomondo-eim/+/42992?usp=email
to look at the new patch set (#3).
Change subject: contrib/tryme_euiccDataRequest: fixup example tag string
......................................................................
contrib/tryme_euiccDataRequest: fixup example tag string
The eUICC data request takes a string with TLV tags as input. The
example in this example still uses tags from SGP.32 V.1.0.1, let's
update the string so that it is compliant with SGP.32 V.1.2.
(see also SGP.32, section 2.11.1.2)
Change-Id: I5be04c954330638d3e7d78e8f5f280bebb707efa
Related: SYS:8100
---
M contrib/tryme_euiccDataRequest.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/92/42992/3
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42992?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I5be04c954330638d3e7d78e8f5f280bebb707efa
Gerrit-Change-Number: 42992
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>