KEYPROV Working Group A. Doherty Internet-Draft RSA, The Security Division of EMC Intended status: Standards Track M. Pei Expires: July 28, 2008 Verisign, Inc. S. Machani Diversinet Corp. M. Nystrom RSA, The Security Division of EMC January 25, 2008 Dynamic Symmetric Key Provisioning Protocol (DSKPP) draft-ietf-keyprov-dskpp-02.txt Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. 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." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on July 28, 2008. Copyright Notice Copyright (C) The IETF Trust (2008). Abstract DSKPP is a client-server protocol for initialization (and configuration) of symmetric keys to locally and remotely accessible cryptographic modules. The protocol can be run with or without Doherty, et al. Expires July 28, 2008 [Page 1] Internet-Draft DSKPP January 2008 private-key capabilities in the cryptographic modules, and with or without an established public-key infrastructure. Two variations of the protocol support multiple usage scenarios. The four-pass (i.e., two round-trip) variant enables key generation in near real-time. With the four-pass variant, keys are mutually generated by the provisioning server and cryptographic module; provisioned keys are not transferred over-the-wire or over-the-air. The two-pass variant enables secure and efficient download and installation of symmetric keys to a cryptographic module in environments where near real-time communication may not be possible. This document builds on information contained in [RFC4758], adding specific enhancements in response to implementation experience and liaison requests. It is intended that this document or a successor version thereto will become the basis for subsequent progression of a symmetric key provisioning protocol specification on the standards track. Doherty, et al. Expires July 28, 2008 [Page 2] Internet-Draft DSKPP January 2008 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.1. Usage Scenarios . . . . . . . . . . . . . . . . . . . . . 7 1.1.1. Single Key Request . . . . . . . . . . . . . . . . . . 7 1.1.2. Multiple Key Requests . . . . . . . . . . . . . . . . 7 1.1.3. Session Time-Out Policy . . . . . . . . . . . . . . . 7 1.1.4. Outsourced Provisioning . . . . . . . . . . . . . . . 8 1.1.5. Key Renewal . . . . . . . . . . . . . . . . . . . . . 8 1.1.6. Pre-Loaded Key Replacement . . . . . . . . . . . . . . 8 1.1.7. Pre-Shared Transport Key . . . . . . . . . . . . . . . 8 1.1.8. End-to-End Protection of Key Material . . . . . . . . 9 1.2. Protocol Entities . . . . . . . . . . . . . . . . . . . . 9 1.3. Initiating DSKPP . . . . . . . . . . . . . . . . . . . . . 10 1.4. Determining Which Protocol Variant to Use . . . . . . . . 11 1.4.1. Criteria for Using the Four-Pass Protocol . . . . . . 11 1.4.2. Criteria for Using the Two-Pass Protocol . . . . . . . 12 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.1. Key Words . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . 12 2.3. Notation . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 15 3. DSKPP Protocol Details . . . . . . . . . . . . . . . . . . . . 15 3.1. Four-Pass Protocol Usage . . . . . . . . . . . . . . . . . 17 3.1.1. Message Flow . . . . . . . . . . . . . . . . . . . . . 17 3.1.2. Generation of Symmetric Keys for Cryptographic Modules . . . . . . . . . . . . . . . . . . . . . . . 20 3.1.3. MAC Calculations . . . . . . . . . . . . . . . . . . . 22 3.2. Two-Pass Protocol Usage . . . . . . . . . . . . . . . . . 23 3.2.1. Message Flow . . . . . . . . . . . . . . . . . . . . . 24 3.2.2. Key Protection Profiles . . . . . . . . . . . . . . . 26 3.2.3. MAC Calculations . . . . . . . . . . . . . . . . . . . 30 3.3. User Authentication . . . . . . . . . . . . . . . . . . . 31 3.3.1. Device Identifier . . . . . . . . . . . . . . . . . . 32 3.3.2. Authentication Data . . . . . . . . . . . . . . . . . 32 3.4. The DSKPP One-Way Pseudorandom Function, DSKPP-PRF . . . . 34 3.4.1. Introduction . . . . . . . . . . . . . . . . . . . . . 34 3.4.2. Declaration . . . . . . . . . . . . . . . . . . . . . 35 3.5. Encryption of Pseudorandom Nonces Sent from the DSKPP Client . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4. DSKPP Message Formats . . . . . . . . . . . . . . . . . . . . 36 4.1. General XML Schema Requirements . . . . . . . . . . . . . 36 4.2. Components of the Message . . . . . . . . 36 4.3. Components of the Request . . . . . . 37 4.3.1. The DeviceIdentifierDataType Type . . . . . . . . . . 40 4.3.2. The ProtocolVariantsType Type . . . . . . . . . . . . 40 4.3.3. The KeyContainersFormatType Type . . . . . . . . . . . 41 4.3.4. The AuthenticationDataType Type . . . . . . . . . . . 42 Doherty, et al. Expires July 28, 2008 [Page 3] Internet-Draft DSKPP January 2008 4.4. Components of the Response (Used Only in Four-Pass DSKPP) . . . . . . . . . . . . . . . . . 44 4.5. Components of a Request (Used Only in Four-Pass DSKPP) . . . . . . . . . . . . . . . . . 45 4.6. Components of a Response . . . . . 46 4.7. The StatusCode Type . . . . . . . . . . . . . . . . . . . 48 5. Extensibility . . . . . . . . . . . . . . . . . . . . . . . . 50 5.1. The ClientInfoType Type . . . . . . . . . . . . . . . . . 50 5.2. The ServerInfoType Type . . . . . . . . . . . . . . . . . 50 6. Protocol Bindings . . . . . . . . . . . . . . . . . . . . . . 50 6.1. General Requirements . . . . . . . . . . . . . . . . . . . 50 6.2. HTTP/1.1 Binding for DSKPP . . . . . . . . . . . . . . . . 50 6.2.1. Introduction . . . . . . . . . . . . . . . . . . . . . 50 6.2.2. Identification of DSKPP Messages . . . . . . . . . . . 50 6.2.3. HTTP Headers . . . . . . . . . . . . . . . . . . . . . 51 6.2.4. HTTP Operations . . . . . . . . . . . . . . . . . . . 51 6.2.5. HTTP Status Codes . . . . . . . . . . . . . . . . . . 51 6.2.6. HTTP Authentication . . . . . . . . . . . . . . . . . 52 6.2.7. Initialization of DSKPP . . . . . . . . . . . . . . . 52 6.2.8. Example Messages . . . . . . . . . . . . . . . . . . . 52 7. DSKPP Schema . . . . . . . . . . . . . . . . . . . . . . . . . 53 8. Conformance Requirements . . . . . . . . . . . . . . . . . . . 61 9. Security Considerations . . . . . . . . . . . . . . . . . . . 62 9.1. General . . . . . . . . . . . . . . . . . . . . . . . . . 62 9.2. Active Attacks . . . . . . . . . . . . . . . . . . . . . . 62 9.2.1. Introduction . . . . . . . . . . . . . . . . . . . . . 62 9.2.2. Message Modifications . . . . . . . . . . . . . . . . 62 9.2.3. Message Deletion . . . . . . . . . . . . . . . . . . . 64 9.2.4. Message Insertion . . . . . . . . . . . . . . . . . . 64 9.2.5. Message Replay . . . . . . . . . . . . . . . . . . . . 65 9.2.6. Message Reordering . . . . . . . . . . . . . . . . . . 65 9.2.7. Man-in-the-Middle . . . . . . . . . . . . . . . . . . 65 9.3. Passive Attacks . . . . . . . . . . . . . . . . . . . . . 65 9.4. Cryptographic Attacks . . . . . . . . . . . . . . . . . . 66 9.5. Attacks on the Interaction between DSKPP and User Authentication . . . . . . . . . . . . . . . . . . . . . . 66 9.6. Additional Considerations . . . . . . . . . . . . . . . . 67 9.6.1. Client Contributions to K_TOKEN Entropy . . . . . . . 67 9.6.2. Key Confirmation . . . . . . . . . . . . . . . . . . . 67 9.6.3. Server Authentication . . . . . . . . . . . . . . . . 67 9.6.4. User Authentication . . . . . . . . . . . . . . . . . 67 9.6.5. Key Protection in the Two-Pass Passphrase Profile . . 68 10. Internationalization Considerations . . . . . . . . . . . . . 69 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 69 12. Intellectual Property Considerations . . . . . . . . . . . . . 69 13. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 69 14. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 69 15. References . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Doherty, et al. Expires July 28, 2008 [Page 4] Internet-Draft DSKPP January 2008 15.1. Normative references . . . . . . . . . . . . . . . . . . . 70 15.2. Informative references . . . . . . . . . . . . . . . . . . 71 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 72 A.1. Trigger Message . . . . . . . . . . . . . . . . . . . . . 73 A.2. Four-Pass Protocol . . . . . . . . . . . . . . . . . . . . 73 A.2.1. Without a Preceding Trigger . . . 73 A.2.2. Assuming a Preceding Trigger . . 74 A.2.3. Without a Preceding Trigger . . . 75 A.2.4. Assuming a Preceding Trigger . . 76 A.2.5. Using Default Encryption . . . . 77 A.2.6. Using Default Encryption . . . 78 A.3. Two-Pass Protocol . . . . . . . . . . . . . . . . . . . . 79 A.3.1. Example Using the Key Transport Profile . . . . . . . 79 A.3.2. Example Using the Key Wrap Profile . . . . . . . . . . 82 A.3.3. Example Using the Passphrase-Based Key Wrap Profile . 85 Appendix B. Integration with PKCS #11 . . . . . . . . . . . . . . 88 B.1. The 4-pass Variant . . . . . . . . . . . . . . . . . . . . 88 B.2. The 2-pass Variant . . . . . . . . . . . . . . . . . . . . 88 Appendix C. Example of DSKPP-PRF Realizations . . . . . . . . . . 91 C.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 91 C.2. DSKPP-PRF-AES . . . . . . . . . . . . . . . . . . . . . . 91 C.2.1. Identification . . . . . . . . . . . . . . . . . . . . 91 C.2.2. Definition . . . . . . . . . . . . . . . . . . . . . . 91 C.2.3. Example . . . . . . . . . . . . . . . . . . . . . . . 92 C.3. DSKPP-PRF-SHA256 . . . . . . . . . . . . . . . . . . . . . 93 C.3.1. Identification . . . . . . . . . . . . . . . . . . . . 93 C.3.2. Definition . . . . . . . . . . . . . . . . . . . . . . 93 C.3.3. Example . . . . . . . . . . . . . . . . . . . . . . . 94 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 94 Intellectual Property and Copyright Statements . . . . . . . . . . 96 Doherty, et al. Expires July 28, 2008 [Page 5] Internet-Draft DSKPP January 2008 1. Introduction A symmetric key cryptographic module provides data authentication and encryption services to software (or firmware) applications hosted on hardware devices, such as personal computers, handheld mobile phones, one-time password tokens, USB flash drives, tape drives, etc. Until recently, provisioning symmetric keys to these modules has been labor intensive, involving manual operations that are device-specific, and inherently error-prone. Fortunately, an increasing number of hardware devices enable programmatic initialization of their applications. For example, a U3-ready thumb drive lets users load and configure applications locally through a USB port on their PC. Other hardware devices, such as Personal Digital Assistant (PDA) phones, allow users to load and configure applications over-the-air. Likewise, programmable cryptographic modules enable issuers to provision symmetric keys via the Internet, whether over-the-wire or over-the-air. This document describes the Dynamic Symmetric Key Provisioning Protocol (DSKPP), which leverages these recent technological developments. DSKPP provides an open and interoperable mechanism for initializing and configuring symmetric keys to cryptographic modules that are accessible over the Internet. The description is based on the information contained in RFC4758, and contains specific enhancements, such as User Authentication and support for the [PSKC] format for transmission of key material. DSKPP is a client-server protocol with two variations. One variation establishes a symmetric key by mutually authenticated key agreement. The other variation relies on key distribution. In the former case, key agreement enables two parties (a cryptographic module and key provisioning server) to establish a symmetric cryptographic key using an exchange of four messages, such that the key is not transported over the Internet. In the latter case, key distribution enables a key provisioning server to transport a symmetric key to a cryptographic module over the Internet using an exchange of two messages. In either case, DSKPP is flexible enough to be run with or without private-key capability in the cryptographic module, and with or without an established public-key infrastructure. All DSKPP communications consist of pairs of messages: a request and a response. Each pair is called an "exchange", and each message sent in an exchange is called a "pass". Thus, an implementation of DSKPP that relies on mutually authenticated key agreement is called the "four-pass protocol"; an implementation of DSKPP that relies on key distribution is called the "two-pass protocol". Doherty, et al. Expires July 28, 2008 [Page 6] Internet-Draft DSKPP January 2008 DSKPP message flow always consists of a request followed by a response. It is the responsibility of the client to ensure reliability. If the response is not received with a timeout interval, the client needs to retransmit the request (or abandon the connection). Number of retries and lengths of timeouts are not covered in this document because they do not affect interoperability. 1.1. Usage Scenarios DSKPP is expected to be used to provision symmetric keys to cryptographic modules in a number of different scenarios, each with its own special requirements. 1.1.1. Single Key Request The usual scenario is that a cryptographic module makes a request for a symmetric key from a provisioning server that is located on the local network or somewhere on the Internet. Depending upon the deployment scenario, the provisioning server may generate a new key on-the-fly or use a pre-generated key, e.g., one provided by a legacy back-end issuance server. The provisioning server assigns a unique key ID to the symmetric key and provisions it to the cryptographic module. 1.1.2. Multiple Key Requests A cryptographic module makes multiple requests for symmetric keys from the same provisioning server. The symmetric keys need not be of the same type, i.e., the keys may be used with different symmetric key cryptographic algorithms, including one-time password authentication algorithms, and AES encryption algorithm. 1.1.3. Session Time-Out Policy Once a cryptographic module initiates a symmetric key request, the provisioning server may require that any subsequent actions to complete the provisioning cycle occur within a certain time window. For example, an issuer may provide a time-limited authentication code to a user during registration, which the user will input into the cryptographic module to authenticate themselves with the provisioning server. If the user inputs a valid authentication code within the fixed time period established by the issuer, the server will allow a key to be provisioned to the cryptographic module hosted by the user's device. Doherty, et al. Expires July 28, 2008 [Page 7] Internet-Draft DSKPP January 2008 1.1.4. Outsourced Provisioning A symmetric key issuer outsources its key provisioning to a third- party key provisioning server provider. The issuer is responsible for authenticating and granting rights to users to acquire keys while acting as a proxy to the cryptographic module to acquire symmetric keys from the provisioning server; the cryptographic module communicates with the issuer proxy server, which forwards provisioning requests to the provisioning server. 1.1.5. Key Renewal A cryptographic module requests renewal of a symmetric key using the same key ID already associated with the key. Such a need may occur in the case when a user wants to upgrade her device that houses the cryptographic module or when a key has expired. When a user uses the same cryptographic module to, for example, perform strong authentication at multiple Web login sites, keeping the same key ID removes the need for the user to register a new key ID at each site. 1.1.6. Pre-Loaded Key Replacement This scenario represents a special case of symmetric key renewal in which a local administrator can authenticate the user procedurally before initiating the provisioning process. It also allows for an issuer to pre-load a key onto a cryptographic module with a restriction that the key is replaced with a new key prior to use of the cryptographic module. Another variation of this scenario is the issuer who recycles devices. In this case, an issuer would provision a new symmetric key to a cryptographic module hosted on a device that was previously owned by another user. Note that this usage scenario is essentially the same as the last scenario wherein the same key ID is used for renewal. 1.1.7. Pre-Shared Transport Key A cryptographic module is loaded onto a smart card after the card is issued to a user. The symmetric key for the cryptographic module will then be provisioned using a secure channel mechanism present in many smart card platforms. This allows a direct secure channel to be established between the smart card chip and the provisioning server. For example, the card commands (i.e., Application Protocol Data Units, or APDUs) are encrypted with a pre-shared transport key and sent directly to the smart card chip, allowing secure post-issuance in-the-field provisioning. This secure flow can pass Transport Layer Security (TLS) and other transport security boundaries. Doherty, et al. Expires July 28, 2008 [Page 8] Internet-Draft DSKPP January 2008 Note that two pre-conditions for this usage scenario are for the protocol to be tunneled and the provisioning server to know the correct pre-established transport key. 1.1.8. End-to-End Protection of Key Material In this scenario, transport layer security does not provide end-to- end protection of key material transported from the provisioning server to the cryptographic module. For example, TLS may terminate at an application hosted on a PC rather than at the cryptographic module (i.e., the endpoint) located on a data storage device. Mutually authenticated key agreement provides end-to-end protection, which TLS cannot provide. 1.2. Protocol Entities In principle, the protocol involves a DSKPP client and a DSKPP server. The DSKPP client manages communication between the cryptographic module and the provisioning server. In this document, the DSKPP server represents the provisioning server. A high-level object model that describes the client-side entities and how they relate to each other is shown in Figure 1. Conceptually, each entity is represented by the definitions found in Section 2.2. Doherty, et al. Expires July 28, 2008 [Page 9] Internet-Draft DSKPP January 2008 ----------- ------------- | User | | Device | |---------|* owns *|-----------| | UserID |--------->| DeviceID | | ... | | ... | ----------- ------------- | 1 | | contains | | * V -------------------------- |Cryptographic Module | |------------------------| |Crypto Module ID | |Security Attribute List | |... | -------------------------- | 1 | | contains | | * V ----------------------- |Key Container | |---------------------| |Key ID | |Key Type | |... | ----------------------- Figure 1: Object Model It is assumed that a device will host an application layered above the cryptographic module, and this application will manage communication between the DSKPP client and cryptographic module. The manner in which the communicating application will transfer DSKPP protocol elements to and from the cryptographic module is transparent to the DSKPP server. One method for this transfer is described in [CT-KIP-P11]. 1.3. Initiating DSKPP To initiate DSKPP: Doherty, et al. Expires July 28, 2008 [Page 10] Internet-Draft DSKPP January 2008 1. A server may first send a DSKPP trigger message to a client application (e.g., in response to a user browsing to a Web site that requires a symmetric key for authentication), although this step is optional. 2. A client application calls on the DSKPP client to send a symmetric key request to a DSKPP server, thus beginning a DSKPP protocol run. One of the following actions may be used to contact a DSKPP server: 1. A user may indicate how the DSKPP client is to contact a certain DSKPP server during a browsing session. 2. A DSKPP client may be pre-configured to contact a certain DSKPP server. 3. A user may be informed out-of-band about the location of the DSKPP server. Once the location of the DSKPP server is known, the DSKPP client and the DSKPP server engage in a 4-pass or 2-pass protocol. 1.4. Determining Which Protocol Variant to Use The four-pass and two-pass protocols are appropriate in different deployment scenarios, as described in the sub-sections below. 1.4.1. Criteria for Using the Four-Pass Protocol The four-pass protocol is needed under one or more of the following conditions: o The cryptographic module is not pre-populated with a transport key, nor hosted on a pre-keyed device (e.g., a SIM card), nor has a keypad that can be used for entering a passphrase (such as present on a mobile phone). o The hardware device will be used within multiple security domains, which means that each domain will need to provision its own symmetric key. However, the cryptographic module does not have a transport key, or other type of key that can be used with multiple provisioning servers. o A cryptographic module does not have private-key capabilities. o When the system provides a single point for exposing key material. This risk can be mitigated by ensuring that both parties contribute entropy to the key, such as with key agreement. o A consumer of the protocol requires algorithm agility, esp. the ability to negotiate which encryption mechanisms and key types are used during a protocol run. Doherty, et al. Expires July 28, 2008 [Page 11] Internet-Draft DSKPP January 2008 1.4.2. Criteria for Using the Two-Pass Protocol The two-pass protocol is needed under one or more of the following conditions: o A device is not able to support near real-time communications. o Pre-existing (i.e., legacy) keys must be provisioned to the cryptographic module. o The cryptographic module has a transport key and is capable of performing private-key operations. o The cryptographic module has a pre-shared key (e.g., a mobile phone with a SIM card).\ o The cryptographic module has a keypad in which a user may enter a passphrase, useful for deriving a key-wrapping key for distribution of key material. o A consumer of the protocol requires algorithm agility, esp. the ability to negotiate which encryption mechanisms and key types are used during a protocol run. o Workflow dictates that an approval process is required as part of the protocol run (e.g., for user authorization). o Near real-time communication between the client and server is not possible. 2. Terminology 2.1. Key Words The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. 2.2. Definitions Authentication Code (AC): Client Authentication Code comprised of a string of numeric characters known to the device and the server and containing an identifier and a password Authentication Data (AD): Client Authentication Data that may be derived from the Authentication Code (AC) Cryptographic Module: A component of an application, which enables symmetric key cryptographic functionality Doherty, et al. Expires July 28, 2008 [Page 12] Internet-Draft DSKPP January 2008 CryptoModule ID: A unique identifier for an instance of the cryptographic module Device: A physical piece of hardware or software framework that hosts symmetric key cryptographic modules Device ID (DeviceID): A unique identifier for the device DSKPP Client: Manages communication between the symmetric key cryptographic module and the DSKPP server DSKPP Server: The symmetric key provisioning server that participates in the DSKPP protocol run DSKPP Server ID (ServerID): The unique identifier of a DSKPP server Key Container (KC): An object that encapsulates a symmetric key and its configuration data Key Container Header (KCH): Information about the Key Container, useful for two-pass DSKPP, e.g., the ServerID and KPM Key ID (KeyID): A unique identifier for the symmetric key Key Protection Method (KPM): The key protection profile used during two-pass DSKPP Key Protection Method List (KPML): The list of key protection methods supported by a cryptographic module Key Type: The type of symmetric key cryptographic methods for which the key will be used (e.g., OATH HOTP or RSA SecurID authentication, AES encryption, etc.) Security Attribute List (SAL): A payload that contains the DSKPP version, DSKPP variation (four- or two-pass), key container formats, key types, and cryptographic algorithms that the cryptographic module is capable of supporting Security Context (SC): A payload that contains the DSKPP version, DSKPP variation (four- or two-pass), key container format, key type, and cryptographic algorithms relevant to the current protocol run Doherty, et al. Expires July 28, 2008 [Page 13] Internet-Draft DSKPP January 2008 User: The person or client to whom devices are issued User ID: A unique identifier for the user or client 2.3. Notation || String concatenation [x] Optional element x A ^ B Exclusive-OR operation on strings A and B (where A and B are of equal length) A typographical convention used in the body of the text DSKPP-PRF(k,x,l) A keyed psuedo-random function (see Section 3.4) E(k,m) Encryption of m with the key k K Key used to encrypt R_C (either K_SERVER, K_SHARED or K_DERIVED), or in MAC or DSKPP_PRF computations K_AC Secret key that is derived from the Authentication Code and used for user authentication purposes K_CLIENT Public key of the DSKPP client K_DERIVED Secret key derived from a passphrase that is known to both the DSKPP client or user and the DSKPP server K_MAC Secret key used for key confirmation and server authentication purposes, and generated in DSKPP K_MAC' A second secret key used for server authentication purposes in 2-pass DSKPP K_SERVER Public key of the DSKPP server K_SHARED Secret key shared between the DSKPP client and the DSKPP server Doherty, et al. Expires July 28, 2008 [Page 14] Internet-Draft DSKPP January 2008 K_TOKEN Secret key used for cryptographic module computations, and generated in DSKPP R Pseudorandom value chosen by the DSKPP client and used for MAC computations R_C Pseudorandom value chosen by the DSKPP client and used as input to the generation of K_TOKEN R_S Pseudorandom value chosen by the DSKPP server and used as input to the generation of K_TOKEN R_TRIGGER Pseudorandom value chosen by the DSKPP server and used as input in a trigger message. URL_S Server address as a URL 2.4. Abbreviations AC Authentication Code AD Authentication Data DSKPP Dynamic Symmetric Key Provisioning Protocol HTTP Hypertext Transfer Protocol KC Key Container KCH Key Container Header KPM Key Protection Method KPML Key Protection Method List MAC Message Authentication Code PC Personal Computer PDU Protocol Data Unit PKCS Public-Key Cryptography Standards PRF Pseudo-Random Function PSKC Portable Symmetric Key Container SAL Security Attribute List (see Section 2.2) SC Security Context (see Section 2.2) TLS Transport Layer Security URL Uniform Resource Locator USB Universal Serial Bus XML eXtensible Markup Language 3. DSKPP Protocol Details DSKPP enables symmetric key provisioning between a DSKPP server and DSKPP client. The DSKPP protocol supports the request and response messages shown in Figure 2. These messages are described below. Doherty, et al. Expires July 28, 2008 [Page 15] Internet-Draft DSKPP January 2008 +---------------+ +---------------+ | | | | | DSKPP Client | | DSKPP Server | | | | | +---------------+ +---------------+ | | | [ <--------- --------- ] | | | | ------- -------> | | (Applicable to 4- and 2-pass) | | | | <------ -------- | | (Applicable to 4-pass only) | | | | ------- -------> | | (Applicable to 4-pass only) | | | | <---- ------- | | (Applicable to 4- and 2-pass) | | | Figure 2: The DSKPP protocol (with OPTIONAL preceding trigger) []: A DSKPP server may initiate the DSKPP protocol by sending a message. For example, this message may be sent in response to a user requesting a symmetric key in a browsing session. The trigger message always contains a nonce to allow the server to couple the trigger with a later request. : With this request, a DSKPP client initiates contact with the DSKPP server, indicating which protocol versions and variations (four-pass or two-pass), key types, encryption and MAC algorithms that it supports. In addition, the request may include client authentication data that the DSKPP server uses to verify proof-of-possession of the device. : Upon receiving a request, the DSKPP server uses the response to specify which protocol version and variation, key type, encryption algorithm, and MAC algorithm that will be used by the DSKPP server and DSKPP client during the protocol run. The decision of which variation, key type, and cryptographic algorithms to pick is policy- and implementation-dependent and therefore outside the scope of this document. The response includes the DSKPP server's random nonce, R_S. The response also consists of information Doherty, et al. Expires July 28, 2008 [Page 16] Internet-Draft DSKPP January 2008 about either a shared secret key, or its own public key, that the DSKPP client uses when sending its protected random nonce, R_C, in the request (see below). Optionally, the DSKPP server may provide a MAC that the DSKPP client may use for server authentication. : With this request, a DSKPP client and DSKPP server securely exchange protected data, e.g., the protected random nonce R_C. In addition, the request may include client authentication data that the DSKPP server uses to verify proof- of-possession of the device. : The response is a confirmation message that includes a key container that holds configuration data, and may also contain protected key material (this depends on the protocol variation, as discussed below). Optionally, the DSKPP server may provide a MAC that the DSKPP client may use for server authentication. 3.1. Four-Pass Protocol Usage This section describes the message flow and methods that comprise the four-pass protocol variant. 3.1.1. Message Flow The four-pass protocol flow consists of two message exchanges: 1: Pass 1 = , Pass 2 = 2: Pass 3 = , Pass 4 = The first pair of messages negotiate cryptographic algorithms and exchange nonces. The second pair of messages establishes a symmetric key using mutually authenticated key agreement. The DSKPP server MUST ensure that a generated key is associated with the correct cryptographic module, and if applicable, the correct user. To do this, the DSKPP server MAY couple an initial user authentication to the DSKPP execution using one of the mechanisms described in Section 3.3. The purpose and content of each message are described below, including the optional . Doherty, et al. Expires July 28, 2008 [Page 17] Internet-Draft DSKPP January 2008 DSKPP Client DSKPP Server ------------ ------------ [<---] R_TRIGGER, [DeviceID], [KeyID], [URL_S] The DSKPP server optionally sends a message to the DSKPP client. The trigger message MUST contain a nonce, R_TRIGGER, to allow the server to couple the trigger with a later request. MAY include DeviceID to allow the client to select the device with which it will communicate. The DeviceID MAY also be used later to authenticate the client (see Section 3.3.1). In the case of key renewal, MAY include the identifier for the key, KeyID, that is being replaced. Finally, the trigger MAY contain a URL for the DSKP client to use when contacting the DSKPP server. DSKPP Client DSKPP Server ------------ ------------ SAL, [R_TRIGGER], [DeviceID], [KeyID] ---> The DSKPP client sends a message to the DSKPP server. This message MUST contain a Security Attribute List (SAL), identifying which DSKPP versions, protocol variations (in this case "four-pass"), key container formats, key types, encryption and MAC algorithms that the client supports. In addition, if a trigger message preceded , then it passes the parameters received in back to the DSKPP Server. In particular, it MUST include R_TRIGGER so that the DSKPP server can associate the client with the trigger message, and SHOULD include DeviceID and KeyID. DSKPP Client DSKPP Server ------------ ------------ <--- SC, R_S, [K], [MAC] The DSKPP server responds to the DSKPP client with a message, whose content MUST include a Security Context (SC). The client will use the SC to select the DSKPP version and variation (e.g., four-pass), type of key to generate, and cryptographic algorithms that it will use for the remainder of the protocol run. MUST also include the server's random nonce, R_S, whose length may depend on the selected key type. In addition, the message MAY provide K, which represents its own public key (K_SERVER) or information about a shared secret key (K_SHARED) to use for encrypting the cryptographic module's random nonce (see description of below). Optionally, MAY include a MAC that the Doherty, et al. Expires July 28, 2008 [Page 18] Internet-Draft DSKPP January 2008 DSKPP client can use for server authentication in the case of key renewal (Section 3.1.3.1 describes how to calculate the MAC). DSKPP Client DSKPP Server ------------ ------------ E(K,R_C), [AD] ---> Based on the Security Context (SC) provided in the message, the cryptographic module generates a random nonce, R_C. The length of the nonce R_C will depend on the selected key type. The cryptographic module encrypts R_C using the selected encryption algorithm and with a key, K, that is either the DSKPP server's public key, K_SERVER, or a shared secret key, K_SHARED, as indicated by the DSKPP server. Note: If K is equivalent to K_SERVER, then the cryptographic module SHOULD verify the server's certificate before using it to encrypt R_C in accordance with [RFC3280]. Note: If successful execution of the protocol will result in the replacement of an existing key with a newly generated one, the DSKPP client MUST verify the MAC provided in the message. The DSKPP client MUST terminate the DSKPP session if the MAC does not verify, and MUST delete any nonces, keys, and/or secrets associated with the failed run. The DSKPP client MUST send the encrypted random nonce to the DSKPP server in a message, and MAY include client Authentication Data (AD), such as a MAC derived from an authentication code and R_C (refer to Section 3.3.2). Finally, the cryptographic module calculates and stores a symmetric key, K_TOKEN, of the key type specified in the SC received in (refer to Section 3.1.2.2. for a description of how K_TOKEN is generated). DSKPP Client DSKPP Server ------------ ------------ <--- KC, MAC If Authentication Data (AD) was received in the message, then the DSKPP server MUST authenticate the user in accordance with Section 3.3.2. If authentication fails, then DSKPP server MUST abort. Otherwise, the DSKPP server decrypts R_C, calculates K_TOKEN from the combination of the two random nonces R_S and R_C, the encryption key K, and possibly some other data, using the DSKPP-PRF function defined in Section 3.4. The server then associates K_TOKEN with the cryptographic module in a server-side data store. The intent is that the data store later on will be used Doherty, et al. Expires July 28, 2008 [Page 19] Internet-Draft DSKPP January 2008 by some service that needs to verify or decrypt data produced by the cryptographic module and the key. Once the association has been made, the DSKPP server sends a confirmation message to the DSKPP client called . The confirmation message MUST include a Key Container (KC) that holds an identifier for the generated key (but not the key itself) and additional configuration information, e.g., the identity of the DSKPP server. The default symmetric key container format is based on the Portable Symmetric Key Container (PSKC) defined in [PSKC]. Alternative formats MAY include PKCS#12 [PKCS-12] or PKCS#5 XML [PKCS-5-XML] format. In addition to a Key Container, MUST also include a MAC that the DSKPP client will use to authenticate the message before commiting K_TOKEN. After receiving a message with Status = "Success", the DSKPP client MUST verify the MAC. The DSKPP client MUST terminate the DSKPP session if the MAC does not verify, and MUST, in this case, also delete any nonces, keys, and/or secrets associated with the failed run of the protocol. If has Status = "Success" and the MAC was verified, then the DSKPP client MUST associate the provided key container with the generated key K_TOKEN, and store this data permanently. After this operation, it MUST NOT be possible to overwrite the key unless knowledge of an authorizing key is proven through a MAC on a later (and ) message. 3.1.2. Generation of Symmetric Keys for Cryptographic Modules With 4-pass DSKPP, the symmetric key that is the target of provisioning, is generated on-the-fly without being transferred between the DSKPP client and DSKPP server. A sample data flow depicting how this works followed by computational information are provided in the subsections below. 3.1.2.1. Data Flow A sample data flow showing key generation during the 4-pass protocol is shown in Figure 8. Doherty, et al. Expires July 28, 2008 [Page 20] Internet-Draft DSKPP January 2008 +----------------------+ +-------+ +----------------------+ | +------------+ | | | | | | | Server key | | | | | | | +<-| Public |------>------------->-------------+---------+ | | | | Private | | | | | | | | | | +------------+ | | | | | | | | | | | | | | | | | | V V | | | | V V | | | +---------+ | | | | +---------+ | | | | | Decrypt |<-------<-------------<-----------| Encrypt | | | | | +---------+ | | | | +---------+ | | | | | +--------+ | | | | ^ | | | | | | Server | | | | | | | | | | | | Random |--->------------->------+ +----------+ | | | | | +--------+ | | | | | | Client | | | | | | | | | | | | | Random | | | | | | | | | | | | +----------+ | | | | | | | | | | | | | | | | V V | | | | V V | | | | +------------+ | | | | +------------+ | | | +-->| DSKPP PRF | | | | | | DSKPP PRF |<----+ | | +------------+ | | | | +------------+ | | | | | | | | | | V | | | | V | | +-------+ | | | | +-------+ | | | Key | | | | | | Key | | | +-------+ | | | | +-------+ | | +-------+ | | | | +-------+ | | |Key Id |-------->------------->------|Key Id | | | +-------+ | | | | +-------+ | +----------------------+ +-------+ +----------------------+ DSKPP Server DSKPP Client DSKPP Client (PC Host) (cryptographic module) Figure 8: Principal data flow for DSKPP key generation - using public server key Note: Conceptually, although R_C is one pseudorandom string, it may be viewed as consisting of two components, R_C1 and R_C2, where R_C1 is generated during the protocol run, and R_C2 can be pre-generated and loaded on the cryptographic module before the device is issued to the user. In that case, the latter string, R_C2, SHOULD be unique for each cryptographic module. The inclusion of the two random nonces R_S and R_C in the key generation provides assurance to both sides (the cryptographic module and the DSKPP server) that they have contributed to the key's randomness and that the key is unique. The inclusion of the Doherty, et al. Expires July 28, 2008 [Page 21] Internet-Draft DSKPP January 2008 encryption key K ensures that no man-in-the-middle may be present, or else the cryptographic module will end up with a key different from the one stored by the legitimate DSKPP server. Note: A man-in-the-middle (in the form of corrupt client software or a mistakenly contacted server) may present his own public key to the cryptographic module. This will enable the attacker to learn the client's version of K_TOKEN. However, the attacker is not able to persuade the legitimate server to derive the same value for K_TOKEN, since K_TOKEN is a function of the public key involved, and the attacker's public key must be different than the correct server's (or else the attacker would not be able to decrypt the information received from the client). Therefore, once the attacker is no longer "in the middle," the client and server will detect that they are "out of sync" when they try to use their keys. In the case of encrypting R_C with K_SERVER, it is therefore important to verify that K_SERVER really is the legitimate server's key. One way to do this is to independently validate a newly generated K_TOKEN against some validation service at the server (e.g. by using a connection independent from the one used for the key generation). 3.1.2.2. Computing the Symmetric Key In DSKPP, keys are generated using the DSKPP-PRF function defined in Section 3.4, a secret random value R_C chosen by the DSKPP client, a random value R_S chosen by the DSKPP server, and the key K used to encrypt R_C. The input parameter s of DSKPP-PRF is set to the concatenation of the (ASCII) string "Key generation", K, and R_S, and the input parameter dsLen is set to the desired length of the key, K_TOKEN (the length of K_TOKEN is given by the key's type): dsLen = (desired length of K_TOKEN) K_TOKEN = DSKPP-PRF (R_C, "Key generation" || K || R_S, dsLen) When computing K_TOKEN above, the output of DSKPP-PRF MAY be subject to an algorithm-dependent transform before being adopted as a key of the selected type. One example of this is the need for parity in DES keys. 3.1.3. MAC Calculations 3.1.3.1. Server Authorization in the Case of Key Renewal A MAC MUST be present in the message if the DSKPP run will result in the replacement of an existing key with a new one as proof that the DSKPP server is authorized to perform the Doherty, et al. Expires July 28, 2008 [Page 22] Internet-Draft DSKPP January 2008 action. When the MAC value is used for server authentication, the value MAY be computed by using the DSKPP-PRF function of Section 3.4, in which case the input parameter s MUST be set to the concatenation of the (ASCII) string "MAC 1 computation", R (if sent by the client), and R_S, and K MUST be set to the existing MAC key K_MAC' . The input parameter dsLen MUST be set to the length of R_S: dsLen = len(R_S) MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || [R ||] R_S, dsLen) 3.1.3.2. Key Confirmation To avoid a false "Commit" message causing the cryptographic module to end up in an initialized state in which the server does not recognize the stored key, messages MUST be authenticated with a MAC. The MAC MUST be calculated using the already established MAC algorithm and MUST be computed on the (ASCII) string "MAC 2 computation" and R_C using the existing the MAC key K_MAC' (i.e., the MAC key that existed before this protocol run). If DSKPP-PRFof Section 3.4 is used as the MAC algorithm, then the input parameter s MUST consist of the concatenation of the (ASCII) string "MAC 2 computation", R_C, and dsLen as follows: dsLen = len(R_C) MAC = DSKPP-PRF (K_MAC, "MAC 2 computation" || R_C, dsLen) 3.2. Two-Pass Protocol Usage Two-pass DSKPP is essentially a transport of key material from the DSKPP server to the DSKPP client. Two-pass DSKPP supports multiple key protection methods that ensure K_TOKEN is not exposed to any other entity than the DSKPP server and the cryptographic module itself. Currently, three such key protection methods are defined (refer to Section 3.2.2), each supporting a different usage of 2-pass DSKPP: Key Transport This profile is intended for PKI-capable devices. Key transport is carried out using a public key, K_CLIENT, whose private key part resides in the cryptographic module as the transport key. Doherty, et al. Expires July 28, 2008 [Page 23] Internet-Draft DSKPP January 2008 Key Wrap This profile is ideal for pre-keyed devices, e.g., SIM cards. Key wrap is carried out using a symmetric key- wrapping key, K_SHARED, which is known in advance by both the cryptographic module and the DSKPP server. Passphrase-Based Key Wrap This profile is a variation of the Key Wrap Profile. It is applicable to constrained devices with keypads, e.g., mobile phones. Key wrap is carried out using a passphrase-derived key-wrapping key, K_DERIVED, which is known in advance by both the cryptographic module and DSKPP server. This section describes the message flow and methods that comprise the two-pass protocol variant. 3.2.1. Message Flow The two-pass protocol flow consists of one exchange: 1: Pass 1 = , Pass 2 = The client's initial message is directly followed by a message (unlike the four-pass variant, there is no exchange of the and messages). However, as the two-pass variation of DSKPP consists of one round trip to the server, the client is still able to include its random nonce, R_C, algorithm preferences and supported key types in the message. Note that by including R_C in , the DSKPP client is able to ensure the server is alive before "committing" the key. To ensure that a generated key K_TOKEN ends up associated with the correct cryptographic module and user, the DSKPP server MAY couple an initial user authentication to the DSKPP execution using one of the mechanisms described in Section 3.3. Whatever the mechanism, the DSKPP server MUST ensure that a generated key is associated with the correct cryptographic module, and if applicable, the correct user. The purpose and content of each message are described below, including the optional . Doherty, et al. Expires July 28, 2008 [Page 24] Internet-Draft DSKPP January 2008 DSKPP Client DSKPP Server ------------ ------------ [<---] R_TRIGGER, [DeviceID], [KeyID], [URL_S] The DSKPP server optionally sends a message to the DSKPP client. The trigger message MUST contain a nonce, R_TRIGGER, to allow the server to couple the trigger with a later request. MAY include DeviceID to allow the client to select the device with which it will communicate. In the case of key renewal, SHOULD include the identifier for the key, KeyID, that is being replaced. Finally, the trigger MAY contain a URL for the DSKP client to use when contacting the DSKPP server. DSKPP Client DSKPP Server ------------ ------------ R_C, SAL, KPML, [AD], [R_TRIGGER], [DeviceID], [KeyID] ---> The DSKPP client sends a message to the DSKPP server. MUST include client nonce, R_C, and a Security Attribute List (SAL), identifying which DSKPP versions, protocol variations (in this case "two-pass"), key container formats, key types, encryption and MAC algorithms that the client supports. Unlike 4-pass DSKPP, the 2-pass DSKPP client uses the message to declare the list of Key Protection Methods (KPML) it supports, providing required payload information in accordance with Section 3.2.2. Optionally, the message MAY include client Authentication Data (AD), such as a MAC derived from an authentication code and R_C (refer to Section 3.3.2). In addition, if a trigger message preceded , then it passes the parameters received in back to the DSKPP Server. In particular, it MUST include R_TRIGGER so that the DSKPP server can associate the client with the trigger message, and SHOULD include DeviceID and KeyID. DSKPP Client DSKPP Server ------------ ------------ <--- KCH, KC, E(K,K_PROV), MAC, AD If Authentication Data (AD) was received, then the DSKPP server MUST authenticate the user in accordance with Section 3.3.2. If authentication fails, then DSKPP server MUST abort. Otherwise, the DSKPP server generates a key K_PROV from which two keys, K_TOKEN and K_MAC, are derived. (Alternatively, the key K_PROV may have been Doherty, et al. Expires July 28, 2008 [Page 25] Internet-Draft DSKPP January 2008 pre-generated as described in Section 1.1.1. The DSKPP server selects a Key Protection Method (KPM) and applies it to K_PROV in accordance with Section 3.2.2. The server then associates K_TOKEN with the cryptographic module in a server-side data store. The intent is that the data store later will be used by some service that needs to verify or decrypt data produced by the cryptographic module and the key. Once the association has been made, the DSKPP server sends a confirmation message to the DSKPP client called . For two-pass DSKPP, the confirmation message MUST include a Key Container Header (KCH) that contains the DSKPP Server's ID and KPM. The ServerID is used for authentication purposes, and the KPM informs the DSKPP client of the security context in which it will operate. In addition to the KCH, the confirmation message MUST include the Key Container (KC) that holds the KeyID, K_PROV from which K_TOKEN and K_MAC are derived, and additional configuration information. The default symmetric key container format is based on the Portable Symmetric Key Container (PSKC) defined in [PSKC]. Alternative formats MAY include PKCS#12 [PKCS-12] or PKCS#5 XML [PKCS-5-XML]. Finally, MUST include two MACs (MAC and AD) whose values are calculated with contribution from the client nonce, R_C, provided in the message. The MAC values will allow the cryptographic module to perform key confirmation and server authentication before "commiting" the key (see Section 3.2.3 for more information). After receiving a message with Status = "Success", the DSKPP client MUST verify both MAC values (MAC and AD). The DSKPP client MUST terminate the DSKPP session if either MAC does not verify, and MUST, in this case, also delete any nonces, keys, and/or secrets associated with the failed run of the protocol. If has Status = "Success" and the MACs were verified, then the DSKPP client MUST extract the key data from the provided key container, and store data locally. After this operation, it MUST NOT be possible to overwrite the key unless knowledge of an authorizing key is proven through a MAC on a later message. 3.2.2. Key Protection Profiles This section introduces three profiles of two-pass DSKPP for key protection. Further profiles MAY be defined by external entities or through the IETF process. Doherty, et al. Expires July 28, 2008 [Page 26] Internet-Draft DSKPP January 2008 3.2.2.1. Key Transport Profile This profile initializes the cryptographic module with a symmetric key, K_TOKEN, through key transport and key derivation. The key transport is carried out using a public key, K_CLIENT, whose private key part resides in the cryptographic module as the transport key. A key K_PROV from which two keys, K_TOKEN and K_MAC are derived MUST be transported. This profile MUST be identified with the following URN: urn:ietf:params:xml:schema:keyprov:protocol#transport In the two-pass version of DSKPP, the client MUST send a payload associated with this key protection method. The payload MUST be of type ds:KeyInfoType ([XMLDSIG]), and only those choices of the ds: KeyInfoType that identify a public key are allowed. The ds: X509Certificate option of the ds:X509Data alternative is RECOMMENDED when the public key corresponding to the private key on the cryptographic module has been certified. The server payload associated with this key protection method MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those encryption methods utilizing a public key that are supported by the DSKPP client (as indicated in the element of the message in the case of 2-pass DSKPP) are allowed as values for the element. Further, in the case of 2-pass DSKPP, the element MUST contain the same value (i.e. identify the same public key) as the of the corresponding supported key protection method in the message that triggered the response. The element MAY be present, but MUST, when present, contain the same value as the element of the message. The Type attribute of the xenc: EncryptedKeyType MUST be present and MUST identify the type of the wrapped key. The type MUST be one of the types supported by the DSKPP client (as reported in the of the preceding message in the case of 2-pass DSKPP). The transported key MUST consist of two parts of equal length. The first half constitutes K_MAC and the second half constitutes K_TOKEN. The length of K_TOKEN (and hence also the length of K_MAC) is determined by the type of K_TOKEN. DSKPP servers and cryptographic modules supporting this profile MUST support the http://www.w3.org/2001/04/xmlenc#rsa-1_5 key-wrapping mechanism defined in [XMLENC]. When this profile is used, the MacAlgorithm attribute of the element of the message MUST be present and Doherty, et al. Expires July 28, 2008 [Page 27] Internet-Draft DSKPP January 2008 MUST identify the selected MAC algorithm. The selected MAC algorithm MUST be one of the MAC algorithms supported by the DSKPP client (as indicated in the element of the message in the case of 2-pass DSKPP). The MAC MUST be calculated as described in Section 3.2 for Two-Pass DSKPP. In addition, DSKPP servers MUST include the AuthenticationDataType element in their messages whenever a successful protocol run will result in an existing K_TOKEN being replaced. 3.2.2.2. Key Wrap Profile This profile initializes the cryptographic module with a symmetric key, K_TOKEN, through key wrap and key derivation. The key wrap MUST be carried out using a (symmetric) key-wrapping key, K_SHARED, known in advance by both the cryptographic module and the DSKPP server. A key K_PROV from which two keys, K_TOKEN and K_MAC are derived MUST be wrapped. This profile MUST be identified with the following URI: urn:ietf:params:xml:schema:keyprov:protocol#wrap In the 2-pass version of DSKPP, the client MUST send a payload associated with this key protection method. The payload MUST be of type ds:KeyInfoType ([XMLDSIG]), and only those choices of the ds: KeyInfoType that identify a symmetric key are allowed. The ds: KeyName alternative is RECOMMENDED. The server payload associated with this key protection method MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those encryption methods utilizing a symmetric key that are supported by the DSKPP client (as indicated in the element of the message in the case of 2-pass DSKPP) are allowed as values for the element. Further, in the case of 2-pass DSKPP, the element MUST contain the same value (i.e. identify the same symmetric key) as the of the corresponding supported key protection method in the message that triggered the response. The element MAY be present, and MUST, when present, contain the same value as the element of the message. The Type attribute of the xenc: EncryptedKeyType MUST be present and MUST identify the type of the wrapped key. The type MUST be one of the types supported by the DSKPP client (as reported in the of the preceding message in the case of 2-pass DSKPP). The wrapped key MUST consist of two parts of equal length. The first half constitutes K_MAC and the second half constitutes K_TOKEN. The Doherty, et al. Expires July 28, 2008 [Page 28] Internet-Draft DSKPP January 2008 length of K_TOKEN (and hence also the length of K_MAC) is determined by the type of K_TOKEN. DSKPP servers and cryptographic modules supporting this profile MUST support the http://www.w3.org/2001/04/xmlenc#kw-aes128 key-wrapping mechanism defined in [XMLENC]. When this profile is used, the MacAlgorithm attribute of the element of the message MUST be present and MUST identify the selected MAC algorithm. The selected MAC algorithm MUST be one of the MAC algorithms supported by the DSKPP client (as indicated in the element of the message in the case of 2-pass DSKPP). The MAC MUST be calculated as described in Section 3.2. In addition, DSKPP servers MUST include the AuthenticationDataType element in their messages whenever a successful protocol run will result in an existing K_TOKEN being replaced. 3.2.2.3. Passphrase-Based Key Wrap Profile This profile is a variation of the key wrap profile. It initializes the cryptographic module with a symmetric key, K_TOKEN, through key wrap and key derivation, using a passphrase-derived key-wrapping key, K_DERIVED. The passphrase is known in advance by both the device user and the DSKPP server. To preserve the property of not exposing K_TOKEN to any other entity than the DSKPP server and the cryptographic module itself, the method SHOULD be employed only when the device contains facilities (e.g. a keypad) for direct entry of the passphrase. A key K_PROV from which two keys, K_TOKEN and K_MAC are derived MUST be wrapped. This profile MUST be identified with the following URI: urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap In the 2-pass version of DSKPP, the client MUST send a payload associated with this key protection method. The payload MUST be of type ds:KeyInfoType ([XMLDSIG]). The ds:KeyName option MUST be used and the key name MUST identify the passphrase that will be used by the server to generate the key-wrapping key. As an example, the identifier could be a user identifier or a registration identifier issued by the server to the user during a session preceding the DSKPP protocol run. The server payload associated with this key protection method MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those encryption methods utilizing a passphrase to derive the key-wrapping key that Doherty, et al. Expires July 28, 2008 [Page 29] Internet-Draft DSKPP January 2008 are supported by the DSKPP client (as indicated in the element of the message in the case of 2-pass DSKPP) are allowed as values for the element. Further, in the case of 2-pass DSKPP, the element MUST contain the same value (i.e. identify the same passphrase) as the of the corresponding supported key protection method in the message that triggered the response. The element MAY be present, and MUST, when present, contain the same value as the element of the message. The Type attribute of the xenc:EncryptedKeyType MUST be present and MUST identify the type of the wrapped key. The type MUST be one of the types supported by the DSKPP client (as reported in the of the preceding message in the case of 2-pass DSKPP). The wrapped key MUST consist of two parts of equal length. The first half constitutes K_MAC and the second half constitutes K_TOKEN. The length of K_TOKEN (and hence also the length of K_MAC) is determined by the type of K_TOKEN. DSKPP servers and cryptographic modules supporting this profile MUST support the PBES2 password based encryption scheme defined in [PKCS-5] (and identified as http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2 in [PKCS-5-XML]), the PBKDF2 passphrase-based key derivation function also defined in [PKCS-5] (and identified as http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbkdf2 in [PKCS-5-XML]), and the http://www.w3.org/2001/04/xmlenc#kw-aes128 key-wrapping mechanism defined in [XMLENC]. When this profile is used, the MacAlgorithm attribute of the element of the message MUST be present and MUST identify the selected MAC algorithm. The selected MAC algorithm MUST be one of the MAC algorithms supported by the DSKPP client (as indicated in the element of the message in the case of 2-pass DSKPP). The MAC MUST be calculated as described in Section 3.2. In addition, DSKPP servers MUST include the AuthenticationDataType element in their messages whenever a successful protocol run will result in an existing K_TOKEN being replaced. 3.2.3. MAC Calculations 3.2.3.1. Key Confirmation In two-pass DSKPP, the client MUST include a nonce R in the message. Further, the DSKPP server MUST include Doherty, et al. Expires July 28, 2008 [Page 30] Internet-Draft DSKPP January 2008 its identifier, ServerID, in the message (via the Key Container). The MAC value in the message MUST be computed on the (ASCII) string "MAC 1 computation", the server identifier ServerID, and R using a MAC key K_MAC. This key MUST be provided together with K_TOKEN to the cryptographic module. If DSKPP-PRF is used as the MAC algorithm, then the input parameter s MUST consist of the concatenation of the (ASCII) string "MAC 1 computation" and R, and the parameter dsLen MUST be set to the length of R: dsLen = len(R) MAC = DSKPP-PRF (K_MAC, "MAC 1 computation" || ServerID || R, dsLen) 3.2.3.2. Server Authorization A MAC MUST be present in the message as proof that the DSKPP server is authorized to provide a new key to the cryptographic module. In 2-pass DSKPP, servers include this MAC value in the AuthenticationDataType element of . The MAC value in the AuthenticationDataType element MUST be computed on the (ASCII) string "MAC 1 computation", the server identifier ServerID, and R, using the existing MAC key K_MAC' (the MAC key that existed before this protocol run). The MAC algorithm MUST be the same as the algorithm used for key confirmation purposes. If DSKPP-PRF is used as the MAC algorithm, then the input parameter s MUST consist of the concatenation of the (ASCII) string "MAC 1 computation" ServerID, and R. The parameter dsLen MUST be set to at least 16 (i.e. the length of the MAC MUST be at least 16 octets): dsLen >= 16 MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || ServerID || R, dsLen) 3.3. User Authentication The DSKPP server MUST ensure that a generated key is associated with the correct cryptographic module, and if applicable, the correct user. If the user has not been authenticated by some out-of-band means, then the user SHOULD be authenticated within the DSKPP. For a further discussion of this, and threats related to man-in-the-middle attacks in this context, see Section 9. When relying on DSKPP for user authentication, the DSKPP server Doherty, et al. Expires July 28, 2008 [Page 31] Internet-Draft DSKPP January 2008 SHOULD explicitly: o Bind the user to the device (see Section 3.3.1, below) o Rely on client-provided Authentication Data (AD) to verify that a legitimate user is behind the wheel (see Section 3.3.2, below) NOTE: Device authentication can be handled implicitly by either relying on the device certificate for wrapping the key in the two- pass DSKPP Key Wrap Profile (seeSection 3.2.2), or by coupling the device certificate with the Authentication Code (see below). 3.3.1. Device Identifier The DSKPP server MAY be pre-configured with a unique device identifier corresponding to a particular cryptographic module. The DSKPP server MAY then include this identifier in the DSKPP initialization trigger, in which case the DSKPP client MUST include it in its message(s) to the DSKPP server for authentication. Note that it is also legitimate for a DSKPP client to initiate the DSKPP protocol run without having received an initialization message from a server, but in this case any provided device identifier MUST NOT be accepted by the DSKPP server unless the server has access to a unique key for the identified device and that key will be used in the protocol. 3.3.2. Authentication Data As described in the message flows above (see Section 3.1.1 and Section 3.2.1), the DSKPP client MAY include Authentication Data (AD) in its request(s). Note that AD MAY be omitted if client certificate authentication has been provided by the transport channel such as TLS. Nonetheless, when AD is provided, the DSKPP server MUST verify the data before continuing with the protocol run. The DSKPP client generates AD through derivation of an Authentication Code (AC) as follows (see Section 3.3.2.2 for details): AD = HMAC(AC, K) AC is a one-time use value that is a special form of a shared secret between a user and the DSKPP server. This secret MUST be made available to the client before or during DSKPP initiation. Two ways in which this MAY be done are: Doherty, et al. Expires July 28, 2008 [Page 32] Internet-Draft DSKPP January 2008 a. A key issuer may deliver an AC to the user or device in response to a key request, which the user enters into an application hosted on their device. For example, a user runs an application that is resident on their device, e.g., a mobile phone. The application cannot proceed without a new symmetric key. The user is redirected to an issuer's Web site from where the user requests a key. The issuer's Web application processes the request, and returns an AC, which then appears on the user's display. The user then invokes a symmetric key-based application hosted on the device, which asks the user to input the AC using a keypad. The application invokes the DSKPP client, providing it with the AC. b. The provisioning server may send a trigger message, , to the DSKPP client, which and set the value of the trigger nonce, R_TRIGGER, to AC. When this method is used, a transport providing privacy and integrity MUST be used to deliver the DSKPP initialization trigger from the DSKPP server to the DSKPP client, e.g. HTTPS. Note that when an issuer delegates symmetric key provisioning to a third party provisioning service provider, both client authentication and issuer authentication are required by the provisioning server. Client authentication to the issuer MAY be in-band or out-of-band as described above. The issuer acts as a proxy for the provisioning server. The issuer authenticates to the provisioning service provider either using a certificate or a pre-established secret key. A description of the AC and how it is used to derive AD is contained in the sub-sections below. 3.3.2.1. Authentication Code Format At a minimum, the AC MUST contain the following parameters: identifier: A globally unique identifier that represents the user's key request. The MAY be generated as a sequence number. password: A unique value that SHOULD be generated by the system as a random number to make AC more difficult to guess. checksum: The checksum SHOULD be calculated from the remaining digits in the AC. The Issuer MUST rely on a Tag-Length-Value (TLV) format to represent the AC, such as: Doherty, et al. Expires July 28, 2008 [Page 33] Internet-Draft DSKPP January 2008 Tag = 0x01 = password Tag = 0x02 = identifier Tag = 0x03 = checksum where one (or two) byte(s) MAY be used to indicate the L(ength) of the V(alue) field. 3.3.2.2. MAC Calculation The Authentication Data is a MAC that is derived from AC as follows (refer to Section 3.4 for a description of DSKPP-PRF in general and Appendix C for a description of DSKPP-PRF-AES): MAC = DSKPP-PRF-AES(K_AC, AC->Identifier||URL_S||R_C||[R_S], 16) In four-pass DSKPP, the cryptographic module uses R_C, R_S, and URL_S, to calculate the MAC. In two-pass DSKPP, the cryptographic module does not have access to R_S, therefore only R_C is used in combination with URL_S to produce the MAC. In either case, K_AC MAY be derived from AC>password as follows [PKCS-5]: K_AC = PBKDF2(AC->password, R_C || [K], c, 16) K MAY be one of the following: K_CLIENT: The device public key when a device certificate is available and used for key transport in 2-pass K_SHARED: The shared key between the client and the server when it is used for key wrap in two-pass or for R_C protection in four- pass K_DERIVED: When a passphrase-derived key is used for key wrap in two-pass DSKPP. Finally, c is iteration count between 10 and 1000. 3.4. The DSKPP One-Way Pseudorandom Function, DSKPP-PRF 3.4.1. Introduction All of the protocol variations depend on DSKPP-PRF. The general requirements on DSKPP-PRF are the same as on keyed hash functions: It MUST take an arbitrary length input, and be one-way and collision- free (for a definition of these terms, see, e.g., [FAQ]). Further, the DSKPP-PRF function MUST be capable of generating a variable- length output, and its output MUST be unpredictable even if other outputs for the same key are known. Doherty, et al. Expires July 28, 2008 [Page 34] Internet-Draft DSKPP January 2008 It is assumed that any realization of DSKPP-PRF takes three input parameters: A secret key k, some combination of variable data, and the desired length of the output. The combination of variable data can, without loss of generalization, be considered as a salt value (see PKCS#5 Version 2.0 [PKCS-5], Section 4), and this characterization of DSKPP-PRF SHOULD fit all actual PRF algorithms implemented by cryptographic modules. From the point of view of this specification, DSKPP-PRF is a "black-box" function that, given the inputs, generates a pseudorandom value. Separate specifications MAY define the implementation of DSKPP-PRF for various types of cryptographic modules. Appendix C contains two example realizations of DSKPP-PRF. 3.4.2. Declaration DSKPP-PRF (k, s, dsLen) Input: k secret key in octet string format s octet string of varying length consisting of variable data distinguishing the particular string being derived dsLen desired length of the output Output: DS pseudorandom string, dsLen-octets long For the purposes of this document, the secret key k MUST be at least 16 octets long. 3.5. Encryption of Pseudorandom Nonces Sent from the DSKPP Client DSKPP client random nonce(s) are either encrypted with the public key provided by the DSKPP server or by a shared secret key. For example, in the case of a public RSA key, an RSA encryption scheme from PKCS #1 [PKCS-1] MAY be used. In the case of a shared secret key, to avoid dependence on other algorithms, the DSKPP client MAY use the DSKPP-PRF function described herein with the shared secret key K_SHARED as input parameter K (in this case, K_SHARED SHOULD be used solely for this purpose), the concatenation of the (ASCII) string "Encryption" and the server's nonce R_S as input parameter s, and dsLen set to the length of R_C: dsLen = len(R_C) DS = DSKPP-PRF(K_SHARED, "Encryption" || R_S, dsLen) Doherty, et al. Expires July 28, 2008 [Page 35] Internet-Draft DSKPP January 2008 This will produce a pseudorandom string DS of length equal to R_C. Encryption of R_C MAY then be achieved by XOR-ing DS with R_C: E(DS, R_C) = DS ^ R_C The DSKPP server will then perform the reverse operation to extract R_C from E(DS, R_C). 4. DSKPP Message Formats The message formats from the DSKPP XML schema, found in Section 7, are explained in this section. Examples can be found in Appendix A. The XML format for DSKPP messages have been designed to be extensible. However, it is possible that the use of extensions will harm interoperability; therefore, any use of extensions SHOULD be carefully considered. For example, if a particular implementation relies on the presence of a proprietary extension, then it may not be able to interoperate with independent implementations that have no knowledge of this extension. 4.1. General XML Schema Requirements Some DSKPP elements rely on the parties being able to compare received values with stored values. Unless otherwise noted, all elements in this document that have the XML Schema "xs:string" type, or a type derived from it, MUST be compared using an exact binary comparison. In particular, DSKPP implementations MUST NOT depend on case-insensitive string comparisons, normalization or trimming of white space, or conversion of locale-specific formats such as numbers. Implementations that compare values that are represented using different character encodings MUST use a comparison method that returns the same result as converting both values to the Unicode character encoding, Normalization Form C [UNICODE], and then performing an exact binary comparison. No collation or sorting order for attributes or element values is defined. Therefore, DSKPP implementations MUST NOT depend on specific sorting orders for values. 4.2. Components of the Message The DSKPP server MAY initialize the DSKPP protocol by sending a message. This message MAY, e.g., be sent in response to a user requesting key initialization in a browsing session. Doherty, et al. Expires July 28, 2008 [Page 36] Internet-Draft DSKPP January 2008 The element is intended for the DSKPP client and MAY inform the DSKPP client about the identifier for the device that houses the cryptographic module to be initialized, and optionally of the identifier for the key on that module. The latter would apply to key renewal. The trigger always contains a nonce to allow the DSKPP server to couple the trigger with a later DSKPP request. Finally, the trigger MAY contain a URL to use when contacting the DSKPP server. The elements are for future extensibility. Any provided or values MUST be used by the DSKPP client in the subsequent request. The OPTIONAL element informs the DSKPP client about the characteristics of the intended cryptographic module platform, and applies in the public-key variant of DSKPP in situations when the client potentially needs to decide which one of several modules to initialize. 4.3. Components of the Request This message is the initial message sent from the DSKPP client to the DSKPP server in both variants of the DSKPP. Doherty, et al. Expires July 28, 2008 [Page 37] Internet-Draft DSKPP January 2008 The components of this message have the following meaning: o Version: (attribute inherited from the AbstractRequestType type) The highest version of this protocol the client supports. Only version one ("1.0") is currently specified. o : An identifier for the cryptographic module as defined in Section 3.3 above. The identifier MUST only be present if such shared secrets exist or if the identifier was provided by the server in a element (see Section 6.2.7). In the latter case, it MUST have the same value as the identifier provided in that element. Doherty, et al. Expires July 28, 2008 [Page 38] Internet-Draft DSKPP January 2008 o : An identifier for the key that will be overwritten if the protocol run is successful. The identifier MUST only be present if the key exists or if the identifier was provided by the server in a element, in which case, it MUST have the same value as the identifier provided in that element (see a (Section 4.2) and Section 6.2.7). o : This is the nonce R, which, when present, MUST be used by the server when calculating MAC values (see below). It is RECOMMENDED that clients include this element whenever the element is present. o : This OPTIONAL element MUST be present if and only if the DSKPP run was initialized with a message (see Section 6.2.7), and MUST, in that case, have the same value as the child of that message. A server using nonces in this way MUST verify that the nonce is valid and that any device or key identifier values provided in the message match the corresponding identifier values in the message. o : A sequence of URLs indicating the key types for which the cryptographic module is willing to generate keys through DSKPP. o : A sequence of URLs indicating the encryption algorithms supported by the cryptographic module for the purposes of DSKPP. The DSKPP client MAY indicate the same algorithm both as a supported key type and as an encryption algorithm. o : A sequence of URLs indicating the MAC algorithms supported by the cryptographic module for the purposes of DSKPP. The DSKPP client MAY indicate the same algorithm both as an encryption algorithm and as a MAC algorithm (e.g., http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes, which is defined in Appendix C). o : This OPTIONAL element is used by the DSKPP client to indicate support for four-pass or two-pass DSKPP. If two-pass support is specified, then MUST be set to nonce R in the message unless is already present. o : This OPTIONAL element is a sequence of URLs indicating the key container formats supported by the DSKPP client. If this element is not provided, then the DSKPP server MUST proceed with "http://www.ietf.org/keyprov/pskc#KeyContainer" (see [PSKC]). o : This OPTIONAL element contains data that the DSKPP client uses to authenticate the user or device to the DSKPP server. The element is set as specified in Section 3.3. o : A sequence of extensions. One extension is defined for this mesolsage in this version of DSKPP: the ClientInfoType (see Section 5). Doherty, et al. Expires July 28, 2008 [Page 39] Internet-Draft DSKPP January 2008 Some of the core elements of the message are described below. 4.3.1. The DeviceIdentifierDataType Type The DeviceIdentifierDataType type is used to uniquely identify the device that houses the cryptographic module, e.g., a mobile phone. The device identifier allows the DSKPP server to find, e.g., a pre- shared transport key for 2-pass DSKPP and/or the correct shared secret for MAC'ing purposes. The default DeviceIdentifierDataType is defined in [PSKC]. 4.3.2. The ProtocolVariantsType Type The ProtocolVariantsType type is OPTIONAL for a DSKPP client, who MAY use it to indicate the number of passes of the DSKPP protocol that it supports. The ProtocolVariantsType MAY be used to indicate support for 4-pass or 2-pass DSKPP. If the ProtocolVariantsType is not used, then the DSKPP server will proceed with ordinary 4-pass DSKPP. However, if it does not support 4-pass DSKPP, then the server MUST find a suitable two-pass variation or else the protocol run will fail. Selecting the "TwoPass" element signals client support for the 2-pass version of DSKPP, informs the server of supported two-pass key protection methods, and provides OPTIONAL payload data to the DSKPP server. The payload is sent in an opportunistic fashion, and MAY be discarded by the DSKPP server if the server does not support thekey protection method with which the payload is associated. Doherty, et al. Expires July 28, 2008 [Page 40] Internet-Draft DSKPP January 2008 The elements of this type have the following meaning: o : A two-pass key protection method supported by the DSKPP client. Multiple supported methods MAY be present, in which case they MUST be listed in order of precedence. o : An OPTIONAL payload associated with each supported key protection method. A DSKPP client that indicates support for two-pass DSKPP MUST also include the nonce R in its message (this will enable the client to verify that the DSKPP server it is communicating with is alive). 4.3.3. The KeyContainersFormatType Type The OPTIONAL KeyContainersFormatType type is a list of type-value pairs that a DSKPP client or server MAY use to define key container formats it supports. Key container formats are identified through URLs, e.g., the PSKC KeyContainer URL "http://www.ietf.org/keyprov/pskc#KeyContainer" (see [PSKC]). Doherty, et al. Expires July 28, 2008 [Page 41] Internet-Draft DSKPP January 2008 4.3.4. The AuthenticationDataType Type The OPTIONAL AuthenticationDataType type is used by DSKPP clients and server to carry authentication values in DSKPP messages. The element MAY contain a MAC derived from an authentication code as follows: a. A DSKPP client MAY include a one-time use AuthenticationCode that was given by the issuer to the user for acquiring a symmetric key. An AuthenticationCode MAY contain alphanumeric characters in addition to numeric digits depending on the device type and policy of the issuer. For example, if the device is a mobile phone, a code that the user enters on the keypad would typically be restricted to numeric digits for ease of use. An authentication code MAY be sent to the DSKPP server as MAC data calculated according to section Section 3.3.2. b. A DSKPP server MAY use the AuthenticationDataType element AuthenticationCodeMac to carry a MAC for authenticating itself to the client. For example, when a successful 2-pass DSKPP protocol run will result in an existing key being replaced, then the DSKPP server MUST include a MAC proving to the DSKPP client that the server knows the value of the key it is about to replace. Doherty, et al. Expires July 28, 2008 [Page 42] Internet-Draft DSKPP January 2008 The elements of the AuthenticationDataType type have the following meaning: o : A requester's identifier. The value MAY be a user ID, a device ID, or a keyID associated with the requester's authentication value. Ifa message was provided by the server to initiate the DSKPP protocol run, can be omitted, as the DeviceID, KeyID, and/or nonce provided in the element ought to be sufficient to identify the requester. o : An authentication MAC and additional information (e.g., MAC algorithm). This MAC MAY be derived as follows: * User Authentication: A DSKPP client MAY include a one-time use AuthenticationCode that was given by the issuer to the user for acquiring a symmetric key. An AuthenticationCode MAY contain alphanumeric characters in addition to numeric digits depending on the device type and policy of the issuer. For example, if the device is a mobile phone, a code that the user enters on the keypad would typically be restricted to numeric digits for ease of use. An authentication code MAY be sent to the DSKPP server as MAC data calculated as described in section Section 3.3.2. * Server Authorization (two-pass DSKPP only): A DSKPP server MUST include a MAC in its message as proof that the DSKPP server is authorized to provide a new key to the cryptographic module. For example, when a successful 2-pass DSKPP protocol run will result in an existing key being replaced, then the DSKPP server MUST include the AuthenticationDataType element's AuthenticationCodeMac in its message. For more information, refer to Section 3.2.3.2. Doherty, et al. Expires July 28, 2008 [Page 43] Internet-Draft DSKPP January 2008 4.4. Components of the Response (Used Only in Four-Pass DSKPP) In a four-pass exchange, this message is the first message sent from the DSKPP server to the DSKPP client (assuming a trigger message has not been sent to initiate the protocol, in which case, this message is the second message sent from the DSKPP server to the DSKPP client). It is sent upon reception of a message. The components of this message have the following meaning: o Version: (attribute inherited from the AbstractResponseType type) The version selected by the DSKPP server. MAY be lower than the version indicated by the DSKPP client, in which case, local policy at the client MUST determine whether or not to continue the session. o SessionID: (attribute inherited from the AbstractResponseType type) An identifier for this session. o Status: (attribute inherited from the AbstractResponseType type) Return code for the . If Status is not "Continue", only the Status and Version attributes will be present; otherwise, all the other element MUST be present as well. Doherty, et al. Expires July 28, 2008 [Page 44] Internet-Draft DSKPP January 2008 o : The type of the key to be generated. o : The encryption algorithm to use when protecting R_C. o : The MAC algorithm to be used by the DSKPP server. o : Information about the key to use when encrypting R_C. It will either be the server's public key (the alternative of ds:KeyInfoType) or an identifier for a shared secret key (the alternative of ds:KeyInfoType). o : The key container format type to be used by the DSKPP server. The default setting relies on the KeyContainerType element defined in "urn:ietf:params:xml:schema:keyprov:container" [PSKC]. o : The actual payload. For this version of the protocol, only one payload is defined: the pseudorandom string R_S. o : A list of server extensions. Two extensions are defined for this message in this version of DSKPP: the ClientInfoType and the ServerInfoType (see Section 5). o : The MAC MUST be present if the DSKPP run will result in the replacement of an existing symmetric key with a new one (i.e., if the element was present in the Request (Used Only in Four- Pass DSKPP) In a four-pass DSKPP exchange, this message contains the nonce R_C that was chosen by the cryptographic module, and encrypted by the negotiated encryption key and encryption algorith Doherty, et al. Expires July 28, 2008 [Page 45] Internet-Draft DSKPP January 2008 The components of this message have the following meaning: o Version: (inherited from the AbstractRequestType type) MUST be the same version as in the message. o : (attribute inherited from the AbstractResponseType type) MUST have the same value as the SessionID attribute in the received message. o : The nonce generated and encrypted by the cryptographic module. The encryption MUST be made using the selected encryption algorithm and identified key, and as specified in Section 3.4. o : The authentication data value MUST be set as specified in Section 3.3 and Section 4.3.4. o : A list of extensions. Two extensions are defined for this message in this version of DSKPP: the ClientInfoType and the ServerInfoType (see Section 5) 4.6. Components of a Response This message is the last message of the DSKPP protocol run. In a 4-pass exchange, the DSKPP server sends this message in response to a message, whereas in a 2-pass exchange, the DSKPP server sends this message in response to a message. Doherty, et al. Expires July 28, 2008 [Page 46] Internet-Draft DSKPP January 2008 The components of this message have the following meaning: o Version: (inherited from the AbstractResponseType type) The DSKPP version used in this session. o SessionID: (inherited from the AbstractResponseType type) The previously established identifier for this session. o Status: (inherited from the AbstractResponseType type) Return code for the message. If Status is not "Success", only the Status, SessionID, and Version attributes will be present (the presence of the SessionID attribute is dependent on the type of reported error); otherwise, all the other elements MUST be present as well. In this latter case, the message can be seen as a "Commit" message, instructing the cryptographic module to store the generated key and associate the given key identifier with this key. o : The key container containing symmetric key values (in the case of a 2-pass exchange) and configuration data. The default container format is based on the KeyContainerType type from PSKC, as defined in [PSKC]. o : A list of extensions chosen by the DSKPP server. For this message, this version of DSKPP defines one extension, the ClientInfoType (see Section 5). o : To avoid a false "Commit" message causing the cryptographic module to end up in an initialized state for which the server does not know the stored key, messages MUST always be authenticated with a MAC. The MAC MUST be made using the already established MAC algorithm. Doherty, et al. Expires July 28, 2008 [Page 47] Internet-Draft DSKPP January 2008 4.7. The StatusCode Type The StatusCode type enumerates all possible return codes: Upon transmission or receipt of a message for which the Status attribute's value is not "Success" or "Continue", the default behavior, unless explicitly stated otherwise below, is that both the DSKPP server and the DSKPP client MUST immediately terminate the DSKPP session. DSKPP servers and DSKPP clients MUST delete any secret values generated as a result of failed runs of the DSKPP protocol. Session identifiers MAY be retained from successful or failed protocol runs for replay detection purposes, but such retained identifiers MUST NOT be reused for subsequent runs of the protocol. When possible, the DSKPP client SHOULD present an appropriate error message to the user. These status codes are valid in all DSKPP Response messages unless explicitly stated otherwise: o "Continue" indicates that the DSKPP server is ready for a subsequent request from the DSKPP client. It cannot be sent in the server's final message. o "Success" indicates successful completion of the DSKPP session. It can only be sent in the server's final message. Doherty, et al. Expires July 28, 2008 [Page 48] Internet-Draft DSKPP January 2008 o "Abort" indicates that the DSKPP server rejected the DSKPP client's request for unspecified reasons. o "AccessDenied" indicates that the DSKPP client is not authorized to contact this DSKPP server. o "MalformedRequest" indicates that the DSKPP server failed to parse the DSKPP client's request. o "UnknownRequest" indicates that the DSKPP client made a request that is unknown to the DSKPP server. o "UnknownCriticalExtension" indicates that a critical DSKPP extension (see below) used by the DSKPP client was not supported or recognized by the DSKPP server. o "UnsupportedVersion" indicates that the DSKPP client used a DSKPP protocol version not supported by the DSKPP server. This error is only valid in the DSKPP server's first response message. o "NoSupportedKeyTypes" indicates that the DSKPP client only suggested key types that are not supported by the DSKPP server. This error is only valid in the DSKPP server's first response message. o "NoSupportedEncryptionAlgorithms" indicates that the DSKPP client only suggested encryption algorithms that are not supported by the DSKPP server. This error is only valid in the DSKPP server's first response message. o "NoSupportedMacAlgorithms" indicates that the DSKPP client only suggested MAC algorithms that are not supported by the DSKPP server. This error is only valid in the DSKPP server's first response message. o "NoProtocolVariants" indicates that the DSKPP client only suggested a protocol variation (either 2-pass or 4-pass) that is not supported by the DSKPP server. This error is only valid in the DSKPP server's first response message. o "NoSupportedKeyContainers" indicates that the DSKPP client only suggested key container formats that are not supported by the DSKPP server. This error is only valid in the DSKPP server's first response message. o "AuthenticationDataMissing" indicates that the DSKPP client didn't provide authentication data that the DSKPP server required. o "AuthenticationDataInvalid" indicates that the DSKPP client supplied user authentication data that the DSKPP server failed to validate. o "InitializationFailed" indicates that the DSKPP server could not generate a valid key given the provided data. When this status code is received, the DSKPP client SHOULD try to restart DSKPP, as it is possible that a new run will succeed. o "ProvisioningPeriodExpired" indicates that the provisioning period set by the DSKPP server has expired. When the status code is received, the DSKPP client SHOULD report the reason for key initialization failure to the user and the user MUST register with the DSKPP server to initialize a new key. Doherty, et al. Expires July 28, 2008 [Page 49] Internet-Draft DSKPP January 2008 5. Extensibility 5.1. The ClientInfoType Type Present in a or a message, the OPTIONAL ClientInfoType extension contains DSKPP client-specific information. DSKPP servers MUST support this extension. DSKPP servers MUST NOT attempt to interpret the data it carries and, if received, MUST include it unmodified in the current protocol run's next server response. Servers need not retain the ClientInfoType's data after that response has been generated. 5.2. The ServerInfoType Type When present, the OPTIONAL ServerInfoType extension contains DSKPP server-specific information. This extension is only valid in messages for which Status = "Continue". DSKPP clients MUST support this extension. DSKPP clients MUST NOT attempt to interpret the data it carries and, if received, MUST include it unmodified in the current protocol run's next client request (i.e., the message). DSKPP clients need not retain the ServerInfoType's data after that request has been generated. This extension MAY be used, e.g., for state management in the DSKPP server. 6. Protocol Bindings 6.1. General Requirements DSKPP assumes a reliable transport. 6.2. HTTP/1.1 Binding for DSKPP 6.2.1. Introduction This section presents a binding of the previous messages to HTTP/1.1 [RFC2616]. Note that the HTTP client normally will be different from the DSKPP client, i.e., the HTTP client will only exist to "proxy" DSKPP messages from the DSKPP client to the DSKPP server. Likewise, on the HTTP server side, the DSKPP server MAY receive DSKPP PDUs from a "front-end" HTTP server. 6.2.2. Identification of DSKPP Messages The MIME-type for all DSKPP messages MUST be application/vnd.ietf.keyprov.dskpp+xml Doherty, et al. Expires July 28, 2008 [Page 50] Internet-Draft DSKPP January 2008 6.2.3. HTTP Headers HTTP proxies MUST NOT cache responses carrying DSKPP messages. For this reason, the following holds: o When using HTTP/1.1, requesters SHOULD: * Include a Cache-Control header field set to "no-cache, no- store". * Include a Pragma header field set to "no-cache". o When using HTTP/1.1, responders SHOULD: * Include a Cache-Control header field set to "no-cache, no-must- revalidate, private". * Include a Pragma header field set to "no-cache". * NOT include a Validator, such as a Last-Modified or ETag header. There are no other restrictions on HTTP headers, besides the requirement to set the Content-Type header value according to Section 6.2.2. 6.2.4. HTTP Operations Persistent connections as defined in HTTP/1.1 are assumed but not required. DSKPP requests are mapped to HTTP POST operations. DSKPP responses are mapped to HTTP responses. 6.2.5. HTTP Status Codes A DSKPP HTTP responder that refuses to perform a message exchange with a DSKPP HTTP requester SHOULD return a 403 (Forbidden) response. In this case, the content of the HTTP body is not significant. In the case of an HTTP error while processing a DSKPP request, the HTTP server MUST return a 500 (Internal Server Error) response. This type of error SHOULD be returned for HTTP-related errors detected before control is passed to the DSKPP processor, or when the DSKPP processor reports an internal error (for example, the DSKPP XML namespace is incorrect, or the DSKPP schema cannot be located). If the type of a DSKPP request cannot be determined, the DSKPP responder MUST return a 400 (Bad request) response. In these cases (i.e., when the HTTP response code is 4xx or 5xx), the content of the HTTP body is not significant. Redirection status codes (3xx) apply as usual. Whenever the HTTP POST is successfully invoked, the DSKPP HTTP responder MUST use the 200 status code and provide a suitable DSKPP message (possibly with DSKPP error information included) in the HTTP body. Doherty, et al. Expires July 28, 2008 [Page 51] Internet-Draft DSKPP January 2008 6.2.6. HTTP Authentication No support for HTTP/1.1 authentication is assumed. 6.2.7. Initialization of DSKPP The DSKPP server MAY initialize the DSKPP protocol by sending an HTTP response with Content-Type set according to Section 6.2.2 and response code set to 200 (OK). This message MAY, e.g., be sent in response to a user requesting key initialization in a browsing session. The initialization message MAY carry data in its body. If this is the case, the data MUST be a valid instance of a element. 6.2.8. Example Messages a. Initialization from DSKPP server: HTTP/1.1 200 OK Cache-Control: no-store Content-Type: application/vnd.ietf.keyprov.dskpp+xml Content-Length: DSKPP initialization data in XML form... b. Initial request from DSKPP client: POST http://example.com/cgi-bin/DSKPP-server HTTP/1.1 Cache-Control: no-store Pragma: no-cache Host: example.com Content-Type: application/vnd.ietf.keyprov.dskpp+xml Content-Length: DSKPP data in XML form (supported version, supported algorithms...) c. Initial response from DSKPP server: HTTP/1.1 200 OK Cache-Control: no-store Content-Type: application/vnd.ietf.keyprov.dskpp+xml Content-Length: DSKPP data in XML form (server random nonce, server public key, ...) 7. DSKPP Schema Doherty, et al. Expires July 28, 2008 [Page 52] Internet-Draft DSKPP January 2008 Basic types Basic types Doherty, et al. Expires July 28, 2008 [Page 53] Internet-Draft DSKPP January 2008 Doherty, et al. Expires July 28, 2008 [Page 54] Internet-Draft DSKPP January 2008 This element is only valid for two-pass DSKPP. Doherty, et al. Expires July 28, 2008 [Page 55] Internet-Draft DSKPP January 2008 Authentication data contains a MAC. An authentication MAC calculated from an authentication code and optionally server information as well as nonce value if they are available.