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

Change subject: esipa_asn1_handler: re-align to SGP.32 section 2.11.2 and 
section 5.14.6
......................................................................

esipa_asn1_handler: re-align to SGP.32 section 2.11.2 and section 5.14.6

Section 2.11.2: eIM package result (EuiccPackageResult case) is now 
concatenated with PendingNotificationList instead of 
RetrieveNotificationsListResponse
Section 5.14.6: ESipa.ProvideEimPackageResult: Significant change in parameters

Change-Id: Ic0872edefc1844166943c60528557c6b7a6602ce
Related: SYS#8100
---
M src/esipa_asn1_handler.erl
1 file changed, 11 insertions(+), 24 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




diff --git a/src/esipa_asn1_handler.erl b/src/esipa_asn1_handler.erl
index ff35a12..111ef17 100644
--- a/src/esipa_asn1_handler.erl
+++ b/src/esipa_asn1_handler.erl
@@ -365,7 +365,8 @@
     {getEimPackageResponse, EsipaResp};
 %GSMA SGP.32, section 6.3.2.7
 handle_asn1(Pid, {provideEimPackageResult, EsipaReq}) ->
-    case EsipaReq of
+    EimPackageResult = maps:get(eimPackageResult, EsipaReq),
+    case EimPackageResult of
         {euiccPackageResult, EuiccPackageResult} ->
             ok = esipa_asn1_handler_utils:handle_euiccPackageResult(
                 Pid, EuiccPackageResult, EsipaReq
@@ -377,25 +378,8 @@
                 Pid, EuiccPackageResult, EsipaReq
             ),
             % then forward the notifications in the included notification list
-            RetrieveNotificationsListResponse = maps:get(notificationList, 
EPRAndNotifications),
-            case RetrieveNotificationsListResponse of
-                {notificationList, NotificationList} ->
-                    handle_asn1_notificationList(Pid, NotificationList);
-                {notificationsListResultError, NotificationsListResultError} ->
-                    logger:notice(
-                        "Ipad is reporting a problem to retrieve 
notifications,~nNotificationsListResultError=~p,~nPid=~p~n",
-                        [NotificationsListResultError, Pid]
-                    );
-                UnhandledObject ->
-                    % TODO: The RetrieveNotificationsListResponse may also 
contain other objects, in particular
-                    % euiccPackageResultList and notificationAndEprList, which 
again includes either a
-                    % notificationList or an euiccPackageResultList The spec 
is a bit unclear on how exactly and when
-                    % those data objects shall be used, so we ignore them for 
now and display a notice in the log
-                    logger:notice(
-                        "RetrieveNotificationsListResponse with unhandled 
object,~UnhandledObject=~p,~nPid=~p~n",
-                        [UnhandledObject, Pid]
-                    )
-            end;
+            NotificationList = maps:get(notificationList, EPRAndNotifications),
+            handle_asn1_notificationList(Pid, NotificationList);
         {ipaEuiccDataResponse, IpaEuiccDataResponse} ->
             % drive-by store the eUICC public key so that we can use it later 
to sign PSMOs or eCOs
             {EidValue, _, _} = mnesia_db:work_pickup(Pid, none),
@@ -403,17 +387,20 @@
                 IpaEuiccDataResponse, EidValue
             ),
             Outcome = 
esipa_rest_utils:ipaEuiccDataResponse_to_outcome(IpaEuiccDataResponse),
-            mnesia_db:work_finish(Pid, Outcome, EsipaReq);
+            ok = mnesia_db:work_finish(Pid, Outcome, EsipaReq);
         {profileDownloadTriggerResult, _} ->
             % The profileDownloadTriggerResult is sent by the IPAd in case a 
profile was downloaded directly from an
             % RSP server, bypassing the eIM (see also SGP.32, section 
3.2.3.1). This is a feature that this eIM does
             % not support.
             throw("unsuppported message type 
\"profileDownloadTriggerResult\"");
-        {eimPackageError, EimPackageError} ->
-            Outcome = [{[{eimPackageError, EimPackageError}]}],
+        {eimPackageResultResponseError, EimPackageResultResponseError} ->
+            EimPackageResultErrorCode = maps:get(
+                eimPackageResultErrorCode, EimPackageResultResponseError
+            ),
+            Outcome = [{[{eimPackageError, EimPackageResultErrorCode}]}],
             ok = mnesia_db:work_finish(Pid, Outcome, EsipaReq)
     end,
-    {provideEimPackageResultResponse, undefined};
+    {provideEimPackageResultResponse, {emptyResponse, #{}}};
 %Unsupported request
 handle_asn1(Pid, Request) ->
     mnesia_db:work_finish(Pid, [{[{procedureError, abortedOrder}]}], 
unsupported),

--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42877?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: Ic0872edefc1844166943c60528557c6b7a6602ce
Gerrit-Change-Number: 42877
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>

Reply via email to