Skip to content

Commit

Permalink
updates Overview doc and commands_and_responses.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
slegouix committed Dec 21, 2022
1 parent cd494f1 commit 95ef718
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion doc/GPSERAM__Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ On reception of the *Handshake Response* [Message](GPSERAM__TerminologyAndDefini

On *Notification* [Command](GPSERAM__TerminologyAndDefinitions.md#Command) the [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) shall sent a notification to the [Device Application](GPSERAM__TerminologyAndDefinitions.md#Device Application). How the [Device](GPSERAM__TerminologyAndDefinitions.md#Device) notify the [Device Application](GPSERAM__TerminologyAndDefinitions.md#Device Application) and its reliability is implementation dependent. *Notification* [Command](GPSERAM__TerminologyAndDefinitions.md#Command) do not require [Response](GPSERAM__TerminologyAndDefinitions.md#Response), nor a state change.

On *SE RAM* [Command](GPSERAM__TerminologyAndDefinitions.md#Command) the [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) shall send each *C-APDU* to the selected [Secure Element](GPSERAM__TerminologyAndDefinitions.md#SecureElement) according with the [SE Access API](GPSERAM__TerminologyAndDefinitions.md#SEAccessAPI) and add the *R-APDU* to the *SE RAM* [Response](GPSERAM__TerminologyAndDefinitions.md#Response). If the *C-APDU* is a *SELECT Command* as defined by [GP Card Specification](https://globalplatform.org/specs-library/card-specification-v2-3-1/), the [SE Access API](GPSERAM__TerminologyAndDefinitions.md#SEAccessAPI), may required the [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) to use a dedicated function to open a *logicial channel* with the [Secure Element](GPSERAM__TerminologyAndDefinitions.md#SecureElement). This *logicial channel* shall be used for the subsequent *C-APDU* and closed if another *SELECT Command* is received or at the end of the *Management Session*. On any error to transmit the *C-APDU*, the [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) shall discard all the remaining *C-APDU* and shall not include any *R-APDU* in the response for the faulty transmission. The [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) do not need to parse and handle *R-APDU*. All *R-APDU* shall be transmit to the [Remote Agent](GPSERAM__TerminologyAndDefinitions.md#RemoteAgent), including those with a 69xx or 68xx status word.
On *SE RAM* [Command](GPSERAM__TerminologyAndDefinitions.md#Command) the [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) shall send each *C-APDU* to the selected [Secure Element](GPSERAM__TerminologyAndDefinitions.md#SecureElement) according with the [SE Access API](GPSERAM__TerminologyAndDefinitions.md#SEAccessAPI) and add the *R-APDU* to the *SE RAM* [Response](GPSERAM__TerminologyAndDefinitions.md#Response). If the *C-APDU* is a *SELECT Command* as defined by [GP Card Specification](https://globalplatform.org/specs-library/card-specification-v2-3-1/), the [SE Access API](GPSERAM__TerminologyAndDefinitions.md#SEAccessAPI), may required the [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) to use a dedicated function to open a *logicial channel* with the [Secure Element](GPSERAM__TerminologyAndDefinitions.md#SecureElement). This *logicial channel* shall be used for the subsequent *C-APDU* and closed if another *SELECT Command* is received or at the end of the *Management Session*. On any error to transmit the *C-APDU*, the [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) shall discard all the remaining *C-APDU* and shall not include any *R-APDU* in the response for the faulty transmission. The [Local Agent](GPSERAM__TerminologyAndDefinitions.md#LocalAgent) do not need to parse and handle *R-APDU*. Any warning or error *R-ADPDU* (i.e. those with a 69xx or 68xx status word) are valid *R-APDU* that shall be added to the *SE RAM* [Response](GPSERAM__TerminologyAndDefinitions.md#Response).

45 changes: 18 additions & 27 deletions spec/parts/commands_and_responses.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ramCommand:
description: >-
Command Messages are sent by the Remote Agent and shall be executed by
Commands are sent by the Remote Agent and shall be executed by
the Local Agent.
required:
- ramCommandType
Expand All @@ -14,7 +14,7 @@
properties:
ramCommandType:
description: >-
The type of Command Message with authorized values listed in the
The type of Command with authorized values listed in the
discrimitator mapping
type: string

Expand All @@ -28,20 +28,12 @@
seRamCommand:
allOf:
- description: >-
The SE RAM Command Message is used to send APDU to the Secure
Element.<br>
The SE RAM Command is used to send APDU to the Secure Element.<br>
The Local Agent SHALL send each APDU command of the listOfCAPDU to
the Secure Element using the SE Access API. The Local Agent SHALL
add each APDU response to the SE RAM Response Message. If an APDU
add each APDU response to the associated SE RAM Response. If an APDU
Response is not available, the Local Agent SHALL use an empty
string as APDU Response. On any error to transmit an APDU command
to the Secure Element, the Local Agent SHALL discard all the
remaining APDU commands and SHALL not include any APDU response for
the faulty transmission. Any warning or error APDU response (i.e.
69xx or 68xx) are valid APDU response that SHALL be inserted in the
SE RAM Response. If the stopOnError flag of the SE RAM Command is
set to 'true', the Local Agent SHALL not execute any remaining APDU
command after an error APDU response (i.e. 69xx).
string as APDU Response.
- $ref: 'attributes.yaml#/ramCommand'
- required:
- 'listOfCAPDU'
Expand All @@ -59,10 +51,9 @@
notificationCommand:
allOf:
- description: >-
The Notification Command Message is used to send processing
notification to the Device Application. The meaning of the
notification and how it is handled by the Device Application is
implementation dependent.
The Notification Command is used to send processing a notification
to the Device Application. The meaning of the notification and how
it is handled by the Device Application is implementation dependent.
- $ref: 'attributes.yaml#/ramCommand'
- required:
- 'deviceAppNotification'
Expand All @@ -76,16 +67,16 @@
ramStopCommand:
allOf:
- description: >-
A Remote Agent uses this Command to mark the end of its processing
and that no further Message will be sent.<br>
The Local Agent shall notify the end of the Management Session to
the Device Application.<br>
This Message marks the end of the processing by a Management
Platform and no further Message will be sent.
A Remote Agent uses this Command to close the Remote Session.<br>
The Local Agent SHALL NOT send any new Report Message and SHALL
discard any remaining Response, if any.
This Command marks the end of the processing by a Management
Platform and no further Order Message will be sent.
- $ref: 'attributes.yaml#/ramCommand'

ramResponse:
description: Response Messages are sent by the Local Agent to the Agent.
description: >-
Some Command required to send back a response to the Remote Agent.
required:
- 'ramResponseType'
discriminator:
Expand All @@ -95,15 +86,15 @@
properties:
ramResponseType:
description: >-
The type of Response Message with authorized values listed in the
The type of Response with authorized values listed in the
discrimitator mapping
type: string

seRamResponse:
allOf:
- description: >-
The SE RAM Response Message contains the APDU responses of the
Secure Element to a previous SE RAM Command Message.<br>
The SE RAM Response contains the APDU responses of the Secure
Element to the corresponding SE RAM Command.<br>
For each APDU send to the Secure Element, the Local Agent shall add
the associated APDU response to the listOfRAPDU property. If an APDU
response is not available (e.g. for a SELECT or on error), it shall
Expand Down

0 comments on commit 95ef718

Please sign in to comment.