Internet-Draft ACVP KDF TLS March 2024
Celi Expires 20 September 2024 [Page]
Workgroup:
Network Working Group
Internet-Draft:
:
Published:
Intended Status:
Informational
Expires:
Author:
C. Celi, Ed.

ACVP TLS Key Derivation Function JSON Specification

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 20 September 2024.

Table of Contents

1. Acknowledgements

There are no acknowledgements.

2. Abstract

This document defines the JSON schema for testing SP800-135 TLS KDF implementations with the ACVP specification.

3. Introduction

The Automated Crypto Validation Protocol (ACVP) defines a mechanism to automatically verify the cryptographic implementation of a software or hardware crypto module. The ACVP specification defines how a crypto module communicates with an ACVP server, including crypto capabilities negotiation, session management, authentication, vector processing and more. The ACVP specification does not define algorithm specific JSON constructs for performing the crypto validation. A series of ACVP sub-specifications define the constructs for testing individual crypto algorithms. Each sub-specification addresses a specific class of crypto algorithms. This sub-specification defines the JSON constructs for testing SP800-135 TLS KDF implementations using ACVP.

4. Conventions

4.1. Notation conventions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 of [RFC2119] and [RFC8174] when, and only when, they appear in all capitals, as shown here.

4.2. Terms and Definitions

4.2.1. Prompt

JSON sent from the server to the client describing the tests the client performs

4.2.2. Registration

The initial request from the client to the server describing the capabilities of one or several algorithm, mode and revision combinations

4.2.3. Response

JSON sent from the client to the server in response to the prompt

4.2.4. Test Case

An individual unit of work within a prompt or response

4.2.5. Test Group

A collection of test cases that share similar properties within a prompt or response

4.2.6. Test Vector Set

A collection of test groups under a specific algorithm, mode, and revision

4.2.7. Validation

JSON sent from the server to the client that specifies the correctness of the response

5. Supported KDFs

The following key derivation functions MAY be advertised by the ACVP compliant cryptographic module:

6. Test Types and Test Coverage

This section describes the design of the tests used to validate SP800-135 TLS KDF implementations.

6.1. Test Types

There is only one test type: functional tests. Each has a specific value to be used in the testType field. The testType field definition is:

  • "AFT" - Algorithm Functional Test. These tests can be processed by the client using a normal 'derive_key' operation. AFTs cause the implementation under test to exercise normal operations on a single block, multiple blocks, or partial blocks. In all cases, random data is used. The functional tests are designed to verify that the logical components of the key deriviation process are operating correctly.

6.2. Test Coverage

The tests described in this document have the intention of ensuring an implementation is conformant to [SP800-135].

6.2.2. TLS Requirements Not Covered

Some requirements in the outlined specification are not easily tested. Often they are not ideal for black-box testing such as the ACVP.

In [SP800-135], TBD.

7. Capabilities Registration

ACVP requires crypto modules to register their capabilities. This allows the crypto module to advertise support for specific algorithms, notifying the ACVP server which algorithms need test vectors generated for the validation process. This section describes the constructs for advertising support of TLS KDF algorithms to the ACVP server.

The algorithm capabilities MUST be advertised as JSON objects within the 'algorithms' value of the ACVP registration message. The 'algorithms' value is an array, where each array element is an individual JSON object defined in this section. The 'algorithms' value is part of the 'capability_exchange' element of the ACVP JSON registration message. See the ACVP specification [ACVP] for more details on the registration message.

7.1. Prerequisites

Each algorithm implementation MAY rely on other cryptographic primitives. For example, RSA Signature algorithms depend on an underlying hash function. Each of these underlying algorithm primitives must be validated, either separately or as part of the same submission. ACVP provides a mechanism for specifying the required prerequisites:

Prerequisites, if applicable, MUST be submitted in the registration as the prereqVals JSON property array inside each element of the algorithms array. Each element in the prereqVals array MUST contain the following properties

Table 1: Prerequisite Properties
JSON Property Description JSON Type
algorithm a prerequisite algorithm string
valValue algorithm validation number string

A "valValue" of "same" SHALL be used to indicate that the prerequisite is being met by a different algorithm in the capability exchange in the same registration.

An example description of prerequisites within a single algorithm capability exchange looks like this

"prereqVals":
[
  {
    "algorithm": "Alg1",
    "valValue": "Val-1234"
  },
  {
    "algorithm": "Alg2",
    "valValue": "same"
  }
]

7.2. Property Registration

The TLS KDF mode capabilities are advertised as JSON objects within a root "algorithm" object.

A registration SHALL use these properties

Table 2: TLS KDF Mode Capabilities JSON Values
JSON Property Description JSON Type Valid Values
algorithm Name of the algorithm to be validated string "kdf-components", "TLS-v1.2"
mode Mode of the algorithm to be validated string "tls", "KDF"
revision ACVP Test version string "1.0", "RFC7627"
tlsVersion The version of TLS supported array "v1.0/1.1", "v1.2". Note TLS v1.2 w/ extended master secret testing, i.e., TLS-v1.2 / KDF / RFC7627, does not use this property.
hashAlg SHA functions supported if TLS Version "v1.2" is included in the registration array See Section 7.2.1
keyBlockLength The length of the key block in bits. If omitted from the registration, a default value of 1024 will be used for TLS v1.2 w/ extended master secret testing, i.e., TLS-v1.2 / KDF / RFC7627. If omitted from the registration, default values of 832 and 1024 will be used for kdf-components / tls / 1.0 tlsVersion v1.0/1.1 and kdf-components / tls / 1.0 tlsVersion v1.2 respectively. domain {"Min": 512, "Max": 1024, "Increment": 8}

7.2.1. Valid Hash Functions

The following hash functions MAY be advertised by an ACVP compliant client under the 'hashAlg' property

  • SHA2-256
  • SHA2-384
  • SHA2-512

7.3. Registration Example

An example registration within an algorithm capability exchange looks like this

{
    "algorithm": "kdf-components",
    "mode": "tls",
    "revision": "1.0",
    "tlsVersion": [
        "v1.0/1.1",
        "v1.2"
    ],
    "hashAlg": [
        "SHA2-256",
        "SHA2-384",
        "SHA2-512"
    ]
},
{
    "algorithm": "TLS-v1.2",
    "mode": "KDF",
    "revision": "RFC7627",
    "hashAlg": [
        "SHA2-256",
        "SHA2-384",
        "SHA2-512"
    ]
}

8. Test Vectors

The ACVP server provides test vectors to the ACVP client, which are then processed and returned to the ACVP server for validation. A typical ACVP validation test session would require multiple test vector sets to be downloaded and processed by the ACVP client. Each test vector set represents an individual algorithm defined during the capability exchange. This section describes the JSON schema for a test vector set used with SP800-135 TLS KDF algorithms.

The test vector set JSON schema is a multi-level hierarchy that contains meta data for the entire vector set as well as individual test vectors to be processed by the ACVP client. The following table describes the JSON elements at the top level of the hierarchy.

Table 3: Top Level Test Vector JSON Elements
JSON Values Description JSON Type
acvVersion Protocol version identifier string
vsId Unique numeric vector set identifier integer
algorithm Algorithm defined in the capability exchange string
mode Mode defined in the capability exchange string
revision Protocol test revision selected string
testGroups Array of test groups containing test data, see Section 8.1 array

An example of this would look like this

[
  {
    "acvVersion": <version>
  },
  {
    "vsId": 1,
    "algorithm": "Alg1",
    "mode": "Mode1",
    "revision": "Revision1.0",
    "testGroups": [ ... ]
  }
]

8.1. Test Groups

The testGroups element at the top level in the test vector JSON object is an array of test groups. Test vectors are grouped into similar test cases to reduce the amount of data transmitted in the vector set. For instance, all test vectors that use the same key size would be grouped together. The Test Group JSON object contains meta data that applies to all test vectors within the group. The following table describes the SP800-135 TLS KDF JSON elements of the Test Group JSON object

Table 4: Test Group JSON Object
JSON Value Description JSON Type
tgId Test group identifier integer
testType Test operations to be performed string
tlsVersion The version of TLS used in the test group. Not included for TLS-v1.2 / KDF / RFC7627 testing. string
hashAlg SHA version used string
preMasterSecretLength Pre-master secret length in bits integer
keyBlockLength Key block length in bits integer
tests Array of individual test cases array

The 'tgId', 'testType' and 'tests' objects MUST appear in every test group element communicated from the server to the client as a part of a prompt.

8.2. Test Cases

8.2.1. Revision 1.0 Test Cases

Each test group contains an array of one or more test cases. Each test case is a JSON object that represents a single test vector to be processed by the ACVP client. The following table describes the JSON elements for each SP800-135 TLS KDF test vector.

Table 5: 1.0 Test Case JSON Object
JSON Value Description JSON Type
tcId Test case idenfitier integer
preMasterSecret Pre-master secret value hex
serverHelloRandom Server Hello random value hex
clientHelloRandom Client Hello random value hex
serverRandom Server random value hex
clientRandom Client random value hex

Here is an abbreviated yet fully constructed example of the prompt.

{
    "vsId": 1,
    "algorithm": "kdf-components",
    "mode": "tls",
    "revision": "1.0",
    "testGroups": [
        {
            "tgId": 1,
            "hashAlg": "SHA-1",
            "tlsVersion": "v1.0/1.1",
            "keyBlockLength": 832,
            "preMasterSecretLength": 384,
            "testType": "AFT",
            "tests": [
                {
                    "tcId": 1,
                    "preMasterSecret": "2F0D26CC2487169D83D9...",
                    "clientHelloRandom": "00D5EDFC0A7D8B0913...",
                    "serverHelloRandom": "14D06FC8F2792762BA...",
                    "clientRandom": "DDFB77CB1304A0541C6CC07...",
                    "serverRandom": "D59EB4E444005709409C572..."

                }
            ]
        }
    ]
}

8.2.2. Revision RFC7627 Test Cases

Each test group contains an array of one or more test cases. Each test case is a JSON object that represents a single test vector to be processed by the ACVP client. The following table describes the JSON elements for each SP800-135 TLS KDF test vector.

Table 6: RFC7627 Test Case JSON Object
JSON Value Description JSON Type
tcId Test case idenfitier integer
preMasterSecret Pre-master secret value hex
sessionHash the hash value of the concatenated handshake messages hex
serverRandom Server random value hex
clientRandom Client random value hex

Here is an abbreviated yet fully constructed example of the prompt.

{
    "vsId": 1,
    "algorithm": "TLS-v1.2",
    "mode": "KDF",
    "revision": "RFC7627",
    "testGroups": [
        {
            "tgId": 1,
            "hashAlg": "SHA2-256",
            "keyBlockLength": 1024,
            "preMasterSecretLength": 384,
            "testType": "AFT",
            "tests": [
                {
                    "tcId": 1,
                    "preMasterSecret": "2F0D26CC2487169D83D9...",
                    "sessionHash": "00D5EDFC0A7D8B0913...",
                    "clientRandom": "DDFB77CB1304A0541C6CC07...",
                    "serverRandom": "D59EB4E444005709409C572..."
                }
            ]
        }
    ]
}

9. Responses

After the ACVP client downloads and processes a vector set, it must send the response vectors back to the ACVP server. The following table describes the JSON object that represents a vector set response.

Table 7: Vector Set Response JSON Object
JSON Property Description JSON Type
acvVersion The version of the protocol string
vsId The vector set identifier integer
testGroups The test group data array

An example of this is the following

{
    "acvVersion": "version",
    "vsId": 1,
    "testGroups": [ ... ]
}

The testGroups section is used to organize the ACVP client response in a similar manner to how it receives vectors. Several algorithms SHALL require the client to send back group level properties in their response. This structure helps accommodate that.

Table 8: Vector Set Group Response JSON Object
JSON Property Description JSON Type
tgId The test group identifier integer
tests The test case data array

An example of this is the following

{
    "tgId": 1,
    "tests": [ ... ]
}

The following table describes the JSON object that represents a test case response for a SP800-135 TLS KDF.

Table 9: Test Case Results JSON Object
JSON Property Description JSON Type
tcId The test case identifier integer
masterSecret Master secret value hex
keyBlock Key block value of the expansion step hex

Here is an abbreviated example of the response

{
  "vsId": 1,
  "testGroups": [{
    "tgId": 1,
    "tests": [{
      "tcId": 1,
      "masterSecret": "38E544579C06B3F515E...",
      "keyBlock": "9F39392B46ABF3D852F4F31..."
    }]
  }]
}

10. Security Considerations

There are no additional security considerations outside of those outlined in the ACVP document.

11. IANA Considerations

This document does not require any action by IANA.

12. References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", RFC 2119, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", RFC 8174, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>.
[SP800-135]
Dang, Q. H., "Recommendation for Existing Application-Specific Key Derivation Functions", NIST SP 800-135 Rev. 1, , <https://csrc.nist.gov/pubs/sp/800/135/r1/final>.
[RFC7627]
Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., Langley, A., and M. Ray, "Transport Layer Security (TLS) Session Hash and Extended Master Secret Extension", RFC 7627, RFC 7627, DOI 10.17487/RFC7627, , <https://www.rfc-editor.org/info/rfc7627>.
[ACVP]
Fussell, B., Vassilev, A., and H. Booth, "Automatic Cryptographic Validation Protocol", .

Author's Address

Christopher Celi (editor)