dexter has uploaded this change for review.
esipa_asn1_handler: re-align to SGP.32 section 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, 9 insertions(+), 24 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/77/42877/1
diff --git a/src/esipa_asn1_handler.erl b/src/esipa_asn1_handler.erl
index ae9bfa9..63afdb2 100644
--- a/src/esipa_asn1_handler.erl
+++ b/src/esipa_asn1_handler.erl
@@ -363,7 +363,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
@@ -375,25 +376,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),
@@ -401,17 +385,18 @@
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 change 42877. To unsubscribe, or for help writing mail filters, visit settings.