Network Working Group C. Celi, Ed. Internet-Draft 10 August 2020 Intended status: Informational Expires: 11 February 2021 ACVP TPM 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 11 February 2021. Copyright Notice Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 2 2. Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 4. Terms and definitions . . . . . . . . . . . . . . . . . . . . 2 5. Supported KDFs . . . . . . . . . . . . . . . . . . . . . . . 3 6. Test Types and Test Coverage . . . . . . . . . . . . . . . . 3 6.1. Test Types . . . . . . . . . . . . . . . . . . . . . . . 3 Celi Expires 11 February 2021 [Page 1] Internet-Draft ACVP KDF TPM August 2020 6.2. Test Coverage . . . . . . . . . . . . . . . . . . . . . . 3 6.2.1. TPM Requirements Covered . . . . . . . . . . . . . . 3 6.2.2. TPM Requirements Not Covered . . . . . . . . . . . . 3 7. Capabilities Registration . . . . . . . . . . . . . . . . . . 4 7.1. Prerequisites . . . . . . . . . . . . . . . . . . . . . . 4 7.2. Required Prerequisite Algorithms for KDF135 TPM Validations . . . . . . . . . . . . . . . . . . . . . . . 5 7.3. KDF135 TPM Algorithm Capabilities JSON Values . . . . . . 5 8. Test Vectors . . . . . . . . . . . . . . . . . . . . . . . . 6 8.1. Test Groups JSON Schema . . . . . . . . . . . . . . . . . 7 8.2. Test Case JSON Schema . . . . . . . . . . . . . . . . . . 8 9. Test Vector Responses . . . . . . . . . . . . . . . . . . . . 9 10. Security Considerations . . . . . . . . . . . . . . . . . . . 11 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 12. Bibliography . . . . . . . . . . . . . . . . . . . . . . . . 11 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 12 1. Acknowledgements There are no acknowledgements. 2. Abstract This document defines the JSON schema for testing SP800-135 TPM 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 TPM KDF implementations using ACVP. 4. Terms and definitions No terms and definitions are listed in this document. Celi Expires 11 February 2021 [Page 2] Internet-Draft ACVP KDF TPM August 2020 5. Supported KDFs The following key derivation functions MAY be advertised by the ACVP compliant cryptographic module: * ACVP-KDF-TPM 6. Test Types and Test Coverage This section describes the design of the tests used to validate SP800-135 TPM 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.1. TPM Requirements Covered In [SP800-135], TBD. 6.2.2. TPM 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. Celi Expires 11 February 2021 [Page 3] Internet-Draft ACVP KDF TPM August 2020 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 TPM 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 +===============+=============================+===========+ | JSON Property | Description | JSON Type | +===============+=============================+===========+ | algorithm | a prerequisite algorithm | string | +---------------+-----------------------------+-----------+ | valValue | algorithm validation number | string | +---------------+-----------------------------+-----------+ Table 1: Prerequisite Properties 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 Celi Expires 11 February 2021 [Page 4] Internet-Draft ACVP KDF TPM August 2020 "prereqVals": [ { "algorithm": "Alg1", "valValue": "Val-1234" }, { "algorithm": "Alg2", "valValue": "same" } ] Figure 1 7.2. Required Prerequisite Algorithms for KDF135 TPM Validations Some KDF135 algorithm implementations rely on other cryptographic primitives. For example, TPM uses an underlying SHA algorithm. 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: +==============+================+=====================+===========+ | JSON Value | Description | JSON type | Valid | | | | | Values | +==============+================+=====================+===========+ | algorithm | a prerequisite | string | HMAC, SHA | | | algorithm | | | +--------------+----------------+---------------------+-----------+ | valValue | algorithm | string | actual | | | validation | | number or | | | number | | "same" | +--------------+----------------+---------------------+-----------+ | prereqAlgVal | prerequistie | object with | see above | | | algorithm | algorithm and | | | | validation | valValue properties | | +--------------+----------------+---------------------+-----------+ Table 2: Required Prerequisite Algorithms JSON Values 7.3. KDF135 TPM Algorithm Capabilities JSON Values Each algorithm capability advertised is a self-contained JSON object using the following values. Celi Expires 11 February 2021 [Page 5] Internet-Draft ACVP KDF TPM August 2020 +============+=================+==============+==================+ | JSON Value | Description | JSON type | Valid Values | +============+=================+==============+==================+ | algorithm | The algorithm | string | "kdf-components" | | | to be validated | | | +------------+-----------------+--------------+------------------+ | mode | The KDF to be | string | "tpm" | | | validated | | | +------------+-----------------+--------------+------------------+ | revision | The testing | string | "1.0" | | | revision used | | | +------------+-----------------+--------------+------------------+ | prereqVals | Prerequisite | array of | See Section 7.2 | | | algorithm | prereqAlgVal | | | | validations | objects | | +------------+-----------------+--------------+------------------+ Table 3: SP800-135 TPM KDF Algorithm Capabilities JSON Values The following is an example of a registration for kdf-components / TPM / 1.0 { "algorithm": "kdf-components", "mode": "tpm", "revision": "1.0" } Figure 2 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 TPM 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. Celi Expires 11 February 2021 [Page 6] Internet-Draft ACVP KDF TPM August 2020 +=============+======================================+===========+ | JSON Values | Description | JSON Type | +=============+======================================+===========+ | acvVersion | Protocol version identifier | string | +-------------+--------------------------------------+-----------+ | vsId | Unique numeric vector set identifier | integer | +-------------+--------------------------------------+-----------+ | algorithm | Algorithm defined in the capability | string | | | exchange | | +-------------+--------------------------------------+-----------+ | mode | Mode defined in the capability | string | | | exchange | | +-------------+--------------------------------------+-----------+ | revision | Protocol test revision selected | string | +-------------+--------------------------------------+-----------+ | testGroups | Array of test groups containing test | array | | | data, see Section 8.1 | | +-------------+--------------------------------------+-----------+ Table 4: Top Level Test Vector JSON Elements An example of this would look like this { "acvVersion": "version", "vsId": 1, "algorithm": "Alg1", "mode": "Mode1", "revision": "Revision1.0", "testGroups": [ ... ] } Figure 3 8.1. Test Groups JSON Schema 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 secure hash JSON elements of the Test Group JSON object. The KDF test group for TPM is as follows: Celi Expires 11 February 2021 [Page 7] Internet-Draft ACVP KDF TPM August 2020 +=====================+=============+=======+=====================+ | JSON Value | Description | JSON | tgId | | | | type | | +=====================+=============+=======+=====================+ | Numeric identifier | integer | tests | Array of individual | | for the test group, | | | test vector JSON | | unique across the | | | objects, which are | | entire vector set | | | defined in | | | | | Section 8.2 | +---------------------+-------------+-------+---------------------+ Table 5: Vector Group JSON Object 8.2. Test Case JSON Schema 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 TPM KDF test vector. +====================+=============+========+================+ | JSON Value | Description | JSON | tcId | | | | type | | +====================+=============+========+================+ | Numeric identifier | integer | auth | Value of the | | for the test case, | | | authentication | | unique across the | | | | | entire vector set | | | | +--------------------+-------------+--------+----------------+ | hex | nonceEven | Value | hex | | | | of the | | | | | nonce | | | | | even | | +--------------------+-------------+--------+----------------+ Table 6: Test Case JSON Object An example of the prompt for kdf-components / TPM / 1.0 is the following Celi Expires 11 February 2021 [Page 8] Internet-Draft ACVP KDF TPM August 2020 [ { "acvVersion": "1.0" }, { "vsId": 1564, "algorithm": "kdf-components", "mode": "tpm", "revision": "1.0", "testGroups": [ { "tgId": 1, "tests": [ { "tcId": 2170, "auth": "fd771b263f6be051a1d7eb0c5138fbfcafbd49de", "nonceEven": "6b8790fd56b2b74734ea97db727ac9eb16e69831", "nonceOdd": "4fa48de2db65fa7082f4acc9f85ecc81d40d1793" } ] } ] } ] Figure 4 9. Test Vector 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. +============+======================================+===========+ | JSON Value | Description | JSON type | +============+======================================+===========+ | acvVersion | Protocol version identifier | string | +------------+--------------------------------------+-----------+ | vsId | Unique numeric identifier for the | integer | | | vector set | | +------------+--------------------------------------+-----------+ | testGroups | Array of JSON objects that represent | array | | | each test vector group. See Table 8 | | +------------+--------------------------------------+-----------+ Table 7: Vector Set Response JSON Object Celi Expires 11 February 2021 [Page 9] Internet-Draft ACVP KDF TPM August 2020 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. +============+=============================+===========+ | JSON Value | Description | JSON type | +============+=============================+===========+ | tgId | The test group Id | integer | +------------+-----------------------------+-----------+ | tests | The tests associated to the | array | | | group specified in tgId | | +------------+-----------------------------+-----------+ Table 8: Vector Set Group Response JSON Object The following table describes the JSON object that represents a test results response from a TPM crypto module. +============+=======================================+===========+ | JSON Value | Description | JSON type | +============+=======================================+===========+ | tcId | Numeric identifier for the test case, | integer | | | unique across the entire vector set | | +------------+---------------------------------------+-----------+ | sKey | Shared key value | hex | +------------+---------------------------------------+-----------+ Table 9: Vector Set Results Response JSON Object An example of the vector set results response is provided below. Celi Expires 11 February 2021 [Page 10] Internet-Draft ACVP KDF TPM August 2020 [ { "acvVersion": "1.0" }, { "vsId": 1564, "testGroups": [ { "tgId": 1, "tests": [ { "tcId": 2170, "sKey": "c431a158b7b77d7e993515f8ebc2cd6add53b702" } ] } ] } ] Figure 5 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. Bibliography [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", IETF RFC 2119, IETF RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", IETF RFC 8174, IETF RFC 8174, DOI 10.17487/RFC8174, May 2017, . [ACVP] Fussell, B., Vassilev, A., and H. Booth, "Automatic Cryptographic Validation Protocol", ACVP ACVP, 2019. Celi Expires 11 February 2021 [Page 11] Internet-Draft ACVP KDF TPM August 2020 [SP800-135] Dang, Q., "SP800-135r1 Recommendation for Existing Application-Specific Key Derivation Functions", SP800 SP800-135, 2011, . Author's Address Christopher Celi (editor) Email: christopher.celi@nist.gov Celi Expires 11 February 2021 [Page 12]