From 585b3b239b657d292535ffc102c7bda734f5fa2b Mon Sep 17 00:00:00 2001 From: Kristina <52878547+Sakurann@users.noreply.github.com> Date: Tue, 4 Oct 2022 18:26:30 -0700 Subject: [PATCH 1/2] defining Session Key Computation parameters --- main.md | 2 +- ...rifiable-presentations-offline-1_0-01.html | 536 +++++++++++------- ...erifiable-presentations-offline-1_0-01.xml | 120 +++- 3 files changed, 438 insertions(+), 220 deletions(-) diff --git a/main.md b/main.md index 659594c..b230a7c 100644 --- a/main.md +++ b/main.md @@ -251,7 +251,7 @@ TODO: Can we plan to register our service with Bluetooth SIG? This will allow us ToDo: If 'Submit VC' latency is high due to the presence of a photograph we will fall back to the style that Kritina wrote with State. -ToDo: Check if there are conventions to the UUID. Original in ISO is `00000001-A123-48CE-896B-4C76973373E6`. +ToDo: Check if there are conventions to the UUID. Current UUID has been randomly generated. ## Identity Request diff --git a/openid-for-verifiable-presentations-offline-1_0-01.html b/openid-for-verifiable-presentations-offline-1_0-01.html index 1622ca0..22ca085 100644 --- a/openid-for-verifiable-presentations-offline-1_0-01.html +++ b/openid-for-verifiable-presentations-offline-1_0-01.html @@ -1075,7 +1075,7 @@ opendi4vp-offline -August 2022 +October 2022 Yasuda, et al. @@ -1092,7 +1092,7 @@
openid-for-verifiable-presentations-offline-1_0-01
Published:
- +
Intended Status:
Standards Track
@@ -1159,81 +1159,90 @@

Abstract

5.  Overview

  • -

    6.  Protocol Flow Overview

    +

    6.  Limitation

  • -

    7.  Connection Set up

    - +

    7.  Protocol Flow Overview

  • -

    8.  Data Exchange Flow

    +

    8.  Connection Set up

  • -

    9.  Encryption

    +

    9.  Data Exchange Flow

  • -

    10Security Considerations

    +

    10Encryption

  • -
  • -

    10.3.  Verifier Authentication

    +
  • +

    11Security Considerations

    + +
  • +

    11.4.  Session Binding

  • -
  • -

    11Discussion points

    +
  • +

    11.5.  Other

    +
  • +
  • -

    Authors' Addresses

    +

    12Discussion points

    +
  • +
  • +

    Authors' Addresses

  • @@ -1323,14 +1332,60 @@

    Step 2 utilizes request and response syntax defined in [OpenID4VP] specification. Response type vp_token MUST be used to obtain the VP Token in Authorization Response.

    -
    +
    +

    +6. Limitation +

    +

    We need to be considerate of the following limitations in BLE stack 4.2

    +
      +
    1. +

      Advertisement

      +
        +
      • +

        The advertisement message can contain only a max of 29 bytes.

        +
      • +
      • +

        The advertisement scan request can not have any custom data.

        +
      • +
      • +

        The scan response can have custom data.

        +
      • +
      +
    2. +
    3. +

      Timing

      +
        +
      • +

        BLE Scanning and advertising are discrete events, so not every advertisement is received (max ~30 sec)

        +
      • +
      +
    4. +
    5. +

      Throughput

      +
        +
      • +

        Default MTU size is 23 bytes and max is 512 bytes

        +
      • +
      • +

        14 bytes are overhead cost per packet (MTU).

        +
      • +
      • +

        0.226 ~ 0.301 Mbps (Mega bits per second). So data rate of ~0.10 Mbps

        +
      • +
      +
    6. +
    +
    +
    +
    +

    -6. Protocol Flow Overview +7. Protocol Flow Overview

    -

    Below is the diagram that illustrates protocol flow:

    +

    Below is the diagram that illustrates protocol flow:

    -
    +
    +-------------+                                         +----------------+
     |             |                                         |                |
     |             |<---- (1) Connection setup request ------|                |
    @@ -1355,33 +1410,45 @@ 

    Figure 1: OpenID4VP over BLE Protocol Flow

    -

    (1) Verifier and the Wallet establish the connection. This specification defines two mechanisms to do so: QR code displayed by the Verifier and BLE Advertisement initiated by the Verifier. -(2) Wallet obtains Presentation Request from the Verifier. -(3) Wallet authenticates the user and obtains consent to share Credential(s) with the Verifier. -(4) Wallet sends Presentation Response to the Verifier with Verifiable Presntation(s). -(5) Verifier and the Wallet close connection.

    +
      +
    1. +

      Verifier and the Wallet establish the connection. This specification defines two mechanisms to do so: QR code displayed by the Verifier and BLE Advertisement initiated by the Verifier.

      +
    2. +
    3. +

      Wallet obtains Presentation Request from the Verifier.

      +
    4. +
    5. +

      Wallet authenticates the user and obtains consent to share Credential(s) with the Verifier.

      +
    6. +
    7. +

      Wallet sends Presentation Response to the Verifier with Verifiable Presntation(s).

      +
    8. +
    9. +

      Verifier and the Wallet close connection.

      +
    10. +
    -
    +

    -7. Connection Set up +8. Connection Set up

    -

    First, Verifier and the Wallet need to establish the connection. This specification defines two mechanisms to do so: QR code displayed by the Verifier and BLE Advertisement initiated by the Verifier.

    +

    First, Verifier and the Wallet need to establish the connection. This specification defines two mechanisms to do so: QR code displayed by the Verifier and BLE Advertisement initiated by the Verifier.

    -
    +

    -7.1. Estabilishing Connection using BLE Advertisement +8.1. Estabilishing Connection using BLE Advertisement

    -

    This section describes how Verifier and the Wallet can establish connection by Verifier initiating BLE Advertisement. This mechanism can be used by the Verifiers when the use-case does not allow the End-Users to scan a QR code displayed on the Verifier's device, for example to ensure the safety of the Verifier.

    -

    (1) Verifier opens it's native application +

    This section describes how Verifier and the Wallet can establish connection by Verifier initiating BLE Advertisement. This mechanism can be used by the Verifiers when the use-case does not allow the End-Users to scan a QR code displayed on the Verifier's device, for example to ensure the safety of the Verifier.

    +

    (1) Verifier opens it's native application (2) Verifiers starts the mode that accepts OpenID4VP. (3) Verifier app starts BLE advertisement. (4) Wallet scans the BLE layer and filters the OpenID4VP automatically (in case it found only one) (5) Wallet connects to the Verifier. -(6) Wallet negotiates Security and sends details.

    -

    BLE Advertisement Packet structure MUST be the following:

    -
    +(6) Wallet negotiates Security and sends details.

    +

    BLE Advertisement Packet structure MUST be the following:

    +
    PDU:
         Header:
             PDU type: ADV_IND
    @@ -1393,70 +1460,76 @@ 

    Adv Type: Complete Local Name flag: "LE General Discoverable Mode", "BR/EDR Not Supported" Data: OPENID4VP_8520f0098930a754748b7ddcb43ef75a (5 bytes + 16 bytes ) Half of the random X25519 public key -

    +
    -

    Verifier advertises half of the public key in the original BLE Advertisement Packet. The remainng half of the key (0dbf3a0d26381af4eba4a98eaa9b4e6a) is being sent during the scan response.

    -

    BLE Advertisement - OPENID4VP, first 16 byte of ED25519 public key (max available size 29 byte), Response to the scan we will send the remaining 16 byte of ED25519,

    -

    +------------+ +-----------+ +

    Verifier advertises half of the public key in the original BLE Advertisement Packet. The remainng half of the key (0dbf3a0d26381af4eba4a98eaa9b4e6a) is being sent during the scan response.

    +

    BLE Advertisement - OPENID4VP, first 16 byte of ED25519 public key (max available size 29 byte), Response to the scan we will send the remaining 16 byte of ED25519,

    +

    +------------+ +-----------+ | |-----PDU ADVIND------>| | | Advertiser |<----SCANREQ----------| Scanner | | (Verifier) |-----SCAN_RESP-------->| (Wallet) | | | | | -+------------+ +-----------+

    -

    ToDo: Need to explain this diagram better.

    ++------------+ +-----------+

    +

    ToDo: Need to explain this diagram better.

    -
    +

    -7.2. Estabilishing Connection using QR Code +8.2. Estabilishing Connection using QR Code

    -

    This section describes how Verifier and the Wallet can establish connection by Verifier displaying a QR Code scanned using the Wallet.

    -

    (1) Verifier opens it's native application +

    This section describes how Verifier and the Wallet can establish connection by Verifier displaying a QR Code scanned using the Wallet.

    +

    (1) Verifier opens it's native application (2) Verifiers displays a QR Code (3) Wallet scans the QR Code. (4) Wallet connects to the Verifier. -(5) Wallet negotiates Security and sends details.

    -

    QR code MUST contain the same structure as defined in Section 7.1, except that when the QR Code is used to establish connection, entire public key (ED25519 key) is encoded in the QR code.

    -

    How the Connection Setup Request reaches a Wallet of a user's choice that capable of handling the request is out of scope of this specification(i.e. the usage of the Custom URL Schemes, Claimed URLs, etc.). The most certain way for a QR code to reach a target Wallet is to use a camera fature in a Wallet Application itself to scan a QR code.

    +(5) Wallet negotiates Security and sends details.

    +

    QR code MUST contain the same structure as defined in Section 8.1, except that when the QR Code is used to establish connection, entire public key (ED25519 key) is encoded in the QR code.

    +

    How the Connection Setup Request reaches a Wallet of a user's choice that capable of handling the request is out of scope of this specification(i.e. the usage of the Custom URL Schemes, Claimed URLs, etc.). The most certain way for a QR code to reach a target Wallet is to use a camera fature in a Wallet Application itself to scan a QR code.

    -
    +

    -8. Data Exchange Flow +9. Data Exchange Flow

    -

    This section describes how the Wallet obtains Presentation Request from the Verifier, and how the Wallet sends Presentation Response to the Verifier after authenticating the user and obtaining consent to share Credential(s) with the Verifier.

    -

    ToDo: Assume we want to support both sending only VC and VC in a VP?

    -

    Wallet MUST support the Central role and is responsible for connectting to the Verifier. The Verifier MUST support the Peripheral Role and should advertise its details. After the connection is established, the Wallet has the peripheral details and X25519 keys of the verifier. The sequence of flow is as described.

    -

    Step 1: Wallet generates a X25519 keys of its own and combines to create a DHE secret key very similar to the sodium NACL (May be we can choose Signal protocol?). +

    This section describes how the Wallet obtains Presentation Request from the Verifier, and how the Wallet sends Presentation Response to the Verifier after authenticating the user and obtaining consent to share Credential(s) with the Verifier.

    +

    ToDo: Assume we want to support both sending only VC and VC in a VP?

    +

    Wallet MUST support the Central role and is responsible for connectting to the Verifier. The Verifier MUST support the Peripheral Role and should advertise its details. After the connection is established, the Wallet has the peripheral details and X25519 keys of the verifier. The sequence of flow is as described.

    +

    Step 1: Wallet generates a X25519 keys of its own and combines to create a DHE secret key very similar to the sodium NACL (May be we can choose Signal protocol?). Step 2: Wallet makes identify request and submits its keys to the verifier in plain text. Step 3: Wallet reads the Presentation request from the Verifier. (Encrypted with the secret key) Step 4: Wallet authenticates the User and obtains consent Step 5: Wallet submits the VC to the Verifier. Step 6: The verifier accepts the VC if they could decrypt and validate the signature. -Step 7: Both the wallet and client records in their respective audit logs.

    -

    ToDo: Are we limiting signature suites only to X25519?

    +Step 7: Both the wallet and client records in their respective audit logs.

    +

    ToDo: Are we limiting signature suites only to X25519?

    -
    +

    -8.1. UUID for Service Definition +9.1. UUID for Service Definition

    -

    The Verifier acts as the server and the Verifier service MUST contain the following characteristics:

    -

    Verifier Service UUID MUST be 00000001-5026-444A-9E0E-D6F2450F3A77.

    +

    The Verifier acts as the server and the Verifier service MUST contain the following characteristics:

    +

    Verifier Service UUID MUST be 00000001-5026-444A-9E0E-D6F2450F3A77.

    - + + + + + + + @@ -1470,244 +1543,295 @@

    - + + + + + + + - + + + + + + + + + + + + +
    Table 1
    Characteristic name UUIDMandatory propertiesType Description
    Request Size00000004-5026-444A-9E0E-D6F2450F3A77ReadGet the request size
    Request 00000005-5026-444A-9E0E-D6F2450F3A77Wallet identifies
    Submit VCas chunks
    Content Size 00000007-5026-444A-9E0E-D6F2450F3A77 WriteSubmit the VCSubmit the content
    size
    Submit VC00000008-5026-444A-9E0E-D6F2450F3A77WriteVC stream as chunks
    -

    +--------------------+--------------------------------------+-----------------------+---------------------+

    -

    TODO: Can we plan to register our service with Bluetooth SIG? This will allow us to have

    -

    ToDo: If 'Submit VC' latency is high due to the presence of a photograph we will fall back to the style that Kritina wrote with State.

    -

    ToDo: Check if there are conventions to the UUID. Original in ISO is 00000001-A123-48CE-896B-4C76973373E6.

    +

    +--------------------+--------------------------------------+-----------------------+---------------------+

    +

    TODO: Can we plan to register our service with Bluetooth SIG? This will allow us to have

    +

    ToDo: If 'Submit VC' latency is high due to the presence of a photograph we will fall back to the style that Kritina wrote with State.

    +

    ToDo: Check if there are conventions to the UUID. Current UUID has been randomly generated.

    -
    +

    -8.2. Identity Request +9.2. Identity Request

    -

    ToDo: Need to elaborate.

    +

    ToDo: Need to elaborate.

    -
    +

    -8.3. Presentation Request +9.3. Presentation Request

    -

    Presentation Request MUST include presentation_definition parameter as defined in Section of [OpenID4VP].

    -

    response_type, client_id, redirect_uri parameters MUST NOT be present in the Presentation Request.

    -

    ToDo: Do we want nonce to be included? I believe we do.

    +

    Presentation Request MUST include presentation_definition parameter as defined in Section of [OpenID4VP].

    +

    response_type, client_id, redirect_uri parameters MUST NOT be present in the Presentation Request.

    +

    ToDo: Do we want nonce to be included? I believe we do.

    -
    +

    -8.4. Presentation Response +9.4. Presentation Response +

    +

    Presentation Response MUST include presentation_submission and vp_token parameters as defined in Section 6 of [OpenID4VP].

    +

    { + "presentation_submission": {

    +
    +
    },
    +"vp_token": [
    +    {
    +        VP1
    +    },
    +    {
    +        VP2
    +    }
    +]
    +
    +
    +

    }

    +
    +
    +
    +
    +

    +9.5. Stream Write Packet Structure +

    +

    Using the 'Content Size' characteristics the wallet sets the size. Once we receive the confirmation about the write we start the 'Submit VC' as a stream. 'Submit VC' is called multiple times until all the data is sent.

    +

    NOTE: Limit the total size to ~4kb for better performance while the protocol can handle larger. In case the Request does not match Size then its assumed its corrupted and the same procedure is repeated again.

    +

    Clarify the error handing rationale

    +
    +
    +
    +
    +

    +9.6. Stream Read Packet Structure

    -

    Presentation Response MUST include presentation_submission and vp_token parameters as defined in Section 6 of [OpenID4VP].

    +

    The Request Size is first called to get the actual size of the request. Once the size of the request is obtained the Request characteristics is called to get the actual data. The characteristics is called repeatedly until all the requested data is received.

    +

    To read the complete Characteristic Value an ATTREADREQ PDU should be used for the first part of the value and ATTREADBLOBREQ PDUs shall used for the rest. The Value Offset parameter of each ATTREADBLOBREQ PDU shall be set to the offset of the next octet within the Characteristic Value that has yet to be read. The ATTREADBLOBREQ PDU is repeated until the ATTREADBLOBRSP PDU's Part Attribute Value parameter is shorter than (ATT_MTU - 1).

    +

    NOTE: In case the Request does not match Size then its assumed its corrupted and the same procedure is repeated again.

    -
    +

    -8.5. Connection closure +9.7. Connection closure

    -

    After data retrieval, the GATT client unsubscribes from all characteristics.

    +

    After data retrieval, the GATT client unsubscribes from all characteristics.

    -
    +

    -8.6. Connection re-establishment +9.8. Connection re-establishment

    -

    In case of a lost connection a full flow is conducted again.

    +

    In case of a lost connection a full flow is conducted again.

    -
    +

    -8.7. Session Termination +9.9. Session Termination

    -

    The session MUST be terminated if at least one of the following conditions occur:

    +

    The session MUST be terminated if at least one of the following conditions occur:

      -
    • -

      After a time-out of no activity occurs.

      +
    • +

      After a time-out of no activity occurs.

    • -
    • -

      If the Wallet does not want to receive any further requests.

      +
    • +

      If the Wallet does not want to receive any further requests.

    • -
    • -

      If the Verifier does not want to send any further requests.

      +
    • +

      If the Verifier does not want to send any further requests.

    -

    Termination is as per the default BLE write.

    -

    In case of a termination, the Wallet and Verifier MUST perform at least the following actions:

    +

    Termination is as per the default BLE write.

    +

    In case of a termination, the Wallet and Verifier MUST perform at least the following actions:

      -
    • -

      Destruction of session keys and related ephemeral key material

      +
    • +

      Destruction of session keys and related ephemeral key material

    • -
    • -

      Closure of the communication channel used for data retrieval.

      +
    • +

      Closure of the communication channel used for data retrieval.

    -

    [SASI] TODO: Should we support multiple encryption type or pick the signal route?

    +

    [SASI] TODO: Should we support multiple encryption type or pick the single encryption route?

    -
    +

    -9. Encryption +10. Encryption

    -
    +

    -9.1. Overview +10.1. Overview

    -
      -
    1. -

      The Wallet obtains Verifier's ephemeral key pair in the Connection Setup Request from BLE Advertisement or a QR Code.

      +
        +
      1. +

        The Wallet obtains Verifier's ephemeral key pair in the Connection Setup Request from BLE Advertisement or a QR Code.

      2. -
      3. -

        The Wallet generates an ephemeral key pair.

        +
      4. +

        The Wallet generates an ephemeral key pair.

      5. -
      6. -

        The Wallet communicates its ephemeral key pair to the Verifier in the Identity Request.

        +
      7. +

        The Wallet communicates its ephemeral key pair to the Verifier in the Identity Request.

      8. -
      9. -

        The Verifier derives an encryption key using the Wallet's public key received in the Idenity Request, and encrypts Presentation Request using it.

        +
      10. +

        The Verifier derives an encryption key using the Wallet's public key received in the Idenity Request, and encrypts Presentation Request using it.

      11. -
      12. -

        The Wallet derives an encryption key using the Verifier's public key received in the Connection Set Up phase, decrypts Presentation Request and encrypts Presentation Response using it.

        +
      13. +

        The Wallet derives an encryption key using the Verifier's public key received in the Connection Set Up phase, decrypts Presentation Request and encrypts Presentation Response using it.

      14. -
      15. -

        The Verifier decrypts Presentation Response using the encryption key computed in step 4.

        +
      16. +

        The Verifier decrypts Presentation Response using the encryption key computed in step 4.

      -

      Note that Connection Setup Request itself defined in Section 7 MUST NOT be encrypted.

      -

      ToDo: no algorithm identifier since looks like we are doing only X25519?

      +

      Note that Connection Setup Request itself defined in Section 8 MUST NOT be encrypted.

      +

      ToDo: no algorithm identifier since looks like we are doing only X25519?

    -
    +

    -9.2. Session Key Computation +10.2. Session Key Computation

    -

    To calculate the session keys, the Wallet and the Verifier MUST perform ECKA-DH (Elliptic Curve Key Agreement Algorithm - Diffie-Hellman) as defined in BSI TR-03111. The Zab output defined in BSI TR-03111 MUST be used to derive 2 keys.

    -

    The Verifier MUST derive session key using HKDF as defined in [RFC5869] with the following parameters:

    +

    To calculate the session keys, the Wallet and the Verifier MUST perform ECKA-DH (Elliptic Curve Key Agreement Algorithm - Diffie-Hellman) as defined in BSI TR-03111. The Zab output defined in BSI TR-03111 MUST be used to derive 2 keys.

    +

    The Verifier MUST derive session key using HKDF as defined in [RFC5869] with the following parameters:

      -
    • -

      Hash: SHA-256

      +
    • +

      Hash: SHA-256

    • -
    • -

      IKM: Zab

      +
    • +

      IKM: Zab

    • -
    • -

      salt: SHA-256

      +
    • +

      salt: SHA-256

    • -
    • -

      info: "SKVerifier" (encoded as ASCII string)

      +
    • +

      info: "SKVerifier" (encoded as ASCII string)

    • -
    • -

      L: 32 octets

      +
    • +

      L: 32 octets

    -

    The Wallet MUST derive session key using HKDF as defined in [RFC5869] with the following parameters:

    +

    The Wallet MUST derive session key using HKDF as defined in [RFC5869] with the following parameters:

      -
    • -

      Hash: SHA-256

      +
    • +

      Hash: SHA-256

    • -
    • -

      IKM: Zab

      +
    • +

      IKM: Zab

    • -
    • -

      salt: SHA-256

      +
    • +

      salt: SHA-256

    • -
    • -

      info: "SKWallet" (encoded as ASCII string)

      +
    • +

      info: "SKWallet" (encoded as ASCII string)

    • -
    • -

      L: 32 octets

      +
    • +

      L: 32 octets

    -

    For encryption AES-256-GCM (192) or ChaCha20 (GCM: Galois Counter Mode) as defined in NIST SP 800-38D MUST be used.

    -

    ToDo: Can we do ChaCha20? Rather than AES 256 GCM? The fact that ChaCha20 is more streaming.

    -

    The IV (Initialization Vector defined in NIST SP 800-38D) used for encryption MUST have the default length of 12 bytes for GCM, as specified in NIST SP 800-38D. The IV MUST be the concatenation of the identifier and the message counter (identifier || message counter). The identifier MUST be an 8-byte value.

    -

    The Verifier MUST use the following identifier: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00. -The Wallet MUST use the following identifier: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01.

    -

    The Wallet and Verifier MUST keep a separate message counter for each session key. The message counter value MUST be a 4-byte big-endian unsigned integer. For the first encryption with a session key, the message counter MUST be set to 1. Before each following encryption with the same key, the message counter value MUST be increased by 1. A message counter value MUST never be reused in any future encryption using the same key. The AAD (Additional Authenticated Data defined in NIST SP 800-38D) used as input for the GCM function MUST be an empty string. The plaintext used as input for the GCM function MUST be Wallet request or Wallet response. The value of the data element in the session establishment and session data messages as defined in 9.1.1.4 MUST be the concatenation of the ciphertext and all 16 bytes of the authentication tag (ciphertext || authentication tag).

    -

    ToDo: Need to pharaphrase, currently text borrowed from ISO.

    +

    For encryption AES-256-GCM (192) (GCM: Galois Counter Mode) as defined in NIST SP 800-38D or ChaCha20 RFC 8439 MUST be used.

    +

    ToDo: Can we do ChaCha20? Rather than AES 256 GCM? The fact that ChaCha20 is more streaming.

    +

    The IV (Initialization Vector defined in NIST SP 800-38D) used for encryption MUST have the default length of 12 bytes for GCM, as specified in NIST SP 800-38D. The IV MUST be the concatenation of the identifier and the message counter (identifier || message counter). The identifier MUST be an 8-byte value.

    +

    The Verifier MUST use the following identifier: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00. +The Wallet MUST use the following identifier: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01.

    +

    The Wallet and Verifier MUST keep a separate message counter for each session key. The message counter value MUST be a 4-byte big-endian unsigned integer. For the first encryption with a session key, the message counter MUST be set to 1. Before each following encryption with the same key, the message counter value MUST be increased by 1. A message counter value MUST never be reused in any future encryption using the same key. The AAD (Additional Authenticated Data defined in NIST SP 800-38D) used as input for the GCM function MUST be an empty string. The plaintext used as input for the GCM function MUST be Wallet request or Wallet response. The value of the data element in the session establishment and session data messages as defined in 9.1.1.4 MUST be the concatenation of the ciphertext and all 16 bytes of the authentication tag (ciphertext || authentication tag).

    -
    +

    -10. Security Considerations +11. Security Considerations

    -
    +

    -10.1. Session Information +11.1. Session Information

    -

    Both wallet and the Verifier MUST remove all the information about the session after its termination.

    +

    Both wallet and the Verifier MUST remove all the information about the session after its termination.

    -
    +

    -10.2. Ensuring the Wallet is Connected to the correct Verifier +11.2. Ensuring the Wallet is Connected to the correct Verifier

    -

    To ensure that the Wallet is connected to the correct Verifier. The Wallet may verify the Ident characteristic as described in Clause 8.3.3.1.4. The Ident characteristic value MUST be calculated using the following procedure:

    -

    Use HKDF an defined in RFC 5869 with the following parameters: +

    To ensure that the Wallet is connected to the correct Verifier. The Wallet may verify the Ident characteristic as described in Clause 8.3.3.1.4. The Ident characteristic value MUST be calculated using the following procedure:

    +

    Use HKDF an defined in RFC 5869 with the following parameters: * Hash: SHA-256 * IKM: EdeviceKeyBytes (see Clause 9.1.1.4) * salt: (no salt value is provided) * info:"BLEIdent" (encoded as ASCII string) * L: 16 octets -If the Ident characteristic received from the Verifier does not match the expected value, the Wallet MUST disconnect from the Verifier.

    -

    NOTE The purpose of the Ident characteristic is only to verify whether the Wallet is connected to the correct Verifier before setting starting OpenID4VP Request. If the Wallet is connected to the wrong Verifier, session establishment will fail. Connecting and disconnecting to an Verifier takes a relatively large amount of time and it is therefore fastest to implement methods to identify the correct Verifier to connect to and not to rely purely on the Ident characteristic to identify the correct Verifier.

    -

    ToDo: Need to pharaphrase, currently text borrowed from ISO.

    +If the Ident characteristic received from the Verifier does not match the expected value, the Wallet MUST disconnect from the Verifier.

    +

    NOTE The purpose of the Ident characteristic is only to verify whether the Wallet is connected to the correct Verifier before setting starting OpenID4VP Request. If the Wallet is connected to the wrong Verifier, session establishment will fail. Connecting and disconnecting to an Verifier takes a relatively large amount of time and it is therefore fastest to implement methods to identify the correct Verifier to connect to and not to rely purely on the Ident characteristic to identify the correct Verifier.

    -
    +

    -10.3. Verifier Authentication +11.3. Verifier Authentication

    -

    How does the wallet authenticate the Verifier?

    +

    How does the wallet authenticate the Verifier?

    -
    +

    -10.4. Session Binding +11.4. Session Binding

    -

    How does the Verifier know a particular response is tied to a particular request?

    +

    How does the Verifier know a particular response is tied to a particular request?

    -
    +

    -10.5. Other +11.5. Other

    -

    ToDo: Mention that BLE HW is inherently not secure? securing which is out of scope of this protocol?

    +

    ToDo: Mention that BLE HW is inherently not secure? securing which is out of scope of this protocol?

    -
    +

    -11. Discussion points +12. Discussion points

      -
    • -

      not requiring nor recommending BLE secure connections.

      +
    • +

      not requiring nor recommending BLE secure connections.

    diff --git a/openid-for-verifiable-presentations-offline-1_0-01.xml b/openid-for-verifiable-presentations-offline-1_0-01.xml index e009328..f3ae95d 100644 --- a/openid-for-verifiable-presentations-offline-1_0-01.xml +++ b/openid-for-verifiable-presentations-offline-1_0-01.xml @@ -83,6 +83,40 @@ the Verifier Step 2 utilizes request and response syntax defined in [OpenID4VP] specification. Response type vp_token MUST be used to obtain the VP Token in Authorization Response.
    +
    Limitation +We need to be considerate of the following limitations in BLE stack 4.2 + +
      +
    1. Advertisement + +
        +
      • The advertisement message can contain only a max of 29 bytes. +
      • +
      • The advertisement scan request can not have any custom data. +
      • +
      • The scan response can have custom data.
        +
        +
      • +
    2. +
    3. Timing + +
        +
      • BLE Scanning and advertising are discrete events, so not every advertisement is received (max ~30 sec) +
      • +
    4. +
    5. Throughput + +
        +
      • Default MTU size is 23 bytes and max is 512 bytes +
      • +
      • 14 bytes are overhead cost per packet (MTU). +
      • +
      • 0.226 ~ 0.301 Mbps (Mega bits per second). So data rate of ~0.10 Mbps +
      • +
    6. +
    +
    +
    Protocol Flow Overview Below is the diagram that illustrates protocol flow:
    OpenID4VP over BLE Protocol Flow @@ -108,11 +142,19 @@ the Verifier +-------------+ & Close connection +----------------+
    -(1) Verifier and the Wallet establish the connection. This specification defines two mechanisms to do so: QR code displayed by the Verifier and BLE Advertisement initiated by the Verifier. -(2) Wallet obtains Presentation Request from the Verifier. -(3) Wallet authenticates the user and obtains consent to share Credential(s) with the Verifier. -(4) Wallet sends Presentation Response to the Verifier with Verifiable Presntation(s). -(5) Verifier and the Wallet close connection. + +
      +
    1. Verifier and the Wallet establish the connection. This specification defines two mechanisms to do so: QR code displayed by the Verifier and BLE Advertisement initiated by the Verifier. +
    2. +
    3. Wallet obtains Presentation Request from the Verifier. +
    4. +
    5. Wallet authenticates the user and obtains consent to share Credential(s) with the Verifier. +
    6. +
    7. Wallet sends Presentation Response to the Verifier with Verifiable Presntation(s). +
    8. +
    9. Verifier and the Wallet close connection. +
    10. +
    Connection Set up @@ -184,12 +226,19 @@ Step 7: Both the wallet and client records in their respective audit logs. Characteristic name UUID -Mandatory properties +Type Description + +Request Size +00000004-5026-444A-9E0E-D6F2450F3A77 +Read +Get the request size + + Request 00000005-5026-444A-9E0E-D6F2450F3A77 @@ -205,16 +254,37 @@ Step 7: Both the wallet and client records in their respective audit logs. -Submit VC + + + +as chunks + + + +Content Size 00000007-5026-444A-9E0E-D6F2450F3A77 Write -Submit the VC +Submit the content + + + + + + +size + + + +Submit VC +00000008-5026-444A-9E0E-D6F2450F3A77 +Write +VC stream as chunks +--------------------+--------------------------------------+-----------------------+---------------------+ TODO: Can we plan to register our service with Bluetooth SIG? This will allow us to have ToDo: If 'Submit VC' latency is high due to the presence of a photograph we will fall back to the style that Kritina wrote with State. -ToDo: Check if there are conventions to the UUID. Original in ISO is 00000001-A123-48CE-896B-4C76973373E6. +ToDo: Check if there are conventions to the UUID. Current UUID has been randomly generated.
    Identity Request @@ -229,6 +299,32 @@ Step 7: Both the wallet and client records in their respective audit logs.
    Presentation Response Presentation Response MUST include presentation_submission and vp_token parameters as defined in Section 6 of [OpenID4VP]. +{ + "presentation_submission": { + +}, +"vp_token": [ + { + VP1 + }, + { + VP2 + } +] + +} +
    + +
    Stream Write Packet Structure +Using the 'Content Size' characteristics the wallet sets the size. Once we receive the confirmation about the write we start the 'Submit VC' as a stream. 'Submit VC' is called multiple times until all the data is sent. +NOTE: Limit the total size to ~4kb for better performance while the protocol can handle larger. In case the Request does not match Size then its assumed its corrupted and the same procedure is repeated again. +Clarify the error handing rationale +
    + +
    Stream Read Packet Structure +The Request Size is first called to get the actual size of the request. Once the size of the request is obtained the Request characteristics is called to get the actual data. The characteristics is called repeatedly until all the requested data is received. +To read the complete Characteristic Value an ATTREADREQ PDU should be used for the first part of the value and ATTREADBLOBREQ PDUs shall used for the rest. The Value Offset parameter of each ATTREADBLOBREQ PDU shall be set to the offset of the next octet within the Characteristic Value that has yet to be read. The ATTREADBLOBREQ PDU is repeated until the ATTREADBLOBRSP PDU’s Part Attribute Value parameter is shorter than (ATT_MTU – 1). +NOTE: In case the Request does not match Size then its assumed its corrupted and the same procedure is repeated again.
    Connection closure @@ -259,7 +355,7 @@ Step 7: Both the wallet and client records in their respective audit logs.
  • Closure of the communication channel used for data retrieval.
  • -[SASI] TODO: Should we support multiple encryption type or pick the signal route? +[SASI] TODO: Should we support multiple encryption type or pick the single encryption route?
    @@ -315,13 +411,12 @@ Step 7: Both the wallet and client records in their respective audit logs.
  • L: 32 octets
  • -For encryption AES-256-GCM (192) or ChaCha20 (GCM: Galois Counter Mode) as defined in NIST SP 800-38D MUST be used. +For encryption AES-256-GCM (192) (GCM: Galois Counter Mode) as defined in NIST SP 800-38D or ChaCha20 RFC 8439 MUST be used. ToDo: Can we do ChaCha20? Rather than AES 256 GCM? The fact that ChaCha20 is more streaming. The IV (Initialization Vector defined in NIST SP 800-38D) used for encryption MUST have the default length of 12 bytes for GCM, as specified in NIST SP 800-38D. The IV MUST be the concatenation of the identifier and the message counter (identifier || message counter). The identifier MUST be an 8-byte value. The Verifier MUST use the following identifier: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00. The Wallet MUST use the following identifier: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01. The Wallet and Verifier MUST keep a separate message counter for each session key. The message counter value MUST be a 4-byte big-endian unsigned integer. For the first encryption with a session key, the message counter MUST be set to 1. Before each following encryption with the same key, the message counter value MUST be increased by 1. A message counter value MUST never be reused in any future encryption using the same key. The AAD (Additional Authenticated Data defined in NIST SP 800-38D) used as input for the GCM function MUST be an empty string. The plaintext used as input for the GCM function MUST be Wallet request or Wallet response. The value of the data element in the session establishment and session data messages as defined in 9.1.1.4 MUST be the concatenation of the ciphertext and all 16 bytes of the authentication tag (ciphertext || authentication tag). -ToDo: Need to pharaphrase, currently text borrowed from ISO. @@ -341,7 +436,6 @@ The Wallet MUST use the following identifier: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 * L: 16 octets If the Ident characteristic received from the Verifier does not match the expected value, the Wallet MUST disconnect from the Verifier. NOTE The purpose of the Ident characteristic is only to verify whether the Wallet is connected to the correct Verifier before setting starting OpenID4VP Request. If the Wallet is connected to the wrong Verifier, session establishment will fail. Connecting and disconnecting to an Verifier takes a relatively large amount of time and it is therefore fastest to implement methods to identify the correct Verifier to connect to and not to rely purely on the Ident characteristic to identify the correct Verifier. -ToDo: Need to pharaphrase, currently text borrowed from ISO.
    Verifier Authentication From f2fb64614de8b065c00125db236ae2218fa04f73 Mon Sep 17 00:00:00 2001 From: Kristina <52878547+Sakurann@users.noreply.github.com> Date: Tue, 4 Oct 2022 20:00:38 -0700 Subject: [PATCH 2/2] defining Session Key Computation parameters --- main.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.md b/main.md index b230a7c..1450306 100644 --- a/main.md +++ b/main.md @@ -346,18 +346,18 @@ To calculate the session keys, the Wallet and the Verifier MUST perform ECKA-DH The Verifier MUST derive session key using HKDF as defined in [RFC5869] with the following parameters: * Hash: SHA-256 -* IKM: Zab -* salt: SHA-256 -* info: “SKVerifier” (encoded as ASCII string) -* L: 32 octets +* IKM: Zab // discuss +* salt: SHA-256(???) // discuss +* info: “OpenID4VPVerifier” (encoded as ASCII string) +* L: 32 octets // discuss The Wallet MUST derive session key using HKDF as defined in [RFC5869] with the following parameters: * Hash: SHA-256 -* IKM: Zab -* salt: SHA-256 -* info: “SKWallet” (encoded as ASCII string) -* L: 32 octets +* IKM: Zab // discuss +* salt: SHA-256(???) // discuss +* info: “OpenID4VPWallet” (encoded as ASCII string) +* L: 32 octets // discuss For encryption AES-256-GCM (192) (GCM: Galois Counter Mode) as defined in NIST SP 800-38D or ChaCha20 RFC 8439 MUST be used.