dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/onomondo-eim/+/42948?usp=email )

Change subject: esipa: supply eimTransactionId in profileDownloadTriggerRequest
......................................................................

esipa: supply eimTransactionId in profileDownloadTriggerRequest

When we supply an eimTransactionId in profileDownloadTriggerRequest,
the IPAd will echo the same eimTransactionId in the
initiateAuthenticationRequestEsipa message. This allows the eIM
to distinguish to which transaction (work) the received
initiateAuthenticationRequestEsipa belongs. This was not possible
before. The eIM had to rely soly on the PID of the sub process
which is handling the HTTP connection.

Change-Id: I822d6b2bb51498713739671804b173260e9a28a3
Related: SYS#8100
---
M src/esipa_asn1_handler.erl
1 file changed, 10 insertions(+), 5 deletions(-)

Approvals:
  jolly: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/esipa_asn1_handler.erl b/src/esipa_asn1_handler.erl
index 94389c7..1815499 100644
--- a/src/esipa_asn1_handler.erl
+++ b/src/esipa_asn1_handler.erl
@@ -19,7 +19,8 @@

 %GSMA SGP.32, section 6.3.2.1
 handle_asn1(Pid, {initiateAuthenticationRequestEsipa, EsipaReq}) ->
-    {_, _, WorkState} = mnesia_db_work:pickup(Pid, none),
+    EimTransactionId = maps:get(eimTransactionId, EsipaReq, none),
+    {_, _, WorkState} = mnesia_db_work:pickup(Pid, EimTransactionId),
     BaseUrl = maps:get(smdpAddress, EsipaReq),
     NewWorkState = WorkState#{smdpAddress => BaseUrl},
     mnesia_db_work:update(Pid, NewWorkState),
@@ -284,12 +285,16 @@
     EsipaResp =
         case Work of
             {download, Order} ->
-                % The first time we see a TransactionId is in the SMDP+ 
response to the
-                % initiateAuthenticationRequest
-                {[{<<"download">>, {[{<<"activationCode">>, 
ActivationCode}]}}]} = Order,
+                % The first time we see a transactionId from the SM-DP+ is in 
the SM-DP+ response to the
+                % initiateAuthenticationRequest. Until this point we will use 
an eimTransactionId as a
+                % temporary identifier.
+                EimTransactionId = rand:bytes(16),
+                mnesia_db_work:bind(Pid, EimTransactionId),
                 mnesia_db_work:update(Pid, #{}),
+                {[{<<"download">>, {[{<<"activationCode">>, 
ActivationCode}]}}]} = Order,
                 {profileDownloadTriggerRequest, #{
-                    profileDownloadData => {activationCode, ActivationCode}
+                    profileDownloadData => {activationCode, ActivationCode},
+                    eimTransactionId => EimTransactionId
                 }};
             {psmo, Order} ->
                 EimTransactionId = rand:bytes(16),

--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42948?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I822d6b2bb51498713739671804b173260e9a28a3
Gerrit-Change-Number: 42948
Gerrit-PatchSet: 11
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: jolly <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>

Reply via email to