idnits 2.17.1 draft-doherty-keyprov-dskpp-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 20. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 4387. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 4398. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 4405. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 4411. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == It seems as if not all pages are separated by form feeds - found 0 form feeds but 100 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC4758]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year -- The exact meaning of the all-uppercase expression 'MAY NOT' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: 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. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: The ProtocolVariantsType type is OPTIONALLY used by the DSKPP client to indicate the number of passes of the DSKPP protocol that it supports (see Section 4.2). The ProtocolVariantsType MAY be used to indicate support for 4-pass or 2-pass DSKPP. Because 1-pass DSKPP does not include a client request to the server, the ProtocolVariantsType type MAY NOT be used to indicate support for 1-pass DSKPP. If the ProtocolVariantsType is not used, then the DSKPP server will proceed with ordinary 4-pass DSKPP. However, it does not support 4-pass DSKPP, then the server MUST find a suitable two-pass variant or else the protocol run will fail. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: The AuthenticationDataType type is OPTIONALLY used to carry client or server authentication values in DSKPP messages (see Section 4.3). The element MAY be used 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 or MAY NOT 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 activation code can be sent to the DSKPP server in plaintext form, hashed data form, or keyed hash data form depending on the underlying transport protocol. b. A DSKPP client MAY include an AuthenticationCertificate that contains a certificate issued with the device by the issuer. c. A DSKPP server MAY use the AuthenticationDataType element AuthenticationCodeMac to carry a MAC for authenticating itself to the client. For example, when a successful 1- or 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. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: 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. The MAC value MUST be computed as specified in Section 4.8.1.2. When receiving a message with Status="Success" for which the MAC verifies, the DSKPP client MUST associate the generated key K_TOKEN with the provided key identifier 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. 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 DSKPP protocol. The MacType's MacAlgorithm attribute MUST, when present, identify the negotiated MAC algorithm. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: If keys generated in DSKPP will be associated with a particular user at the DSKPP server (or a server trusted by, and communicating with the DSKPP server), then in order to protect against threats where an attacker replaces a client-provided encrypted R_C with his own R'C (regardless of whether the public-key variant or the shared-secret variant of DSKPP is employed to encrypt the client nonce), the server SHOULD not commit to associate a generated K_TOKEN with the given cryptographic module until the user simultaneously has proven both possession of the device that hosts the cryptographic module containing K_TOKEN and some out-of-band provided authenticating information (e.g., a temporary password). For example, if the cryptographic module is a one-time password token, the user could be required to authenticate with both a one-time password generated by the cryptographic module and an out-of-band provided temporary PIN in order to have the server "commit" to the generated OTP value for the given user. Preferably, the user SHOULD perform this operation from another host than the one used to initialize keys on the cryptographic module, in order to minimize the risk of malicious software on the client interfering with the process. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 8, 2007) is 6137 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'PKCS-11' is defined on line 3173, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'UNICODE' -- Possible downref: Non-RFC (?) normative reference: ref. 'XMLDSIG' -- Possible downref: Non-RFC (?) normative reference: ref. 'XMLENC' == Outdated reference: A later version (-02) exists of draft-hoyer-keyprov-portable-symmetric-key-container-00 -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) Summary: 2 errors (**), 0 flaws (~~), 9 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 KEYPROV Working Group A. Doherty 3 Internet-Draft RSA, The Security Division of EMC 4 Intended status: Standards Track M. Pei 5 Expires: January 9, 2008 VeriSign, Inc. 6 M. Nystroem 7 RSA, The Security Division of EMC 8 S. Machani 9 Diversinet Corp. 10 July 8, 2007 12 Dynamic Symmetric Key Provisioning Protocol (DSKPP) 13 draft-doherty-keyprov-dskpp-01.txt 15 Status of this Memo 17 By submitting this Internet-Draft, each author represents that any 18 applicable patent or other IPR claims of which he or she is aware 19 have been or will be disclosed, and any of which he or she becomes 20 aware will be disclosed, in accordance with Section 6 of BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF), its areas, and its working groups. Note that 24 other groups may also distribute working documents as Internet- 25 Drafts. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 The list of current Internet-Drafts can be accessed at 33 http://www.ietf.org/ietf/1id-abstracts.txt. 35 The list of Internet-Draft Shadow Directories can be accessed at 36 http://www.ietf.org/shadow.html. 38 This Internet-Draft will expire on January 9, 2008. 40 Copyright Notice 42 Copyright (C) The IETF Trust (2007). 44 Abstract 46 DSKPP is a client-server protocol for initialization (and 47 configuration) of symmetric keys to locally and remotely accessible 48 cryptographic modules. The protocol can be run with or without 49 private-key capabilities in the cryptographic modules, and with or 50 without an established public-key infrastructure. 52 Three variations of the protocol support multiple usage scenarios. 53 The four-pass (i.e., two round-trip) variant enables key generation 54 in near real-time. With the four-pass variant, keys are mutually 55 generated by the provisioning server and cryptographic module; 56 provisioned keys are not transferred over-the-wire or over-the-air. 57 Two- and one-pass variants enable secure and efficient download and 58 installation of symmetric keys to a cryptographic module in 59 environments where near real-time communication may not be possible. 61 This document builds on information contained in [RFC4758], adding 62 specific enhancements in response to implementation experience and 63 liaison requests. It is intended, therefore, that this document or a 64 successor version thereto will become the basis for subsequent 65 progression of a symmetric key provisioning protocol specification on 66 the standards track. 68 Table of Contents 70 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 71 1.1. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 7 72 1.2. Background . . . . . . . . . . . . . . . . . . . . . . . 7 73 2. Notation and Terminology . . . . . . . . . . . . . . . . . . 8 74 3. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 9 75 3.1. A cryptographic module obtains a symmetric key . . . . . 9 76 3.2. A cryptographic module acquires multiple symmetric 77 keys of different types . . . . . . . . . . . . . . . . . 9 78 3.3. A provisioning server imposes a validity period policy 79 for provisioning sessions . . . . . . . . . . . . . . . . 10 80 3.4. A symmetric key issuer uses a third party provisioning 81 service provider . . . . . . . . . . . . . . . . . . . . 10 82 3.5. A cryptographic module renews its symmetric key with 83 the same key ID . . . . . . . . . . . . . . . . . . . . . 10 84 3.6. An administrator initiates a symmetric key replacement 85 before it can be used . . . . . . . . . . . . . . . . . . 10 86 3.7. A cryptographic module hosted by a smart card uses a 87 pre-shared transport key to communicate with the 88 provisioning server . . . . . . . . . . . . . . . . . . . 11 89 3.8. A cryptographic module hosted by a mobile device 90 downloads a symmetric key through SMS . . . . . . . . . . 11 91 3.9. A cryptographic module acquires a symmetric key over a 92 transport protocol that does not ensure data 93 confidentiality . . . . . . . . . . . . . . . . . . . . . 12 94 3.10. A cryptographic module acquires a symmetric key over a 95 transport protocol that does not provide authentication . 12 96 4. DSKPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 97 4.1. Entities . . . . . . . . . . . . . . . . . . . . . . . . 12 98 4.2. Principles of Operation . . . . . . . . . . . . . . . . . 14 99 4.2.1. Four-pass DSKPP . . . . . . . . . . . . . . . . . . . 15 100 4.2.2. Two-pass DSKPP . . . . . . . . . . . . . . . . . . . 19 101 4.2.3. One-pass DSKPP . . . . . . . . . . . . . . . . . . . 21 102 4.3. Authentication . . . . . . . . . . . . . . . . . . . . . 22 103 4.3.1. Client Authentication (Applicable to Four- and 104 Two-Pass DSKPP) . . . . . . . . . . . . . . . . . . . 22 105 4.3.2. Server Authentication . . . . . . . . . . . . . . . . 25 106 4.4. Symmetric Key Container Format . . . . . . . . . . . . . 25 107 4.5. The DSKPP One-Way Pseudorandom Function, DSKPP-PRF . . . 25 108 4.5.1. Introduction . . . . . . . . . . . . . . . . . . . . 25 109 4.5.2. Declaration . . . . . . . . . . . . . . . . . . . . . 26 110 4.6. Generation of Symmetric Keys for Cryptographic Modules . 26 111 4.7. Encryption of Pseudorandom Nonces Sent from the DSKPP 112 Client . . . . . . . . . . . . . . . . . . . . . . . . . 27 113 4.8. MAC calculations . . . . . . . . . . . . . . . . . . . . 27 114 4.8.1. Four-pass DSKPP . . . . . . . . . . . . . . . . . . . 27 115 4.8.2. Two-pass DSKPP . . . . . . . . . . . . . . . . . . . 28 116 4.8.3. One-pass DSKPP . . . . . . . . . . . . . . . . . . . 29 117 4.9. DSKPP Schema Basics . . . . . . . . . . . . . . . . . . . 30 118 4.9.1. The AbstractRequestType Type . . . . . . . . . . . . 31 119 4.9.2. The AbstractResponseType Type . . . . . . . . . . . . 31 120 4.9.3. The VersionType Type . . . . . . . . . . . . . . . . 32 121 4.9.4. The IdentifierType Type . . . . . . . . . . . . . . . 32 122 4.9.5. The StatusCode Type . . . . . . . . . . . . . . . . . 32 123 4.9.6. The DeviceIdentifierDataType Type . . . . . . . . . . 34 124 4.9.7. The TokenPlatformInfoType and PlatformType Types . . 35 125 4.9.8. The NonceType Type . . . . . . . . . . . . . . . . . 35 126 4.9.9. The AlgorithmsType Type . . . . . . . . . . . . . . . 36 127 4.9.10. The ProtocolVariantsType and the 128 TwoPassSupportType Types . . . . . . . . . . . . . . 36 129 4.9.11. The KeyContainersFormatTypeType . . . . . . . . . . . 37 130 4.9.12. The AuthenticationDataType Type . . . . . . . . . . . 38 131 4.9.13. The PayloadType Type . . . . . . . . . . . . . . . . 40 132 4.9.14. The MacType Type . . . . . . . . . . . . . . . . . . 40 133 4.9.15. The KeyContainerType Type . . . . . . . . . . . . . . 40 134 4.9.16. The ExtensionsType and the AbstractExtensionType 135 Types . . . . . . . . . . . . . . . . . . . . . . . . 41 136 4.10. DSKPP Messages . . . . . . . . . . . . . . . . . . . . . 41 137 4.10.1. Introduction . . . . . . . . . . . . . . . . . . . . 41 138 4.10.2. DSKPP Initialization (OPTIONAL) . . . . . . . . . . . 41 139 4.10.3. The DSKPP Client's Initial PDU (2- and 4-Pass) . . . 43 140 4.10.4. The DSKPP Server's Initial PDU (4-Pass Only) . . . . 46 141 4.10.5. The DSKPP Client's Second PDU (4-Pass Only) . . . . . 47 142 4.10.6. The DSKPP Server's Final PDU (1-, 2-, and 4-Pass) . . 48 143 4.11. Protocol Extensions . . . . . . . . . . . . . . . . . . . 50 144 4.11.1. The ClientInfoType Type . . . . . . . . . . . . . . . 50 145 4.11.2. The ServerInfoType Type . . . . . . . . . . . . . . . 50 146 4.11.3. The KeyInitializationDataType Type . . . . . . . . . 51 147 5. Protocol Bindings . . . . . . . . . . . . . . . . . . . . . . 52 148 5.1. General Requirements . . . . . . . . . . . . . . . . . . 52 149 5.2. HTTP/1.1 Binding for DSKPP . . . . . . . . . . . . . . . 52 150 5.2.1. Introduction . . . . . . . . . . . . . . . . . . . . 52 151 5.2.2. Identification of DSKPP Messages . . . . . . . . . . 53 152 5.2.3. HTTP Headers . . . . . . . . . . . . . . . . . . . . 53 153 5.2.4. HTTP Operations . . . . . . . . . . . . . . . . . . . 53 154 5.2.5. HTTP Status Codes . . . . . . . . . . . . . . . . . . 53 155 5.2.6. HTTP Authentication . . . . . . . . . . . . . . . . . 54 156 5.2.7. Initialization of DSKPP . . . . . . . . . . . . . . . 54 157 5.2.8. Example Messages . . . . . . . . . . . . . . . . . . 54 158 6. DSKPP Schema . . . . . . . . . . . . . . . . . . . . . . . . 55 159 7. Security Considerations . . . . . . . . . . . . . . . . . . . 63 160 7.1. General . . . . . . . . . . . . . . . . . . . . . . . . . 63 161 7.2. Active Attacks . . . . . . . . . . . . . . . . . . . . . 63 162 7.2.1. Introduction . . . . . . . . . . . . . . . . . . . . 63 163 7.2.2. Message Modifications . . . . . . . . . . . . . . . . 64 164 7.2.3. Message Deletion . . . . . . . . . . . . . . . . . . 65 165 7.2.4. Message Insertion . . . . . . . . . . . . . . . . . . 65 166 7.2.5. Message Replay . . . . . . . . . . . . . . . . . . . 66 167 7.2.6. Message Reordering . . . . . . . . . . . . . . . . . 66 168 7.2.7. Man-in-the-Middle . . . . . . . . . . . . . . . . . . 66 169 7.3. Passive Attacks . . . . . . . . . . . . . . . . . . . . . 66 170 7.4. Cryptographic Attacks . . . . . . . . . . . . . . . . . . 67 171 7.5. Attacks on the Interaction between DSKPP and User 172 Authentication . . . . . . . . . . . . . . . . . . . . . 67 173 7.6. Additional Considerations Specific to 2- and 1-pass 174 DSKPP . . . . . . . . . . . . . . . . . . . . . . . . . . 68 175 7.6.1. Client Contributions to K_TOKEN Entropy . . . . . . . 68 176 7.6.2. Key Confirmation . . . . . . . . . . . . . . . . . . 68 177 7.6.3. Server Authentication . . . . . . . . . . . . . . . . 68 178 7.6.4. Client Authentication . . . . . . . . . . . . . . . . 68 179 7.6.5. Key Protection in the Passphrase Profile . . . . . . 69 180 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 70 181 9. Intellectual Property Considerations . . . . . . . . . . . . 70 182 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 70 183 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 70 184 11.1. Normative references . . . . . . . . . . . . . . . . . . 70 185 11.2. Informative references . . . . . . . . . . . . . . . . . 71 186 Appendix A. Key Initialization Profiles of DSKPP . . . . . . . . 72 187 A.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 73 188 A.2. Key Transport Profile . . . . . . . . . . . . . . . . . . 73 189 A.2.1. Introduction . . . . . . . . . . . . . . . . . . . . 73 190 A.2.2. Identification . . . . . . . . . . . . . . . . . . . 73 191 A.2.3. Payloads . . . . . . . . . . . . . . . . . . . . . . 73 192 A.3. Key wrap profile . . . . . . . . . . . . . . . . . . . . 74 193 A.3.1. Introduction . . . . . . . . . . . . . . . . . . . . 74 194 A.3.2. Identification . . . . . . . . . . . . . . . . . . . 74 195 A.3.3. Payloads . . . . . . . . . . . . . . . . . . . . . . 74 196 A.4. Passphrase-based key wrap profile . . . . . . . . . . . . 76 197 A.4.1. Introduction . . . . . . . . . . . . . . . . . . . . 76 198 A.4.2. Identification . . . . . . . . . . . . . . . . . . . 76 199 A.4.3. Payloads . . . . . . . . . . . . . . . . . . . . . . 76 200 Appendix B. Example Messages . . . . . . . . . . . . . . . . . . 77 201 B.1. Example Messages in a Four-pass Exchange . . . . . . . . 77 202 B.1.1. Example of a DSKPP Initialization (Trigger) Message . 78 203 B.1.2. Example of a Message . . . . . . . . . 79 204 B.1.3. Example of a Message . . . . . . . . . 80 205 B.1.4. Example of a Message . . . . . . . . . 80 206 B.1.5. Example of a Message . . . . . . . . 80 207 B.2. Example Messages in a Two- or One-pass Exchange . . . . . 81 208 B.2.1. Example of a Message Indicating 209 Support for Two-pass DSKPP . . . . . . . . . . . . . 81 210 B.2.2. Example of a Message Using the 211 Key Transport Profile . . . . . . . . . . . . . . . . 83 213 B.2.3. Example of a Message Using the 214 Key Wrap Profile . . . . . . . . . . . . . . . . . . 85 215 B.2.4. Example of a Message using the 216 Passphrase-based Key Wrap Profile . . . . . . . . . . 86 217 Appendix C. Requirements . . . . . . . . . . . . . . . . . . . . 88 218 Appendix D. Integration with PKCS #11 . . . . . . . . . . . . . 90 219 D.1. The 4-pass Variant . . . . . . . . . . . . . . . . . . . 91 220 D.2. The 2-pass Variant . . . . . . . . . . . . . . . . . . . 91 221 D.3. The 1-pass Variant . . . . . . . . . . . . . . . . . . . 93 222 Appendix E. Example of DSKPP-PRF Realizations . . . . . . . . . 95 223 E.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 96 224 E.2. DSKPP-PRF-AES . . . . . . . . . . . . . . . . . . . . . . 96 225 E.2.1. Identification . . . . . . . . . . . . . . . . . . . 96 226 E.2.2. Definition . . . . . . . . . . . . . . . . . . . . . 96 227 E.2.3. Example . . . . . . . . . . . . . . . . . . . . . . . 97 228 E.3. DSKPP-PRF-SHA256 . . . . . . . . . . . . . . . . . . . . 97 229 E.3.1. Identification . . . . . . . . . . . . . . . . . . . 97 230 E.3.2. Definition . . . . . . . . . . . . . . . . . . . . . 98 231 E.3.3. Example . . . . . . . . . . . . . . . . . . . . . . . 99 232 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 99 233 Intellectual Property and Copyright Statements . . . . . . . . . 100 235 1. Introduction 237 1.1. Scope 239 This document describes a client-server protocol for initialization 240 (and configuration) of symmetric keys to locally and remotely 241 accessible cryptographic modules. The protocol can be run with or 242 without private-key capabilities in the cryptographic modules, and 243 with or without an established public-key infrastructure. The 244 objectives of this protocol are to: 246 o Provide a secure method of initializing cryptographic modules 247 with symmetric keys without exposing generated, secret material 248 to any other entities than the server and the cryptographic 249 module itself. 250 o Provide a secure method of generating and transporting 251 symmetric keys to a cryptographic module in environments where 252 near real-time communication is not possible. 253 o Provide a secure method of transporting pre-generated (i.e., 254 legacy) keys to a cryptographic module. 255 o Provide a solution that is easy to administer and scales well. 257 The mechanism is intended for general use within computer and 258 communications systems employing symmetric cryptographic modules that 259 are locally (i.e., over-the-wire) or remotely (i.e., over-the-air) 260 accessible. 262 1.2. Background 264 A symmetric cryptographic module may be hosted by a hand-held 265 hardware device (e.g., a mobile phone), a hardware device connected 266 to a personal computer through an electronic interface, such as USB, 267 or a software application resident on a personal computer. The 268 cryptographic module offers symmetric cryptographic functionality 269 that may be used to authenticate a user towards some service, perform 270 data encryption, etc. Increasingly, these modules enable their 271 programmatic initialization as well as programmatic retrieval of 272 their output values. This document intends to meet the need for an 273 open and inter-operable mechanism to programmatically initialize and 274 configure symmetric keys to locally and remotely accessible 275 cryptographic modules. 277 The target mechanism addressed herein is a symmetric key provisioning 278 server. In an ideal deployment scenario, near real-time 279 communication is possible between the provisioning server and the 280 cryptographic module. In such an environment, it is possible for the 281 cryptographic module and provisioning server to mutually generate a 282 symmetric key, and to ensure that keys are not transported between 283 them. 285 There are, however, several deployment scenarios that make mutual key 286 generation less suitable. Specifically, scenarios where near real- 287 time communication between the symmetric key provisioning server and 288 the cryptographic module is not possible, and scenarios with 289 significant design constraints. Examples include work-flow 290 constraints (e.g., policies that require incremental administrative 291 approval), network design constraints that create network latency, 292 and budget constraints that sustain reliance upon legacy systems that 293 already have supplies of pre-generated keys. In these situations, 294 the cryptographic module is required to download and install a 295 symmetric key from the provisioning server in a secure and efficient 296 manner. 298 This document tries to meet the needs of these scenarios by 299 describing three variations to DSKPP for the provisioning of 300 symmetric keys in two round trips or less. The four-pass (i.e., two 301 round-trip) variant enables key generation in near real-time. With 302 this variant, keys are mutually generated by the provisioning server 303 and cryptographic module; provisioned keys are not transferred over- 304 the-wire or over-the-air. In contrast, two- and one-pass variants 305 enable secure and efficient download and installation of symmetric 306 keys to a cryptographic module in environments where near real-time 307 communication is not possible. 309 2. Notation and Terminology 311 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 312 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 313 document are to be interpreted as described in [RFC2119]. 315 The following notations are used in this document: 317 || String concatenation 318 [x] Optional element x 319 A ^ B Exclusive-OR operation on strings A and B (where A 320 and B are of equal length) 321 DSKPP client Manages communication between the symmetric 322 cryptographic module and the DSKPP server 323 DSKPP server The symmetric key provisioning server that 324 participates in the DSKPP protocol run 325 ID_C Identifier for DSKPP client 326 ID_S Identifier for DSKPP server 327 K Key used to encrypt R_C (either K_SERVER or K_SHARED) 328 K_AUTH Secret key used for server authentication purposes in 329 4-pass DSKPP 330 K_CLIENT Public key of the DSKPP client 331 K_DERIVED Secret key derived from a passphrase that is known to 332 both the DSKPP client or user and the DSKPP server 333 K_MAC Secret key used for key confirmation and server 334 authentication purposes, and generated in DSKPP 335 K_MAC' A second secret key used for server authentication 336 purposes in 2- and 1-pass DSKPP 337 K_SERVER Public key of the DSKPP server 338 K_SHARED Secret key shared between the DSKPP client and the 339 DSKPP server 340 K_TOKEN Secret key used for cryptographic module 341 computations, and generated in DSKPP 342 R Pseudorandom value chosen by the DSKPP client and 343 used for MAC computations, which is mandatory for 344 2-pass DSKPP and optional for 4-pass 345 R_C Pseudorandom value chosen by the DSKPP client and 346 used as input to the generation of K_TOKEN 347 R_S Pseudorandom value chosen by the DSKPP server and 348 used as input to the generation of K_TOKEN 350 The following typographical convention is used in the body of the 351 text: . 353 3. Use Cases 355 This section describes typical use cases. 357 3.1. A cryptographic module obtains a symmetric key 359 A cryptographic module hosted by a device, such as a mobile phone, 360 makes a request for a symmetric key from a provisioning server. 361 Depending upon how the system is deployed, the provisioning server 362 may generate a new key on-the-fly or use a pre-generated key, e.g., 363 one provided by a legacy back-end issuance server. The provisioning 364 server assigns a unique key ID to the symmetric key and provisions it 365 to the cryptographic module. 367 3.2. A cryptographic module acquires multiple symmetric keys of 368 different types 370 A cryptographic module makes multiple requests for symmetric keys 371 from the same provisioning server. The symmetric keys may or may not 372 be of the same type, i.e., the keys may be used with different 373 symmetric cryptographic algorithms, including the HMAC-Based One-Time 374 Password (HOTP), RSA SecurID, challenge-response, etc. 376 3.3. A provisioning server imposes a validity period policy for 377 provisioning sessions 379 Once a cryptographic module initiates a symmetric key request, the 380 provisioning server may require that any subsequent actions to 381 complete the provisioning cycle occur within a certain time window. 382 For example, an issuer may provide a time-limited authentication code 383 to a user during registration, which the user will input into the 384 cryptographic module to authenticate themselves with the provisioning 385 server. As long as the user inputs a valid authentication code 386 within the fixed time period established by the issuer, the server 387 will provision a key to the cryptographic module hosted by the user's 388 device. 390 3.4. A symmetric key issuer uses a third party provisioning service 391 provider 393 A symmetric key issuer outsources its key provisioning to a third 394 party key provisioning server provider. The issuer is responsible 395 for authenticating and granting rights to users to acquire keys while 396 acting as a proxy to the cryptographic module to acquire symmetric 397 keys from the provisioning server; the cryptographic module 398 communicates with the issuer proxy server, which forwards 399 provisioning requests to the provisioning server. 401 3.5. A cryptographic module renews its symmetric key with the same key 402 ID 404 A cryptographic module requests renewal of a symmetric key using the 405 same key ID already associated with the key. Such a need may occur 406 in the case when a user wants to upgrade her device that houses the 407 cryptographic module or when a key has expired. When a user uses the 408 same cryptographic module to, for example, perform strong 409 authentication at multiple Web login sites, keeping the same key ID 410 removes the need for the user to register a new key ID at each site. 412 3.6. An administrator initiates a symmetric key replacement before it 413 can be used 415 This use case represents a special case of symmetric key renewal in 416 which a local administrator can authenticate the user procedurally 417 before initiating the provisioning process. It also allows for an 418 issuer to pre-load a key onto a cryptographic module with a 419 restriction that the key is replaced with a new key prior to use of 420 the cryptographic module. 422 Bulk initialization under controlled conditions, e.g., during 423 manufacture, is likely to meet the security needs of most 424 applications. However, reliance on a pre-disclosed secret is 425 unacceptable in some circumstances. One such circumstance is when 426 cryptographic modules are issued for classified government use or 427 high security applications. In such cases, the issuer requires the 428 ability to remove all secret information already installed on the 429 cryptographic module and replace it with symmetric keys established 430 under conditions controlled by the issuer. 432 Another variation of this use case is the issuer who recycles 433 devices. In this case, an issuer would provision a new symmetric key 434 to a cryptographic module hosted on a device that was previously 435 owned by another user. 437 Note that this use case is essentially the same as the last use case 438 wherein the same key ID is used for renewal. 440 3.7. A cryptographic module hosted by a smart card uses a pre-shared 441 transport key to communicate with the provisioning server 443 A cryptographic module is loaded onto a smart card after the card is 444 issued to a user. The symmetric key for the cryptographic module 445 will then be provisioned using a secure channel mechanism present in 446 many smart card platforms. This allows a direct secure channel to be 447 established between the smart card chip and the provisioning server. 448 For example, the card commands (i.e., Application Protocol Data 449 Units, or APDUs) are encrypted with a pre-shared transport key and 450 sent directly to the smart card chip, allowing secure post-issuance 451 in-the-field provisioning. This secure flow can pass Transport Layer 452 Security (TLS) and other transport security boundaries. 454 Note that two pre-conditions for this use case are for the protocol 455 to be tunneled and the provisioning server to know the correct pre- 456 established transport key. 458 3.8. A cryptographic module hosted by a mobile device downloads a 459 symmetric key through SMS 461 A mobile device supports Short Message Service (SMS) but is not able 462 to support a data service allowing for HTTP or HTTPS transports. In 463 addition, the cryptographic module can ensure that SMS will provide 464 an acceptable level of protection for download of the symmetric key. 465 In such a case, the cryptographic module hosted by the mobile device 466 may initiate a symmetric key request from a desktop computer and ask 467 the server to send the key to the mobile device through SMS. User 468 authentication is carried out via the online communication 469 established between the desktop computer and the provisioning server. 471 3.9. A cryptographic module acquires a symmetric key over a transport 472 protocol that does not ensure data confidentiality 474 Some devices are not able to support a secure transport channel such 475 as SSL or TLS to provide data confidentiality. A cryptographic 476 module hosted by such a device requests a symmetric key from the 477 provisioning server. It is up to DSKPP to ensure data 478 confidentiality over non-secure networks. 480 3.10. A cryptographic module acquires a symmetric key over a transport 481 protocol that does not provide authentication 483 Some devices are not able to use a transport protocol that provides 484 server authentication such as SSL or TLS. A cryptographic module 485 hosted by such a device wants to be sure that it sends a request for 486 a symmetric key to a legitimate provisioning server. It is up to 487 DSKPP to provide proper client and server authentication. 489 4. DSKPP 491 4.1. Entities 493 In principle, the protocol involves a DSKPP client and a DSKPP 494 server. The DSKPP client manages communication between the 495 cryptographic module and the provisioning server. The DSKPP server 496 herein represents the provisioning server. 498 A high-level object model that describes the client-side entities and 499 how they relate to each other is shown in Figure 1. Conceptually, 500 each entity represents the following: 502 User The person or client to whom devices are 503 issued 504 UserID A unique identifier for the user or client 505 Device A physical piece of hardware that hosts 506 symmetric cryptographic modules 507 DeviceID A unique identifier for the device 508 Cryptographic Module A low-level component of an application, 509 which enables symmetric cryptographic 510 functionality 511 CryptoModuleID A unique identifier for an instance of the 512 cryptographic module 513 Encryption Algorithms Encryption algorithms supported by the 514 cryptographic module 516 MAC Algorithms MAC algorithms supported by the cryptographic 517 module 518 Key Container An object that encapsulates a symmetric key 519 and its configuration data 520 KeyID A unique identifier for the symmetric key 521 Key Type The type of symmetric cryptographic methods 522 for which the key will be used (e.g., OATH 523 HOTP or RSA SecurID authentication, AES 524 encryption, etc.) 526 ----------- ------------- 527 | User | | Device | 528 |---------|* owns *|-----------| 529 | UserID |--------->| DeviceID | 530 | ... | | ... | 531 ----------- ------------- 532 | 1 533 | 534 | contains 535 | 536 | * 537 V 538 ----------------------- 539 |Cryptographic Module | 540 |---------------------| 541 |CryptoModuleID 542 |Encryption Algorithms| 543 |MAC Algorithms | 544 |... | 545 ----------------------- 546 | 1 547 | 548 | contains 549 | 550 | * 551 V 552 ----------------------- 553 |Key Container | 554 |---------------------| 555 |KeyID | 556 |Key Type | 557 |... | 558 ----------------------- 560 Figure 1: Object Model 562 It is assumed that a device will host an application layered above 563 the cryptographic module, and this application will manage 564 communication between the DSKPP client and cryptographic module. The 565 manner in which the communicating application will transfer DSKPP 566 protocol elements to and from the cryptographic module is transparent 567 to the DSKPP server. One method for this transfer is described in 568 [CT-KIP-P11]. 570 4.2. Principles of Operation 572 To initiate a DSKPP session, a user may use a browser to connect to a 573 web server. The user may then identify and optionally authenticate 574 herself and possibly indicate how the DSKPP client has to contact the 575 DSKPP server. There are also other alternatives for DSKPP session 576 initiation, such as the DSKPP client being pre-configured to contact 577 a certain DSKPP server, or the user being informed out-of-band about 578 the address of the DSKPP server. 580 Once the location of the DSKPP server is known, the DSKPP client and 581 the DSKPP server engage in a 4-pass, 2-pass, or 1-pass protocol. 582 With the four-pass variant, keys are mutually generated by the 583 provisioning server and cryptographic module; provisioned keys are 584 not transferred over-the-wire or over-the-air. Two- and one-pass 585 variants enable secure and efficient download and installation of 586 symmetric keys to a cryptographic module in environments where near 587 real-time communication may not be possible. 589 DSKPP protocol variants may be applied to the use cases described in 590 Section 3, as shown below: 592 ========================================================== 593 Protocol Applicable Applicable 594 Variant Use Cases Deployment Scenarios 595 ========================================================== 596 4-pass All but 3.6 and Near real-time 597 3.8 if mutual key communication is 598 generation is desired; possible 599 none if transport of 600 a pre-generated key 601 is required 602 ----------------------------------------------------------- 603 2-pass All Either near real-time 604 or non real-time 605 communication may be 606 possible 607 ----------------------------------------------------------- 608 1-pass All but 3.8 Either near real-time 609 or non real-time 610 communication may be 611 possible 612 ========================================================== 614 Figure 2: Mapping of use cases to protocol variants 616 4.2.1. Four-pass DSKPP 618 The 4-pass protocol flow is suitable for environments wherein there 619 is near real-time communication possible between the DSKPP client and 620 DSKPP server. It is not suitable for environments wherein 621 administrative approval is a required step in the flow, nor for 622 provisioning of pre-generated keys. The 4-pass protocol flow, shown 623 in Figure 3 and expanded in Figure 4, consists of two round trips 624 between the DSKPP client and server. 626 +---------------+ +---------------+ 627 | | | | 628 | DSKPP client | | DSKPP server | 629 | | | | 630 +---------------+ +---------------+ 631 | | 632 | [ <---- DSKPP trigger ----- ] | 633 | | 634 | ------- Client Hello -------> | 635 | | 636 | <------ Server Hello -------- | 637 | | 638 | ------- Client Nonce -------> | 639 | | 640 | <----- Server Finished ------ | 641 | | 643 Figure 3: The 4-pass DSKPP protocol (with OPTIONAL preceeding 644 trigger) 646 a. The DSKPP client sends a message to the DSKPP 647 server. The message provides information to the DSKPP server 648 about the DSKPP versions, protocol variants, key types, 649 encryption and MAC algorithms supported by the cryptographic 650 module for the purposes of this protocol. The message may also 651 include client authentication data, such as a certificate or 652 authentication code. 653 b. The DSKPP server responds to the DSKPP client with a 654 message, whose content includes a random nonce, 655 R_S, along with information about the type of key to generate, 656 and the encryption algorithm chosen to protect sensitive data 657 sent in the protocol. The length of the nonce R_S may depend 658 on the selected key type. The message also 659 provides information about either a shared secret key to use 660 for encrypting the cryptographic module's random nonce (see 661 description of below), or its own public key. 662 Optionally, may include a MAC that the DSKPP 663 client may use for server authentication. 664 c. Based on information contained in the message, 665 the cryptographic module generates a random nonce, R_C. The 666 length of the nonce R_C may depend on the selected key type. 667 The cryptographic module encrypts R_C using the selected 668 encryption algorithm and with a key, K, that is either the 669 DSKPP server's public key, K_SERVER, or a shared secret key, 670 K_SHARED, as indicated by the DSKPP server. If K is equivalent 671 to K_SERVER, then the cryptographic module SHOULD verify the 672 server's certificate before using it to encrypt R_C. The DSKPP 673 client then sends the encrypted random nonce to the DSKPP 674 server in a message, and may include client 675 authentication data, such as a certificate or authentication 676 code. Finally, the cryptographic module calculates a symmetric 677 key, K_TOKEN, of the selected type from the combination of the 678 two random nonces R_S and R_C, the encryption key K, and 679 possibly some other data, using the DSKPP-PRF function defined 680 in Section 4.5. 681 d. The DSKPP server decrypts R_C, calculates K_TOKEN from the 682 combination of the two random nonces R_S and R_C, the 683 encryption key K, and possibly some other data, using the 684 DSKPP-PRF function defined in Section 4.5. The server then 685 associates K_TOKEN with the cryptographic module in a server- 686 side data store. The intent is that the data store later on 687 will be used by some service that needs to verify or decrypt 688 data produced by the cryptographic module and the key. 689 e. Once the association has been made, the DSKPP server sends a 690 confirmation message to the DSKPP client called 691 . The confirmation message includes a key 692 container that holds an identifier for the generated key (but 693 not the key itself) and additional configuration information, 694 e.g., the identity of the DSKPP server. Optionally, 695 may include a MAC that the DSKPP client may 696 use for server authentication. 697 f. Upon receipt of the DSKPP server's confirmation message, the 698 cryptographic module associates the provided key container with 699 the generated key K_TOKEN, and stores any provided 700 configuration data. 701 Note: Conceptually, although R_C is one pseudorandom string, it may 702 be viewed as consisting of two components, R_C1 and R_C2, where R_C1 703 is generated during the protocol run, and R_C2 can be pre-generated 704 and loaded on the cryptographic module before the device is issued to 705 the user. In that case, the latter string, R_C2, SHOULD be unique 706 for each cryptographic module. 708 The inclusion of the two random nonces R_S and R_C in the key 709 generation provides assurance to both sides (the cryptographic module 710 and the DSKPP server) that they have contributed to the key's 711 randomness and that the key is unique. The inclusion of the 712 encryption key K ensures that no man-in-the-middle MAY be present, or 713 else the cryptographic module will end up with a key different from 714 the one stored by the legitimate DSKPP server. 716 Note: A man-in-the-middle (in the form of corrupt client software or 717 a mistakenly contacted server) MAY present his own public key to the 718 cryptographic module. This will enable the attacker to learn the 719 client's version of K_TOKEN. However, the attacker is not able to 720 persuade the legitimate server to derive the same value for K_TOKEN, 721 since K_TOKEN is a function of the public key involved, and the 722 attacker's public key must be different than the correct server's (or 723 else the attacker would not be able to decrypt the information 724 received from the client). Therefore, once the attacker is no longer 725 "in the middle," the client and server will detect that they are "out 726 of synch" when they try to use their keys. In the case of encrypting 727 R_C with K_SERVER, it is therefore important to verify that K_SERVER 728 really is the legitimate server's key. One way to do this is to 729 independently validate a newly generated K_TOKEN against some 730 validation service at the server (e.g. by using a connection 731 independent from the one used for the key generation). 733 +----------------------+ +-------+ +----------------------+ 734 | +------------+ | | | | | 735 | | Server key | | | | | | 736 | +<-| Public |------>------------->-------------+---------+ | 737 | | | Private | | | | | | | | 738 | | +------------+ | | | | | | | 739 | | | | | | | | | | 740 | V V | | | | V V | 741 | | +---------+ | | | | +---------+ | | 742 | | | Decrypt |<-------<-------------<-----------| Encrypt | | | 743 | | +---------+ | | | | +---------+ | | 744 | | | +--------+ | | | | ^ | | 745 | | | | Server | | | | | | | | 746 | | | | Random |--->------------->------+ +----------+ | | 747 | | | +--------+ | | | | | | Client | | | 748 | | | | | | | | | | Random | | | 749 | | | | | | | | | +----------+ | | 750 | | | | | | | | | | | | 751 | | V V | | | | V V | | 752 | | +------------+ | | | | +------------+ | | 753 | +-->| DSKPP PRF | | | | | | DSKPP PRF |<----+ | 754 | +------------+ | | | | +------------+ | 755 | | | | | | | | 756 | V | | | | V | 757 | +-------+ | | | | +-------+ | 758 | | Key | | | | | | Key | | 759 | +-------+ | | | | +-------+ | 760 | +-------+ | | | | +-------+ | 761 | |Key Id |-------->------------->------|Key Id | | 762 | +-------+ | | | | +-------+ | 763 +----------------------+ +-------+ +----------------------+ 764 DSKPP Server DSKPP Client DSKPP Client 765 (PC Host) (cryptographic module) 767 Figure 4: Principal data flow for DSKPP key generation - 768 using public server key 770 4.2.2. Two-pass DSKPP 772 The 2-pass protocol flow is suitable for environments wherein near 773 real-time communication between the DSKPP client and server may not 774 be possible. It is also suitable for environments wherein 775 administrative approval is a required step in the flow, and for 776 provisioning of pre-generated keys. In the 2-pass protocol flow, 777 shown in Figure 5, the client's initial message is 778 directly followed by a message. There is no 779 exchange of the message or the message. 780 However, as the two-pass variant of DSKPP consists of one round trip 781 to the server, the client is still able to include its random nonce, 782 R_C, algorithm preferences and supported key types in the 783 message. Note than by including R_C in , 784 the DSKPP client is able to ensure the server is alive before 785 "commiting" the key. Also note that the DSKPP "trigger" message MAY 786 be used to trigger the client's sending of the message. 788 Essentially, two-pass DSKPP is a transport of key material from the 789 DSKPP server to the DSKPP client. Two-pass DSKPP supports multiple 790 key initialization methods that ensure K_TOKEN is not exposed to any 791 other entity than the DSKPP server and the cryptographic module 792 itself. Currently, three such key initialization methods are defined 793 (refer to Appendix A), each supporting a different usage of 2-pass 794 DSKPP: 796 Key Transport This profile is intended for PKI-capable 797 devices. Key transport is carried out 798 using a public key, K_CLIENT, whose 799 private key part resides in the 800 cryptographic module as the transport 801 key. 802 Key Wrap This profile is ideal for pre-keyed 803 devices, e.g., SIM cards. Key wrap is 804 carried out using a symmetric key- 805 wrapping key, K_SHARED, which is known in 806 advance by both the cryptographic module 807 and the DSKPP server. 808 Passphrase-based Key Wrap This profile is a variation of the Key 809 Wrap Profile. It is applicable to 810 constrained devices with keypads, e.g., 811 mobile phones. Key wrap is carried out 812 using a passphrase-derived key-wrapping 813 key, K_DERIVED, which is known in advance 814 by both the cryptographic module and 815 DSKPP server. 817 +---------------+ +---------------+ 818 | | | | 819 | DSKPP client | | DSKPP server | 820 | | | | 821 +---------------+ +---------------+ 822 | | 823 | [ <---- DSKPP trigger ----- ] | 824 | | 825 | ------- Client Hello -------> | 826 | | 827 | <----- Server Finished ------ | 828 | | 830 Figure 5: The 2-pass DSKPP protocol (with OPTIONAL preceding trigger) 832 a. The DSKPP client sends a message to the DSKPP 833 server. The message provides the client nonce, R_C, and 834 information about the DSKPP versions, protocol variants, key 835 types, encryption and MAC algorithms supported by the 836 cryptographic module for the purposes of this protocol. The 837 message may also include client authentication data, such as a 838 certificate or authentication code. Unlike 4-pass DSKPP, 839 2-pass DSKPP client uses the message to declare 840 which key initialization method it supports, providing required 841 payload information, e.g., K_CLIENT for the Key Transport 842 Profile. 843 b. The DSKPP server generates a key K from which two keys, K_TOKEN 844 and K_MAC are derived. K is either transported or wrapped in 845 accordance with the key initialization method specified by the 846 DSKPP client in the message. The server then 847 associates K_TOKEN with the cryptographic module in a server- 848 side data store. The intent is that the data store later on 849 will be used by some service that needs to verify or decrypt 850 data produced by the cryptographic module and the key. 851 c. Once the association has been made, the DSKPP server sends a 852 confirmation message to the DSKPP client called 853 . The confirmation message includes a key 854 container that holds an identifier for the key, the key K from 855 which K_TOKEN and K_MAC are derived, and additional 856 configuration information (note that the latter MUST include 857 the identity of the DSKPP server for authentication purposes). 858 In addition, MUST include two MACs whose 859 values are calculated with contribution from the client nonce, 860 R_C, provided in the message. The MAC values 861 will allow the cryptographic module to perform key confirmation 862 and server authentication before "commiting" the key. 864 d. Upon receipt of the DSKPP server's confirmation message, the 865 cryptographic module extracts the key data from the provided 866 key container, uses the two MAC values to perform key 867 confirmation and server authentication, and stores the key 868 material locally. 870 4.2.3. One-pass DSKPP 872 The one-pass protocol flow is suitable for environments wherein near 873 real-time communication between the DSKPP client and server may not 874 be possible. It is also suitable for environments wherein 875 administrative approval is a required step in the flow, and for 876 provisioning of pre-generated keys. In one-pass DSKPP, shown in 877 Figure 6, the server simply sends a message to the 878 DSKPP client. In this case, there is no exchange of the 879 , , and DSKPP messages, and 880 hence there is no way for the client to express supported algorithms 881 or key types. Before attempting one-pass DSKPP, the server MUST 882 therefore have prior knowledge not only that the client is able and 883 willing to accept this variant of DSKPP, but also of algorithms and 884 key types supported by the client. 886 Essentially, one-pass DSKPP is a transport of key material from the 887 DSKPP server to the DSKPP client. As with two-pass DSKPP, the one- 888 pass variant relies on key initialization methods that ensure K_TOKEN 889 is not exposed to any other entity than the DSKPP server and the 890 cryptographic module itself. The same key initialization profiles 891 are defined as described in Section 4.2.2 and Appendix A. 893 Outside the specific cases where one-pass DSKPP is desired, clients 894 SHOULD be constructed and configured to only accept DSKPP server 895 messages in response to client-initiated transactions. 897 +---------------+ +---------------+ 898 | | | | 899 | DSKPP client | | DSKPP server | 900 | | | | 901 +---------------+ +---------------+ 902 | | 903 | <----- Server Finished ------ | 904 | | 906 Figure 6: The 1-pass DSKPP protocol 908 a. The DSKPP server generates a key K from which two keys, K_TOKEN 909 and K_MAC are derived. K is either transported or wrapped in 910 accordance with the key initialization method known in advance 911 by the DSKPP server. The server then associates K_TOKEN with 912 the cryptographic module in a server-side data store. The 913 intent is that the data store later on will be used by some 914 service that needs to verify or decrypt data produced by the 915 cryptographic module and the key. 916 b. Once the association has been made, the DSKPP server sends a 917 confirmation message to the DSKPP client called 918 . The confirmation message includes a key 919 container that holds an identifier for the key, the key K from 920 which K_TOKEN and K_MAC are derived, and additional 921 configuration information (note that the latter MUST include 922 the identity of the DSKPP server for authentication purposes). 923 In addition, MUST include two MACs, which will 924 allow the cryptographic module to perform key confirmation and 925 server authentication before "commiting" the key. Note that 926 unlike two-pass DSKPP, in the one-pass variant, the server does 927 not have the client nonce, R_C, and therefore the MACs values 928 are calculated with contribution from an unsigned integer, I, 929 generated by the server during the protocol run. 930 c. Upon receipt of the DSKPP server's confirmation message, the 931 cryptographic module extracts the key data from the provided 932 key container, uses the two MAC values to perform key 933 confirmation and server authentication, and stores the key 934 material locally. 936 4.3. Authentication 938 4.3.1. Client Authentication (Applicable to Four- and Two-Pass DSKPP) 940 To ensure that a generated K_TOKEN ends up associated with the 941 correct cryptographic module and user, the DSKPP server MAY couple an 942 initial user authentication to the DSKPP execution in several ways, 943 as discussed in the following sub-sections. Whatever the method, the 944 DSKPP server MUST ensure that a generated key is associated with the 945 correct cryptographic module, and if applicable, the correct user. 946 For a further discussion of this, and threats related to man-in-the- 947 middle attacks in this context, see Section 7. 949 4.3.1.1. Device Certificate 951 Instead of requiring an Authentication Code for in-band 952 authentication, a device certificate could be used, which was 953 supplied with the cryptographic module by its issuer. 955 4.3.1.2. Device Identifier 957 The provisioning server could be pre-configured with a device 958 identifier. The DSKPP server MAY then include this identifier in the 959 DSKPP initialization trigger, and the DSKPP client would include it 960 in its message(s) to the DSKPP server for authentication. Note that 961 it is also legitimate for a DSKPP client to initiate the DSKPP 962 protocol run without having received an initialization message from a 963 server, but in this case any provided device identifier MUST NOT be 964 accepted by the DSKPP server unless the server has access to a unique 965 key for the identified device and that key will be used in the 966 protocol. 968 4.3.1.3. One-time Use Authentication Code 970 A key issuer may provide a one-time value, called an Authentication 971 Code, to the user or device out-of-band and require this value to be 972 used by the DSKPP client when contacting the DSKPP server. The DSKPP 973 client MAY include the authentication data in its (and 974 for four-pass) message, and the DSKPP server MUST 975 verify the data before continuing with the protocol run. Note: An 976 alternate method for getting the Authentication Code to the client, 977 is for the DSKPP server to place the value in the 978 element of the DSKPP initialization trigger (if triggers are used; 979 see Section 5.2.7) . 981 +------------+ Get Authentication Code +------------+ 982 | User |<------------------------->| Issuer | 983 +------------+ +------------+ 984 | | 985 | | 986 | | 987 V V 988 +--------------+ +--------------+ 989 | Provisioning | Authentication Data | Provisioning | 990 | Client |----------------------->| Server | 991 +--------------+ +--------------+ 993 Figure 7: User Authentication with One-Time Code 995 Considering an Authentication Code as a special form of shared secret 996 between a user and a provisioning server, Authentication Data can 997 have one of the following forms: 999 o AuthenticationData = Hash (Authentication Code) 1000 When an Authentication Code is used to initiate the protocol run, 1001 the Authentication Code MUST be sent to the DSKPP server in a 1002 secure manner. If the underlying transport channel is secure, the 1003 authentication data MAY contain the plaintext format or the hashed 1004 format of the Authentication Code using a hash function. 1006 o AuthenticationData = HMAC(Authentication Code, K_AUTH) 1008 If the underlying transport is not secure, the client MUST use a 1009 key K_AUTH and the Authentication Code to derive authentication 1010 data. For example, if the Authentication Code has a fixed format, 1011 e.g., 1013 AuthenticationCode = passwordLength || ID || password || checksum 1015 then AuthenticationData MAY be calculated as follows: 1017 AuthenticationData = AuthenticationCode->ID || B64(Digest) 1019 where for four-pass DSKPP, the cryptographic module uses the 1020 server nonce R_S in combination with the server URL to calculate 1021 the Digest: 1023 Digest = DSKPP-PRF-AES(K_AUTH, AuthCode->ID || serverURL || R_S, 1024 16) 1026 Refer to Section 4.5 for a description of DSKPP-PRF in general and 1027 Appendix E for a description of DSKPP-PRF-AES. 1029 For two-pass DSKPP, the cryptographic module does not have access 1030 to the server nonce R_S in combination and so: 1032 Digest = DSKPP-PRF-AES(K_AUTH, AuthenticationCode->ID || 1033 serverURL, 16) 1035 In either case, K_AUTH MAY be derived AES key from 1036 AuthenticationCode->password as in: 1038 K_AUTH = truncate( Hash( Hash(...n times...( AuthCode->password ) 1039 ) ) ) 1041 where truncate() returns the first 16 bytes from the result of the 1042 last hash iteration, and n is the number of hash iterations (set 1043 to fixed values, e.g., between 10 and 100). 1045 o AuthenticationData = 1047 When a certificate is used for authentication, the authentication 1048 data MAY be client-signed. Authentication data MAY be omitted if 1049 client certificate authentication has been provided by the 1050 transport channel such as TLS. 1052 When an issuer delegates symmetric key provisioning to a third party 1053 provisioning service provider, both client authentication and issuer 1054 authentication are required by the provisioning server. Client 1055 authentication to the Issuer MAY be in-band or out-of-band as 1056 described above. The issuer acts as a proxy for the provisioning 1057 server. The issuer authenticates to the provisioning service 1058 provider either using a certificate or a pre-established secret key. 1060 4.3.2. Server Authentication 1062 A DSKPP server MUST authenticate itself to avoid a false "Commit" of 1063 a symmetric key that which could cause the cryptographic module to 1064 end up in an initialized state for which the server does not know the 1065 stored key. To do this, the DSKPP server authenticates itself by 1066 including a MAC in each of its responses to the client. In 2-pass 1067 and 1-pass DSKPP, servers authenticate themselves by including a 1068 second MAC value in the response message. In addition, a DSKPP 1069 server can leverage transport layer authentication if it is 1070 available. 1072 4.4. Symmetric Key Container Format 1074 The default symmetric key container format that is used in the 1075 message is based on the Portable Symmetric Key 1076 Container (PSKC) defined in [PSKC]. Alternative formats MAY include 1077 PKCS#12 [PKCS-12] or PKCS#5 XML [PKCS-5-XML] format. 1079 4.5. The DSKPP One-Way Pseudorandom Function, DSKPP-PRF 1081 4.5.1. Introduction 1083 The general requirements on DSKPP-PRF are the same as on keyed hash 1084 functions: It MUST take an arbitrary length input, and be one-way and 1085 collision-free (for a definition of these terms, see, e.g., [FAQ]). 1086 Further, the DSKPP-PRF function MUST be capable of generating a 1087 variable-length output, and its output MUST be unpredictable even if 1088 other outputs for the same key are known. 1090 It is assumed that any realization of DSKPP-PRF takes three input 1091 parameters: A secret key k, some combination of variable data, and 1092 the desired length of the output. The combination of variable data 1093 can, without loss of generalization, be considered as a salt value 1094 (see PKCS#5 Version 2.0 [PKCS-5], Section 4), and this 1095 characterization of DSKPP-PRF SHOULD fit all actual PRF algorithms 1096 implemented by cryptographic modules. From the point of view of this 1097 specification, DSKPP-PRF is a "black-box" function that, given the 1098 inputs, generates a pseudorandom value. 1100 Separate specifications MAY define the implementation of DSKPP-PRF 1101 for various types of cryptographic modules. Appendix E contains two 1102 example realizations of DSKPP-PRF. 1104 4.5.2. Declaration 1106 DSKPP-PRF (k, s, dsLen) 1108 Input: 1110 k secret key in octet string format 1111 s octet string of varying length consisting of variable data 1112 distinguishing the particular string being derived 1113 dsLen desired length of the output 1115 Output: 1117 DS pseudorandom string, dsLen-octets long 1118 For the purposes of this document, the secret key k MUST be 16 octets 1119 long. 1121 4.6. Generation of Symmetric Keys for Cryptographic Modules 1123 In DSKPP, keys are generated using the DSKPP-PRF function, a secret 1124 random value R_C chosen by the DSKPP client, a random value R_S 1125 chosen by the DSKPP server, and the key k used to encrypt R_C. The 1126 input parameter s of DSKPP-PRF is set to the concatenation of the 1127 (ASCII) string "Key generation", k, and R_S, and the input parameter 1128 dsLen is set to the desired length of the key, K_TOKEN (the length of 1129 K_TOKEN is given by the key's type): 1131 dsLen = (desired length of K_TOKEN) 1133 K_TOKEN = DSKPP-PRF (R_C, "Key generation" || k || R_S, dsLen) 1135 When computing K_TOKEN above, the output of DSKPP-PRF MAY be subject 1136 to an algorithm-dependent transform before being adopted as a key of 1137 the selected type. One example of this is the need for parity in DES 1138 keys. 1140 4.7. Encryption of Pseudorandom Nonces Sent from the DSKPP Client 1142 DSKPP client random nonce(s) are either encrypted with the public key 1143 provided by the DSKPP server or by a shared secret key. For example, 1144 in the case of a public RSA key, an RSA encryption scheme from PKCS 1145 #1 [PKCS-1] MAY be used. 1147 In the case of a shared secret key, to avoid dependence on other 1148 algorithms, the DSKPP client MAY use the DSKPP-PRF function described 1149 herein with the shared secret key K_SHARED as input parameter k (in 1150 this case, K_SHARED SHOULD be used solely for this purpose), the 1151 concatenation of the (ASCII) string "Encryption" and the server's 1152 nonce R_S as input parameter s, and dsLen set to the length of R_C: 1154 dsLen = len(R_C) 1156 DS = DSKPP-PRF(K_SHARED, "Encryption" || R_S, dsLen) 1158 This will produce a pseudorandom string DS of length equal to R_C. 1159 Encryption of R_C MAY then be achieved by XOR-ing DS with R_C: 1161 Enc-R_C = DS ^ R_C 1163 The DSKPP server will then perform the reverse operation to extract 1164 R_C from Enc-R_C. 1166 Note: It may appear that an attacker, who learns a previous value of 1167 R_C, may be able to replay the corresponding R_S and, hence, learn a 1168 new R_C as well. However, this attack is mitigated by the 1169 requirement for a server to show knowledge of K_AUTH (see below) in 1170 order to successfully complete a key re-generation. 1172 4.8. MAC calculations 1174 4.8.1. Four-pass DSKPP 1176 4.8.1.1. Server Authentication: 1178 The MAC value MUST be computed on the (ASCII) string "MAC 1 1179 computation", the client's nonce R (if sent), and the server's nonce 1180 R_S using an authentication key K_AUTH that SHOULD be a special 1181 authentication key used only for this purpose but MAY be the current 1182 K_TOKEN. 1184 The MAC value MAY be computed by using the DSKPP-PRF function of 1185 Section 4.5, in which case the input parameter s MUST be set to the 1186 concatenation of the (ASCII) string "MAC 1 computation", R (if sent 1187 by the client), and R_S, and k MUST be set to K_AUTH. The input 1188 parameter dsLen MUST be set to the length of R_S: 1190 dsLen = len(R_S) 1192 MAC = DSKPP-PRF (K_AUTH, "MAC 1 computation" || [R ||] R_S, dsLen) 1194 4.8.1.2. Server Authentication: 1196 The MAC value MUST be computed on the (ASCII) string "MAC 2 1197 computation" and R_C using an authentication key K_AUTH. Again, this 1198 SHOULD be a special authentication key used only for this purpose, 1199 but MAY also be an existing K_TOKEN. (In this case, implementations 1200 MUST protect against attacks where K_TOKEN is used to pre-compute MAC 1201 values.) If no authentication key is present in the cryptographic 1202 module, and no K_TOKEN existed before the DSKPP run, K_AUTH MUST be 1203 the newly generated K_TOKEN. 1205 If DSKPP-PRF is used as the MAC algorithm, then the input parameter s 1206 MUST consist of the concatenation of the (ASCII) string "MAC 2 1207 computation", R_C, the parameter dsLen MUST be set to the length of 1208 R_C: 1210 dsLen = len(R_C) 1212 MAC = DSKPP-PRF (K_AUTH, "MAC 2 computation" || R_C, dsLen) 1214 4.8.2. Two-pass DSKPP 1216 4.8.2.1. Key Confirmation 1218 In two-pass DSKPP, the client is REQUIRED to include a nonce R in the 1219 message. Further, the server is REQUIRED to include an 1220 identifier, ID_S, for itself (via the key container) in the 1221 message. The MAC value in the 1222 message MUST be computed on the (ASCII) string "MAC 1 computation", 1223 the server identifier ID_S, and R using a MAC key K_MAC. Again, in 1224 contrast with the MAC calculation in the four-pass DSKPP, this key 1225 MUST be provided together with K_TOKEN to the cryptographic module, 1226 and hence there is no need for a K_AUTH for key confirmation 1227 purposes. 1229 If DSKPP-PRF is used as the MAC algorithm, then the input parameter s 1230 MUST consist of the concatenation of the (ASCII) string "MAC 1 1231 computation" and R, and the parameter dsLen MUST be set to the length 1232 of R: 1234 dsLen = len(R) 1235 MAC = DSKPP-PRF (K_MAC, "MAC 1 computation" || ID_S || R, dsLen) 1237 4.8.2.2. Server Authentication 1239 As discussed in Section 4.3.2, servers need to authenticate 1240 themselves when attempting to replace an existing K_TOKEN. In 2-pass 1241 DSKPP, servers authenticate themselves by including a second MAC 1242 value in the AuthenticationDataType element. The MAC value in the 1243 AuthenticationDataType element MUST be computed on the (ASCII) string 1244 "MAC 1 computation", the server identifier ID_S, and R, using the 1245 existing MAC key K_MAC' (the MAC key that existed before this 1246 protocol run). The MAC algorithm MUST be the same as the algorithm 1247 used for key confirmation purposes. 1249 If DSKPP-PRF is used as the MAC algorithm, then the input parameter s 1250 MUST consist of the concatenation of the (ASCII) string "MAC 1 1251 computation" ID_S, and R. The parameter dsLen MUST be set to at least 1252 16 (i.e. the length of the MAC MUST be at least 16 octets): 1254 dsLen >= 16 1256 MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || ID_S || R, dsLen) 1258 4.8.3. One-pass DSKPP 1260 4.8.3.1. Key Confirmation 1262 In one-pass DSKPP, the server MUST include an identifier, ID_S, for 1263 itself (via the key container) in the message. The 1264 MAC value in the message MUST be computed on the 1265 (ASCII) string "MAC 1 computation", the server identifier ID_S, and 1266 an unsigned integer value I, using a MAC key K_MAC. The value I MUST 1267 be monotonically increasing and guaranteed not to be used again by 1268 this server towards this cryptographic module. It could for example 1269 be the number of seconds since some point in time with sufficient 1270 granularity, a counter value, or a combination of the two where the 1271 counter value is reset for each new time value. In contrast to the 1272 MAC calculation in four-pass DSKPP, the MAC key K_MAC MUST be 1273 provided together with K_TOKEN to the cryptographic module, and hence 1274 there is no need for a K_AUTH for key confirmation purposes. 1276 Note: The integer I does not necessarily need to be maintained per 1277 cryptographic module by the DSKPP server (it is enough if the server 1278 can guarantee that the same value is never being sent twice to the 1279 same cryptographic module). 1281 If DSKPP-PRF is used as the MAC algorithm, then the input parameter s 1282 MUST consist of the concatenation of the (ASCII) string "MAC 1 1283 computation", ID_S, and I. The parameter dsLen MUST be set to at 1284 least 16 (i.e. the length of the MAC MUST be at least 16 octets): 1286 dsLen >= 16 1288 MAC = DSKPP-PRF (K_MAC, "MAC 1 computation" || ID_S || I, dsLen) 1290 The server MUST provide I to the client in the Nonce attribute of the 1291 element of the message using the 1292 AuthenticationCodeMacType defined in Section 4.9.12. 1294 4.8.3.2. Server Authentication 1296 As discussed in Section 4.3.2, servers need to authenticate 1297 themselves when attempting to replace an existing K_TOKEN. In 1-pass 1298 DSKPP, servers authenticate themselves by including a second MAC 1299 value in the AuthenticationDataType element. The MAC value in the 1300 AuthenticationDataType element MUST be computed on the (ASCII) string 1301 "MAC 1 computation", the server identifier ID_S, and a new value I', 1302 I' > I, using the existing MAC key K_MAC' (the MAC key that existed 1303 before this protocol run). The MAC algorithm MUST be the same as the 1304 algorithm used for key confirmation purposes. 1306 If DSKPP-PRF is used as the MAC algorithm, then the input parameter s 1307 MUST consist of the concatenation of the (ASCII) string "MAC 1 1308 computation" ID_S, and I'. The parameter dsLen MUST be set to at 1309 least 16 (i.e. the length of the MAC MUST be at least 16 octets): 1311 dsLen >= 16 1313 MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || ID_S || I', dsLen) 1315 The server MUST provide I' to the client in the Nonce attribute of 1316 the element of the AuthenticationDataType extension. If the 1317 protocol run is successful, the client stores I' as the new value of 1318 I for this server. 1320 4.9. DSKPP Schema Basics 1322 This section describes the schema used by DSKPP. The DSKPP XML 1323 schema itself can be found in Section 6. Specific protocol message 1324 elements are defined in Section 4.10. Examples can be found in 1325 Appendix B. 1327 Some DSKPP elements rely on the parties being able to compare 1328 received values with stored values. Unless otherwise noted, all 1329 elements in this document that have the XML Schema "xs:string" type, 1330 or a type derived from it, MUST be compared using an exact binary 1331 comparison. In particular, DSKPP implementations MUST NOT depend on 1332 case-insensitive string comparisons, normalization or trimming of 1333 white space, or conversion of locale-specific formats such as 1334 numbers. 1336 Implementations that compare values that are represented using 1337 different character encodings MUST use a comparison method that 1338 returns the same result as converting both values to the Unicode 1339 character encoding, Normalization Form C [UNICODE], and then 1340 performing an exact binary comparison. 1342 No collation or sorting order for attributes or element values is 1343 defined. Therefore, DSKPP implementations MUST NOT depend on 1344 specific sorting orders for values. 1346 4.9.1. The AbstractRequestType Type 1348 All DSKPP requests are defined as extensions to the abstract 1349 AbstractRequestType type. The elements of the AbstractRequestType, 1350 therefore, apply to all DSKPP requests. All DSKPP requests MUST 1351 contain a Version attribute. For this version of this specification, 1352 Version MUST be set to "1.0". 1354 1355 1356 1358 4.9.2. The AbstractResponseType Type 1360 All DSKPP responses are defined as extensions to the abstract 1361 AbstractResponseType type. The elements of the AbstractResponseType, 1362 therefore, apply to all DSKPP responses. All DSKPP responses contain 1363 a Version attribute indicating the version that was used. A Status 1364 attribute, which indicates whether the preceding request was 1365 successful or not MUST also be present. Finally, all responses MAY 1366 contain a SessionID attribute identifying the particular DSKPP 1367 session. The SessionID attribute needs only be present if more than 1368 one roundtrip is REQUIRED for a successful protocol run (this is the 1369 case with the protocol version described herein). 1371 1372 1373 1374 1375 1377 4.9.3. The VersionType Type 1379 The VersionType type is used within DSKPP messages to identify the 1380 highest version of this protocol supported by the DSKPP client and 1381 server. 1383 1384 1385 1386 1387 1389 4.9.4. The IdentifierType Type 1391 The IdentifierType type is used to identify various DSKPP elements, 1392 such as sessions, users, and services. Identifiers MUST NOT be 1393 longer than 128 octets. 1395 1396 1397 1398 1399 1401 4.9.5. The StatusCode Type 1403 The StatusCode type enumerates all possible return codes: 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1425 Upon transmission or receipt of a message for which the Status 1426 attribute's value is not "Success" or "Continue", the default 1427 behavior, unless explicitly stated otherwise below, is that both the 1428 DSKPP server and the DSKPP client MUST immediately terminate the 1429 DSKPP session. DSKPP servers and DSKPP clients MUST delete any 1430 secret values generated as a result of failed runs of the DSKPP 1431 protocol. Session identifiers MAY be retained from successful or 1432 failed protocol runs for replay detection purposes, but such retained 1433 identifiers MUST not be reused for subsequent runs of the protocol. 1435 When possible, the DSKPP client SHOULD present an appropriate error 1436 message to the user. 1438 These status codes are valid in all DSKPP Response messages unless 1439 explicitly stated otherwise: 1440 o "Continue" indicates that the DSKPP server is ready for a 1441 subsequent request from the DSKPP client. It cannot be sent in 1442 the server's final message. 1443 o "Success" indicates successful completion of the DSKPP session. 1444 It can only be sent in the server's final message. 1445 o "Abort" indicates that the DSKPP server rejected the DSKPP 1446 client's request for unspecified reasons. 1447 o "AccessDenied" indicates that the DSKPP client is not authorized 1448 to contact this DSKPP server. 1449 o "MalformedRequest" indicates that the DSKPP server failed to parse 1450 the DSKPP client's request. 1452 o "UnknownRequest" indicates that the DSKPP client made a request 1453 that is unknown to the DSKPP server. 1454 o "UnknownCriticalExtension" indicates that a critical DSKPP 1455 extension (see below) used by the DSKPP client was not supported 1456 or recognized by the DSKPP server. 1457 o "UnsupportedVersion" indicates that the DSKPP client used a DSKPP 1458 protocol version not supported by the DSKPP server. This error is 1459 only valid in the DSKPP server's first response message. 1460 o "NoSupportedKeyTypes" indicates that the DSKPP client only 1461 suggested key types that are not supported by the DSKPP server. 1462 This error is only valid in the DSKPP server's first response 1463 message. 1464 o "NoSupportedEncryptionAlgorithms" indicates that the DSKPP client 1465 only suggested encryption algorithms that are not supported by the 1466 DSKPP server. This error is only valid in the DSKPP server's 1467 first response message. Note that the error will only occur if 1468 the DSKPP server does not support any of the DSKPP client's 1469 suggested encryption algorithms. 1470 o "NoSupportedMACAlgorithms" indicates that the DSKPP client only 1471 suggested MAC algorithms that are not supported by the DSKPP 1472 server. This error is only valid in the DSKPP server's first 1473 response message. Note that the error will only occur if the 1474 DSKPP server does not support any of the DSKPP client's suggested 1475 MAC algorithms. 1476 o "NoProtocolVariants" indicates that the DSKPP client only 1477 suggested a protocol variant (either 2-pass or 4-pass) that is not 1478 supported by the DSKPP server. This error is only valid in the 1479 DSKPP server's first response message. Note that the error will 1480 only occur if the DSKPP server does not support any of the DSKPP 1481 client's suggested protocol variants. 1482 o "NoSupportedKeyContainers" indicates that the DSKPP client only 1483 suggested key container formats that are not supported by the 1484 DSKPP server. This error is only valid in the DSKPP server's 1485 first response message. Note that the error will only occur if 1486 the DSKPP server does not support any of the DSKPP client's 1487 suggested key container formats. 1488 o "AuthenticationDataInvalid" indicates that the DSKPP client 1489 supplied user or device authentication data that the DSKPP server 1490 failed to validate. 1491 o "InitializationFailed" indicates that the DSKPP server could not 1492 generate a valid key given the provided data. When this status 1493 code is received, the DSKPP client SHOULD try to restart DSKPP, as 1494 it is possible that a new run will succeed. 1496 4.9.6. The DeviceIdentifierDataType Type 1498 The DeviceIdentifierDataType type is used to uniquely identify the 1499 device that houses the cryptographic module, e.g., a mobile phone. 1501 The device identifier allows the DSKPP server to find, e.g., a pre- 1502 shared transport key for 2-pass DSKPP and/or the correct shared 1503 secret for MAC'ing purposes. The default DeviceIdentifierDataType is 1504 defined in [PSKC]. 1506 1507 1508 1509 1510 1511 1513 4.9.7. The TokenPlatformInfoType and PlatformType Types 1515 The TokenPlatformInfoType type is used to carry characteristics of 1516 the intended cryptographic module platform, and applies in the 1517 public-key variant of DSKPP in situations when the client potentially 1518 needs to select a cryptographic module to initialize. 1520 1521 1522 1523 1524 1525 1526 1528 1529 1530 1531 1533 4.9.8. The NonceType Type 1535 The NonceType type is used to carry pseudorandom values in DSKPP 1536 messages. A nonce, as the name implies, MUST be used only once. For 1537 each DSKPP message that requires a nonce element to be sent, a fresh 1538 nonce MUST be generated each time. Nonce values MUST be at least 16 1539 octets long. 1541 1542 1543 1544 1545 1547 4.9.9. The AlgorithmsType Type 1549 The AlgorithmsType type is a list of type-value pairs that define 1550 algorithms supported by a DSKPP client or server. Algorithms are 1551 identified through URIs. 1553 1554 1555 1556 1557 1559 1560 1561 1563 4.9.10. The ProtocolVariantsType and the TwoPassSupportType Types 1565 The ProtocolVariantsType type is OPTIONALLY used by the DSKPP client 1566 to indicate the number of passes of the DSKPP protocol that it 1567 supports (see Section 4.2). The ProtocolVariantsType MAY be used to 1568 indicate support for 4-pass or 2-pass DSKPP. Because 1-pass DSKPP 1569 does not include a client request to the server, the 1570 ProtocolVariantsType type MAY NOT be used to indicate support for 1571 1-pass DSKPP. If the ProtocolVariantsType is not used, then the 1572 DSKPP server will proceed with ordinary 4-pass DSKPP. However, it 1573 does not support 4-pass DSKPP, then the server MUST find a suitable 1574 two-pass variant or else the protocol run will fail. 1576 1577 1578 1579 1581 1582 1583 1585 1586 1587 1589 1590 1591 1593 The TwoPassSupportType type signals client support for the 2-pass 1594 version of DSKPP, informs the server of supported two-pass variants, 1595 and provides OPTIONAL payload data to the DSKPP server. The payload 1596 is sent in an opportunistic fashion, and MAY be discarded by the 1597 DSKPP server if the server does not support the two-pass variant the 1598 payload is associated with. The elements of this type have the 1599 following meaning: 1600 o : A two-pass key initialization 1601 method supported by the DSKPP client. Multiple supported methods 1602 MAY be present, in which case they MUST be listed in order of 1603 precedence. 1604 o : An OPTIONAL payload associated with each supported key 1605 initialization method. 1606 A DSKPP client that indicates support for two-pass DSKPP MUST also 1607 include the nonce R in its message (this will enable 1608 the client to verify that the DSKPP server it is communicating with 1609 is alive). 1611 4.9.11. The KeyContainersFormatTypeType 1613 The KeyContainersFormatType type is a list of type-value pairs that 1614 are OPTIONALLY used to define key container formats supported by a 1615 DSKPP client or server. Key container formats are identified through 1616 URIs, e.g., the PSKC URI 1617 "http://www.openauthentication.org/OATH/2006/10/PSKC#KeyContainer" 1618 (see [PSKC]. 1620 1621 1622 1624 1625 1627 1628 1629 1631 4.9.12. The AuthenticationDataType Type 1633 The AuthenticationDataType type is OPTIONALLY used to carry client or 1634 server authentication values in DSKPP messages (see Section 4.3). 1635 The element MAY be used as follows: 1636 a. A DSKPP client MAY include a one-time use AuthenticationCode that 1637 was given by the issuer to the user for acquiring a symmetric 1638 key. An AuthenticationCode MAY or MAY NOT contain alphanumeric 1639 characters in addition to numeric digits depending on the device 1640 type and policy of the issuer. For example, if the device is a 1641 mobile phone, a code that the user enters on the keypad would 1642 typically be restricted to numeric digits for ease of use. An 1643 activation code can be sent to the DSKPP server in plaintext 1644 form, hashed data form, or keyed hash data form depending on the 1645 underlying transport protocol. 1646 b. A DSKPP client MAY include an AuthenticationCertificate that 1647 contains a certificate issued with the device by the issuer. 1648 c. A DSKPP server MAY use the AuthenticationDataType element 1649 AuthenticationCodeMac to carry a MAC for authenticating itself to 1650 the client. For example, when a successful 1- or 2-pass DSKPP 1651 protocol run will result in an existing key being replaced, then 1652 the DSKPP server MUST include a MAC proving to the DSKPP client 1653 that the server knows the value of the key it is about to 1654 replace. 1656 1657 1658 1660 1661 1663 1665 1667 1669 1670 1671 1673 1674 1675 1676 1677 1679 1680 1681 1682 1684 1685 1686 1688 1689 1690 1691 1692 1693 1695 1696 1698 The element of the AuthenticationDataType type have the following 1699 meaning: 1700 o : A requestor's identifier. The value MAY be a user ID, 1701 a device ID, or a keyID associated with the requestor's 1702 authentication value. When the authentication data is based on a 1703 certificate, can be omitted, as the certificate itself 1704 is typically sufficient to identify the requestor. Also, if a 1705 message was provided by the server to initiate the 1706 DSKPP protocol run, can be omitted, as the DeviceID, 1707 KeyID, and/or nonce provided in the 1708 element ought to be sufficient to identify the requestor. 1709 o : A one-time use value sent in the clear to 1710 the DSKPP server. 1711 o : A one-time use value sent in digest 1712 form to the DSKPP server. 1713 o : An authentication MAC and OPTIONAL 1714 additional information (e.g., MAC algorithm). The value could be 1715 a one-time use value sent as a MAC value to the DSKPP server; or, 1716 it could be a MAC value sent to the DSKPP client, where the MAC is 1717 calculated as described in Section 4.8. 1718 o : A device certificate sent to the 1719 DSKPP server. 1721 4.9.13. The PayloadType Type 1723 The PayloadType type is used to carry data in a DSKPP client or 1724 server message. For this version of the protocol, only one payload 1725 is defined, the pseudorandom string R_S, for one message, the DSKPP 1726 . 1728 1729 1730 1731 1732 1733 1735 4.9.14. The MacType Type 1737 The MacType type is used by the DSKPP server to carry a MAC value 1738 that the DSKPP server uses to authenticate itself to the client. 1740 1741 1742 1743 1744 1745 1746 1748 4.9.15. The KeyContainerType Type 1750 The KeyContainerType type is used by the DSKPP server in its final 1751 message to carry symmetric key(s) (in the 2- and 1-pass exchanges) 1752 and configuration data. The default element defined for the 1753 KeyContainerType is contained in the namespace defined in the PSKC 1754 namespace as KeyContainerType (see [PSKC]. 1756 1757 1758 1760 1761 1762 1764 4.9.16. The ExtensionsType and the AbstractExtensionType Types 1766 The ExtensionsType type is a list of type-value pairs that define 1767 OPTIONAL DSKPP features supported by a DSKPP client or server. 1768 Extensions MAY be sent with any DSKPP message. Please see the 1769 description of individual DSKPP messages in Section 4.11 of this 1770 document for applicable extensions. All DSKPP extensions are defined 1771 as extensions to the AbstractExtensionType type. The elements of the 1772 AbstractExtensionType, therefore, apply to all DSKPP extensions. 1773 Unless an extension is marked as Critical, a receiving party need not 1774 be able to interpret it. A receiving party is always free to 1775 disregard any (non-critical) extensions. 1777 1778 1779 1780 1781 1783 1784 1785 1787 4.10. DSKPP Messages 1789 4.10.1. Introduction 1791 In this section, DSKPP messages, including their parameters, encoding 1792 and semantics are defined. 1794 4.10.2. DSKPP Initialization (OPTIONAL) 1796 The DSKPP server MAY initialize the DSKPP protocol by sending a 1797 message. This message MAY, e.g., be sent in response 1798 to a user requesting key initialization in a browsing session. 1800 1801 1802 1804 1805 1807 1808 1809 1811 1812 1814 1816 1817 1818 1819 Message used to trigger the device to initiate a 1820 DSKPP protocol run. 1821 1822 1823 1824 1825 1827 1828 1829 1830 1831 1833 The element is intended for the DSKPP client and MAY 1834 inform the DSKPP client about the identifier for the device that 1835 houses the cryptographic module to be initialized, and, OPTIONALLY, 1836 of the identifier for the key on that module. The latter would apply 1837 to key renewal. The trigger always contains a nonce to allow the 1838 DSKPP server to couple the trigger with a later DSKPP 1839 request. Finally, the trigger MAY contain a URL to use when 1840 contacting the DSKPP server. The elements are for future 1841 extensibility. Any provided or values 1842 MUST be used by the DSKPP client in the subsequent 1843 request. The OPTIONAL element informs the DSKPP 1844 client about the characteristics of the intended cryptographic module 1845 platform, and applies in the public-key variant of DSKPP in 1846 situations when the client potentially needs to decide which one of 1847 several modules to initialize. 1849 The Version attribute MUST be set to "1.0" for this version of DSKPP. 1851 4.10.3. The DSKPP Client's Initial PDU (2- and 4-Pass) 1853 This message is the initial message sent from the DSKPP client to the 1854 DSKPP server. 1856 1858 1859 1860 1861 Message sent from DSKPP client to DSKPP server to initiate a 1862 DSKPP session. 1863 1864 1865 1866 1867 1868 1870 1872 1874 1876 1878 1880 1882 1884 1886 1888 1890 1891 1892 1893 1895 The components of this message have the following meaning: 1896 o Version: (attribute inherited from the AbstractRequestType type) 1897 The highest version of this protocol the client supports. Only 1898 version one ("1.0") is currently specified. 1899 o : An identifier for the cryptographic module 1900 as defined in Section 4.3.1 above. The identifier MUST only be 1901 present if such shared secrets exist or if the identifier was 1902 provided by the server in a element (see 1903 Section 5.2.7 below). In the latter case, it MUST have the same 1904 value as the identifier provided in that element. 1905 o : An identifier for the key that will be overwritten if the 1906 protocol run is successful. The identifier MUST only be present 1907 if the key exists or was provided by the server in a 1908 element (see Section 5.2.7 below). In the latter 1909 case, it MUST have the same value as the identifier provided in 1910 that element. 1911 o : This is the nonce R, which, when present, MUST be 1912 used by the server when calculating MAC values (see below). It is 1913 RECOMMENDED that clients include this element whenever the 1914 element is present. 1915 o : This OPTIONAL element MUST be present if and only 1916 if the DSKPP run was initialized with a message 1917 (see Section 5.2.7 below), and MUST, in that case, have the same 1918 value as the child of that message. A server using 1919 nonces in this way MUST verify that the nonce is valid and that 1920 any device or key identifier values provided in the 1921 message match the corresponding identifier values in the 1922 message. 1923 o : A sequence of URIs indicating the key types 1924 for which the cryptographic module is willing to generate keys 1925 through DSKPP. 1926 o : A sequence of URIs indicating the 1927 encryption algorithms supported by the cryptographic module for 1928 the purposes of DSKPP. The DSKPP client MAY indicate the same 1929 algorithm both as a supported key type and as an encryption 1930 algorithm. 1931 o : A sequence of URIs indicating the MAC 1932 algorithms supported by the cryptographic module for the purposes 1933 of DSKPP. The DSKPP client MAY indicate the same algorithm both 1934 as an encryption algorithm and as a MAC algorithm (e.g., 1935 urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes defined 1936 in Appendix E). 1937 o : This OPTIONAL element is used by the 1938 DSKPP client to indicate support for four-pass or two-pass DSKPP. 1939 If two-pass support is specified, then MUST be set 1940 to nonce R in the message unless is 1941 already present. 1942 o : This OPTIONAL element is a sequence of 1943 URIs indicating the key container formats supported by the DSKPP 1944 client. If this element is not provided, then the DSKPP server 1945 MUST proceed with 1946 "http://www.openauthentication.org/OATH/2006/10/PSKC#KeyContainer" 1947 (see [PSKC]. 1948 o : This OPTIONAL element contains data that the 1949 DSKPP client uses to authenticate the user or device to the DSKPP 1950 server. The element is set as specified in Section 4.3.1. 1952 o : A sequence of extensions. One extension is defined 1953 for this message in this version of DSKPP: the ClientInfoType (see 1954 Section 4.11). 1956 4.10.4. The DSKPP Server's Initial PDU (4-Pass Only) 1958 This message is the first message sent from the DSKPP server to the 1959 DSKPP client (assuming a trigger message has not been sent to 1960 initiate the protocol, in which case, this message is the second 1961 message sent from the DSKPP server to the DSKPP client). It is sent 1962 upon reception of a message. 1964 1966 1967 1968 1969 Message sent from DSKPP server to DSKPP client 1970 in response to a received ClientHello PDU. 1971 1972 1973 1974 1975 1976 1978 1980 1982 1984 1986 1988 1990 1992 1993 1994 1995 1997 The components of this message have the following meaning: 1999 o Version: (attribute inherited from the AbstractResponseType type) 2000 The version selected by the DSKPP server. MAY be lower than the 2001 version indicated by the DSKPP client, in which case, local policy 2002 at the client MUST determine whether or not to continue the 2003 session. 2004 o SessionID: (attribute inherited from the AbstractResponseType 2005 type) An identifier for this session. 2006 o Status: (attribute inherited from the AbstractResponseType type) 2007 Return code for the . If Status is not "Continue", 2008 only the Status and Version attributes will be present; otherwise, 2009 all the other element MUST be present as well. 2010 o : The type of the key to be generated. 2011 o : The encryption algorithm to use when 2012 protecting R_C. 2013 o : The MAC algorithm to be used by the DSKPP server. 2014 o : Information about the key to use when encrypting 2015 R_C. It will either be the server's public key (the 2016 alternative of ds:KeyInfoType) or an identifier for a shared 2017 secret key (the alternative of ds:KeyInfoType). 2018 o : The key container format type to be used by 2019 the DSKPP server. The default setting relies on the 2020 KeyContainerType element defined in 2021 "urn:ietf:params:xml:schema:keyprov:container" [PSKC]. 2022 o : The actual payload. For this version of the protocol, 2023 only one payload is defined: the pseudorandom string R_S. 2024 o : A list of server extensions. Two extensions are 2025 defined for this message in this version of DSKPP: the 2026 ClientInfoType and the ServerInfoType (see Section 4.11). 2027 o : The MAC MUST be present if the DSKPP run will result in the 2028 replacement of an existing symmetric key with a new one (i.e., if 2029 the element was present in the 2050 2051 2052 2053 Second message sent from DSKPP client to 2054 DSKPP server in a DSKPP session. 2055 2056 2057 2058 2059 2060 2062 2064 2066 2067 2069 2070 2071 2073 The components of this message have the following meaning: 2075 o Version: (inherited from the AbstractRequestType type) MUST be the 2076 same version as in the message. 2077 o : MUST have the same value as the SessionID attribute 2078 in the received message. 2079 o : The nonce generated and encrypted by the 2080 cryptographic module. The encryption MUST be made using the 2081 selected encryption algorithm and identified key, and as specified 2082 in Section 4.5. 2083 o : The authentication data value, which MAY 2084 OPTIONALLY be the same as provided in the , MUST be 2085 set as specified in Section 4.3.1. 2086 o : A list of extensions. Two extensions are defined 2087 for this message in this version of DSKPP: the ClientInfoType and 2088 the ServerInfoType (see Section 4.11). 2090 4.10.6. The DSKPP Server's Final PDU (1-, 2-, and 4-Pass) 2092 This message is the last message of the DSKPP protocol run. In a 2093 4-pass exchange, the DSKPP server sends this message in response to a 2094 message, whereas in a 2-pass exchange, the DSKPP server 2095 sends this message in response to a message. In a 2096 1-pass exchange, the DSKPP server sends only this message to the 2097 client. 2099 2101 2102 2103 2104 Final message sent from DSKPP server to 2105 DSKPP client in a DSKPP session. 2106 2107 2108 2109 2110 2111 2113 2115 2117 2118 2119 2120 2122 The components of this message have the following meaning: 2124 o Version: (inherited from the AbstractResponseType type) The DSKPP 2125 version used in this session. 2126 o SessionID: (inherited from the AbstractResponseType type) The 2127 previously established identifier for this session. 2128 o Status: (inherited from the AbstractResponseType type) Return code 2129 for the message. If Status is not "Success", 2130 only the Status, SessionID, and Version attributes will be present 2131 (the presence of the SessionID attribute is dependent on the type 2132 of reported error); otherwise, all the other elements MUST be 2133 present as well. In this latter case, the 2134 message can be seen as a "Commit" message, instructing the 2135 cryptographic module to store the generated key and associate the 2136 given key identifier with this key. 2137 o : The key container containing symmetric key values 2138 (in the case of a 2- or 1-pass exchange) and configuration data. 2139 The default container format is based on the KeyContainerType type 2140 from PSKC, as defined in [PSKC]. 2141 o : A list of extensions chosen by the DSKPP server. 2142 For this message, this version of DSKPP defines one extension, the 2143 ClientInfoType (see Section 4.11). 2145 o : To avoid a false "Commit" message causing the cryptographic 2146 module to end up in an initialized state for which the server does 2147 not know the stored key, messages MUST always be 2148 authenticated with a MAC. The MAC MUST be made using the already 2149 established MAC algorithm. The MAC value MUST be computed as 2150 specified in Section 4.8.1.2. 2151 When receiving a message with Status="Success" 2152 for which the MAC verifies, the DSKPP client MUST associate the 2153 generated key K_TOKEN with the provided key identifier and store 2154 this data permanently. After this operation, it MUST not be 2155 possible to overwrite the key unless knowledge of an authorizing 2156 key is proven through a MAC on a later (and 2157 ) message. 2158 The DSKPP client MUST verify the MAC. The DSKPP client MUST 2159 terminate the DSKPP session if the MAC does not verify, and MUST, 2160 in this case, also delete any nonces, keys, and/or secrets 2161 associated with the failed run of the DSKPP protocol. 2162 The MacType's MacAlgorithm attribute MUST, when present, identify 2163 the negotiated MAC algorithm. 2165 4.11. Protocol Extensions 2167 4.11.1. The ClientInfoType Type 2169 When present in a or a message, the 2170 OPTIONAL ClientInfoType extension contains DSKPP client-specific 2171 information. DSKPP servers MUST support this extension. DSKPP 2172 servers MUST NOT attempt to interpret the data it carries and, if 2173 received, MUST include it unmodified in the current protocol run's 2174 next server response. Servers need not retain the ClientInfoType's 2175 data after that response has been generated. 2177 2178 2179 2180 2181 2183 2184 2185 2186 2188 4.11.2. The ServerInfoType Type 2190 When present, the OPTIONAL ServerInfoType extension contains DSKPP 2191 server-specific information. This extension is only valid in 2192 messages for which Status = "Continue". DSKPP clients 2193 MUST support this extension. DSKPP clients MUST NOT attempt to 2194 interpret the data it carries and, if received, MUST include it 2195 unmodified in the current protocol run's next client request (i.e., 2196 the message). DSKPP clients need not retain the 2197 ServerInfoType's data after that request has been generated. This 2198 extension MAY be used, e.g., for state management in the DSKPP 2199 server. 2201 2202 2203 2204 2205 2207 2208 2209 2210 2212 4.11.3. The KeyInitializationDataType Type 2214 This extension is used for 2- and 1-pass DSKPP exchange; it carries 2215 an identifier for the selected key initialization method as well as 2216 key initialization method-dependent payload data. 2218 Servers MAY include this extension in a message that 2219 is being sent in response to a received message if and 2220 only if that message selected TwoPassSupport as the 2221 ProtocolVariantType and the client indicated support for the selected 2222 key initialization method. Servers MUST include this extension in a 2223 message that is sent as part of a 1-pass DSKPP. 2225 2226 2227 2228 This extension is only valid in ServerFinished PDUs. It 2229 contains key initialization data and its presence results in a 2230 two-pass (or one-pass, if no ClientHello was sent) DSKPP 2231 exchange. 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2244 The elements of this type have the following meaning: 2246 o : A two-pass key initialization method 2247 supported by the DSKPP client. 2248 o : A payload associated with the key initialization 2249 method. Since the syntax is a shorthand for , any well-formed payloads can 2251 be carried in this element. 2253 5. Protocol Bindings 2255 5.1. General Requirements 2257 DSKPP assumes a reliable transport. 2259 5.2. HTTP/1.1 Binding for DSKPP 2261 5.2.1. Introduction 2263 This section presents a binding of the previous messages to HTTP/1.1 2264 [RFC2616]. Note that the HTTP client normally will be different from 2265 the DSKPP client, i.e., the HTTP client will only exist to "proxy" 2266 DSKPP messages from the DSKPP client to the DSKPP server. Likewise, 2267 on the HTTP server side, the DSKPP server MAY receive DSKPP PDUs from 2268 a "front-end" HTTP server. 2270 5.2.2. Identification of DSKPP Messages 2272 The MIME-type for all DSKPP messages MUST be 2274 application/vnd.ietf.keyprov.dskpp+xml 2276 5.2.3. HTTP Headers 2278 HTTP proxies MUST NOT cache responses carrying DSKPP messages. For 2279 this reason, the following holds: 2280 o When using HTTP/1.1, requesters SHOULD: 2281 * Include a Cache-Control header field set to "no-cache, no- 2282 store". 2283 * Include a Pragma header field set to "no-cache". 2284 o When using HTTP/1.1, responders SHOULD: 2285 * Include a Cache-Control header field set to "no-cache, no-must- 2286 revalidate, private". 2287 * Include a Pragma header field set to "no-cache". 2288 * NOT include a Validator, such as a Last-Modified or ETag 2289 header. 2290 There are no other restrictions on HTTP headers, besides the 2291 requirement to set the Content-Type header value according to 2292 Section 5.2.2. 2294 5.2.4. HTTP Operations 2296 Persistent connections as defined in HTTP/1.1 are assumed but not 2297 required. DSKPP requests are mapped to HTTP POST operations. DSKPP 2298 responses are mapped to HTTP responses. 2300 5.2.5. HTTP Status Codes 2302 A DSKPP HTTP responder that refuses to perform a message exchange 2303 with a DSKPP HTTP requester SHOULD return a 403 (Forbidden) response. 2304 In this case, the content of the HTTP body is not significant. In 2305 the case of an HTTP error while processing a DSKPP request, the HTTP 2306 server MUST return a 500 (Internal Server Error) response. This type 2307 of error SHOULD be returned for HTTP-related errors detected before 2308 control is passed to the DSKPP processor, or when the DSKPP processor 2309 reports an internal error (for example, the DSKPP XML namespace is 2310 incorrect, or the DSKPP schema cannot be located). If the type of a 2311 DSKPP request cannot be determined, the DSKPP responder MUST return a 2312 400 (Bad request) response. 2314 In these cases (i.e., when the HTTP response code is 4xx or 5xx), the 2315 content of the HTTP body is not significant. 2317 Redirection status codes (3xx) apply as usual. 2319 Whenever the HTTP POST is successfully invoked, the DSKPP HTTP 2320 responder MUST use the 200 status code and provide a suitable DSKPP 2321 message (possibly with DSKPP error information included) in the HTTP 2322 body. 2324 5.2.6. HTTP Authentication 2326 No support for HTTP/1.1 authentication is assumed. 2328 5.2.7. Initialization of DSKPP 2330 The DSKPP server MAY initialize the DSKPP protocol by sending an HTTP 2331 response with Content-Type set according to Section 5.2.2 and 2332 response code set to 200 (OK). This message MAY, e.g., be sent in 2333 response to a user requesting key initialization in a browsing 2334 session. The initialization message MAY carry data in its body. If 2335 this is the case, the data MUST be a valid instance of a 2336 element. 2338 5.2.8. Example Messages 2340 a. Initialization from DSKPP server: 2341 HTTP/1.1 200 OK 2343 Cache-Control: no-store 2344 Content-Type: application/vnd.ietf.keyprov.dskpp+xml 2345 Content-Length: 2347 DSKPP initialization data in XML form... 2349 b. Initial request from DSKPP client: 2350 POST http://example.com/cgi-bin/DSKPP-server HTTP/1.1 2351 Cache-Control: no-store 2352 Pragma: no-cache 2353 Host: example.com 2354 Content-Type: application/vnd.ietf.keyprov.dskpp+xml 2355 Content-Length: 2357 DSKPP data in XML form (supported version, supported 2358 algorithms...) 2360 c. Initial response from DSKPP server: 2361 HTTP/1.1 200 OK 2363 Cache-Control: no-store 2364 Content-Type: application/vnd.ietf.keyprov.dskpp+xml 2365 Content-Length: 2366 DSKPP data in XML form (server random nonce, server public key, 2367 ...) 2369 6. DSKPP Schema 2371 2373 2380 2384 2385 2386 2387 2389 2390 2391 2392 2393 2395 2396 2397 2398 2399 2401 2402 2403 2404 2405 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2427 2428 2429 2430 2431 2432 2434 2435 2436 2437 2438 2439 2440 2442 2443 2444 2445 2447 2448 2449 2450 2451 2453 2454 2455 2456 2457 2459 2460 2461 2463 2464 2465 2466 2468 2469 2470 2472 2473 2474 2476 2477 2478 2480 2481 2482 2484 2485 2487 2488 2489 2491 2492 2493 2495 2496 2498 2500 2502 2504 2505 2506 2507 2508 2509 2510 2511 2513 2514 2515 2516 2518 2519 2520 2522 2523 2524 2525 2526 2527 2529 2530 2532 2533 2534 2535 2536 2537 2539 2540 2541 2542 2543 2544 2545 2547 2548 2549 2551 2552 2553 2554 2555 2556 2558 2559 2561 2562 2563 2565 2566 2568 2569 2570 2571 2572 2573 2575 2576 2577 2579 2580 2581 2582 2583 2585 2586 2587 2588 2590 2591 2592 2593 2594 2596 2597 2598 2599 2601 2602 2603 2604 This extension is only valid in ServerFinished PDUs. It 2605 contains key initialization data and its presence results in a 2606 two-pass (or one-pass, if no ClientHello was sent) DSKPP 2607 exchange. 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2620 2622 2623 2625 2626 2627 2628 Message used to trigger the device to initiate a 2629 DSKPP protocol run. 2630 2631 2632 2633 2634 2636 2637 2638 2639 2640 2642 2643 2645 2646 2647 2648 Message sent from DSKPP client to DSKPP server to initiate a 2649 DSKPP session. 2651 2652 2653 2654 2655 2656 2658 2660 2662 2664 2666 2668 2670 2672 2674 2676 2678 2679 2680 2681 2683 2684 2686 2687 2688 2689 Message sent from DSKPP server to DSKPP client 2690 in response to a received ClientHello PDU. 2691 2692 2693 2694 2695 2696 2698 2700 2702 2704 2706 2708 2710 2712 2713 2714 2715 2717 2718 2720 2721 2722 2723 Second message sent from DSKPP client to 2724 DSKPP server in a DSKPP session. 2725 2726 2727 2728 2729 2730 2732 2734 2736 2737 2739 2740 2741 2743 2744 2746 2747 2748 2749 Final message sent from DSKPP server to 2750 DSKPP client in a DSKPP session. 2751 2752 2753 2754 2755 2756 2758 2760 2762 2763 2764 2765 2767 2769 7. Security Considerations 2771 7.1. General 2773 DSKPP is designed to protect generated key material from exposure. 2774 No other entities than the DSKPP server and the cryptographic module 2775 will have access to a generated K_TOKEN if the cryptographic 2776 algorithms used are of sufficient strength and, on the DSKPP client 2777 side, generation and encryption of R_C and generation of K_TOKEN take 2778 place as specified and in the cryptographic module. This applies 2779 even if malicious software is present in the DSKPP client. However, 2780 as discussed in the following, DSKPP does not protect against certain 2781 other threats resulting from man-in-the-middle attacks and other 2782 forms of attacks. DSKPP SHOULD, therefore, be run over a transport 2783 providing privacy and integrity, such as HTTP over Transport Layer 2784 Security (TLS) with a suitable ciphersuite, when such threats are a 2785 concern. Note that TLS ciphersuites with anonymous key exchanges are 2786 not suitable in those situations. 2788 7.2. Active Attacks 2790 7.2.1. Introduction 2792 An active attacker MAY attempt to modify, delete, insert, replay, or 2793 reorder messages for a variety of purposes including service denial 2794 and compromise of generated key material. Section 7.2.2 through 2795 Section 7.2.7. 2797 7.2.2. Message Modifications 2799 Modifications to a message will either cause denial- 2800 of-service (modifications of any of the identifiers or the nonce) or 2801 the DSKPP client to contact the wrong DSKPP server. The latter is in 2802 effect a man-in-the-middle attack and is discussed further in 2803 Section 7.2.7. 2805 An attacker may modify a message. This means that the 2806 attacker could indicate a different key or device than the one 2807 intended by the DSKPP client, and could also suggest other 2808 cryptographic algorithms than the ones preferred by the DSKPP client, 2809 e.g., cryptographically weaker ones. The attacker could also suggest 2810 earlier versions of the DSKPP protocol, in case these versions have 2811 been shown to have vulnerabilities. These modifications could lead 2812 to an attacker succeeding in initializing or modifying another 2813 cryptographic module than the one intended (i.e., the server 2814 assigning the generated key to the wrong module), or gaining access 2815 to a generated key through the use of weak cryptographic algorithms 2816 or protocol versions. DSKPP implementations MAY protect against the 2817 latter by having strict policies about what versions and algorithms 2818 they support and accept. The former threat (assignment of a 2819 generated key to the wrong module) is not possible when the shared- 2820 key variant of DSKPP is employed (assuming existing shared keys are 2821 unique per cryptographic module), but is possible in the public-key 2822 variant. Therefore, DSKPP servers MUST NOT accept unilaterally 2823 provided device identifiers in the public-key variant. This is also 2824 indicated in the protocol description. In the shared-key variant, 2825 however, an attacker may be able to provide the wrong identifier 2826 (possibly also leading to the incorrect user being associated with 2827 the generated key) if the attacker has real-time access to the 2828 cryptographic module with the identified key. In other words, the 2829 generated key is associated with the correct cryptographic module but 2830 the module is associated with the incorrect user. See further 2831 Section 7.5 for a discussion of this threat and possible 2832 countermeasures. 2834 An attacker may also modify a message. This means that 2835 the attacker could indicate different key types, algorithms, or 2836 protocol versions than the legitimate server would, e.g., 2837 cryptographically weaker ones. The attacker could also provide a 2838 different nonce than the one sent by the legitimate server. Clients 2839 will protect against the former through strict adherence to policies 2840 regarding permissible algorithms and protocol versions. The latter 2841 (wrong nonce) will not constitute a security problem, as a generated 2842 key will not match the key generated on the legitimate server. Also, 2843 whenever the DSKPP run would result in the replacement of an existing 2844 key, the element protects against modifications of R_S. 2846 Modifications of messages are also possible. If an 2847 attacker modifies the SessionID attribute, then, in effect, a switch 2848 to another session will occur at the server, assuming the new 2849 SessionID is valid at that time on the server. It still will not 2850 allow the attacker to learn a generated K_TOKEN since R_C has been 2851 wrapped for the legitimate server. Modifications of the 2852 element, e.g., replacing it with a value for which 2853 the attacker knows an underlying R'C, will not result in the client 2854 changing its pre-DSKPP state, since the server will be unable to 2855 provide a valid MAC in its final message to the client. The server 2856 MAY, however, end up storing K'TOKEN rather than K_TOKEN. If the 2857 cryptographic module has been associated with a particular user, then 2858 this could constitute a security problem. For a further discussion 2859 about this threat, and a possible countermeasure, see Section 7.5 2860 below. Note that use of Secure Socket Layer (SSL) or TLS does not 2861 protect against this attack if the attacker has access to the DSKPP 2862 client (e.g., through malicious software, "trojans"). 2864 Finally, attackers may also modify the message. 2865 Replacing the element will only result in denial-of-service. 2866 Replacement of any other element may cause the DSKPP client to 2867 associate, e.g., the wrong service with the generated key. DSKPP 2868 SHOULD be run over a transport providing privacy and integrity when 2869 this is a concern. 2871 7.2.3. Message Deletion 2873 Message deletion will not cause any other harm than denial-of- 2874 service, since a cryptographic module MUST NOT change its state 2875 (i.e., "commit" to a generated key) until it receives the final 2876 message from the DSKPP server and successfully has processed that 2877 message, including validation of its MAC. A deleted 2878 message will not cause the server to end up in an inconsistent state 2879 vis-a-vis the cryptographic module if the server implements the 2880 suggestions in Section 7.5. 2882 7.2.4. Message Insertion 2884 An active attacker may initiate a DSKPP run at any time, and suggest 2885 any device identifier. DSKPP server implementations MAY receive some 2886 protection against inadvertently initializing a key or inadvertently 2887 replacing an existing key or assigning a key to a cryptographic 2888 module by initializing the DSKPP run by use of the . 2889 The element allows the server to associate a DSKPP 2890 protocol run with, e.g., an earlier user-authenticated session. The 2891 security of this method, therefore, depends on the ability to protect 2892 the element in the DSKPP initialization message. If 2893 an eavesdropper is able to capture this message, he may race the 2894 legitimate user for a key initialization. DSKPP over a transport 2895 providing privacy and integrity, coupled with the recommendations in 2896 Section 7.5, is RECOMMENDED when this is a concern. 2898 Insertion of other messages into an existing protocol run is seen as 2899 equivalent to modification of legitimately sent messages. 2901 7.2.5. Message Replay 2903 During 4-pass DSKPP, attempts to replay a previously recorded DSKPP 2904 message will be detected, as the use of nonces ensures that both 2905 parties are live. For example, a DSKPP client knows that a server it 2906 is communicating with is "live" since the server MUST create a MAC on 2907 information sent by the client. 2909 The same is true for 2-pass DSKPP thanks to the requirement that the 2910 client sends R in the message and that the server 2911 includes R in the MAC computation. 2913 In 1-pass DSKPP clients that record the latest I used by a particular 2914 server (as identified by ID_S) will be able to detect replays. 2916 7.2.6. Message Reordering 2918 An attacker may attempt to re-order 4-pass DSKPP messages but this 2919 will be detected, as each message is of a unique type. Note: Message 2920 re-ordering attacks cannot occur in 2- and 1-pass DSKPP since each 2921 party sends at most one message each. 2923 7.2.7. Man-in-the-Middle 2925 In addition to other active attacks, an attacker posing as a man in 2926 the middle may be able to provide his own public key to the DSKPP 2927 client. This threat and countermeasures to it are discussed in 2928 Section 4.2. An attacker posing as a man-in-the-middle may also be 2929 acting as a proxy and, hence, may not interfere with DSKPP runs but 2930 still learn valuable information; see Section 7.3. 2932 7.3. Passive Attacks 2934 Passive attackers may eavesdrop on DSKPP runs to learn information 2935 that later on may be used to impersonate users, mount active attacks, 2936 etc. 2938 If DSKPP is not run over a transport providing privacy, a passive 2939 attacker may learn: 2940 o What cryptographic modules a particular user is in possession of; 2941 o The identifiers of keys on those crypotgraphic modules and other 2942 attributes pertaining to those keys, e.g., the lifetime of the 2943 keys; and 2944 o DSKPP versions and cryptographic algorithms supported by a 2945 particular DSKPP client or server. 2946 Whenever the above is a concer, DSKPP SHOULD be run over a transport 2947 providing privacy. If man-in-the-middle attacks for the purposes 2948 described above are a concern, the transport SHOULD also offer 2949 server-side authentication. 2951 7.4. Cryptographic Attacks 2953 An attacker with unlimited access to an initialized cryptographic 2954 module may use the module as an "oracle" to pre-compute values that 2955 later on may be used to impersonate the DSKPP server. Section 4.7 2956 and Section 4.10 contain discussions of this threat and steps 2957 RECOMMENDED to protect against it. 2959 7.5. Attacks on the Interaction between DSKPP and User Authentication 2961 If keys generated in DSKPP will be associated with a particular user 2962 at the DSKPP server (or a server trusted by, and communicating with 2963 the DSKPP server), then in order to protect against threats where an 2964 attacker replaces a client-provided encrypted R_C with his own R'C 2965 (regardless of whether the public-key variant or the shared-secret 2966 variant of DSKPP is employed to encrypt the client nonce), the server 2967 SHOULD not commit to associate a generated K_TOKEN with the given 2968 cryptographic module until the user simultaneously has proven both 2969 possession of the device that hosts the cryptographic module 2970 containing K_TOKEN and some out-of-band provided authenticating 2971 information (e.g., a temporary password). For example, if the 2972 cryptographic module is a one-time password token, the user could be 2973 required to authenticate with both a one-time password generated by 2974 the cryptographic module and an out-of-band provided temporary PIN in 2975 order to have the server "commit" to the generated OTP value for the 2976 given user. Preferably, the user SHOULD perform this operation from 2977 another host than the one used to initialize keys on the 2978 cryptographic module, in order to minimize the risk of malicious 2979 software on the client interfering with the process. 2981 Note: This scenario, wherein the attacker replaces a client-provided 2982 R_C with his own R'C, does not apply to 2- and 1-pass DSKPP as the 2983 client does not provide any entropy to K_TOKEN. The attack as such 2984 (and its countermeasures) still applies to 2- and 1-pass DSKPP, 2985 however, as it essentially is a man-in-the-middle attack. 2987 Another threat arises when an attacker is able to trick a user to 2988 authenticate to the attacker rather than to the legitimate service 2989 before the DSKPP protocol run. If successful, the attacker will then 2990 be able to impersonate the user towards the legitimate service, and 2991 subsequently receive a valid DSKPP trigger. If the public-key 2992 variant of DSKPP is used, this may result in the attacker being able 2993 to (after a successful DSKPP protocol run) impersonate the user. 2994 Ordinary precautions MUST, therefore, be in place to ensure that 2995 users authenticate only to legitimate services. 2997 7.6. Additional Considerations Specific to 2- and 1-pass DSKPP 2999 7.6.1. Client Contributions to K_TOKEN Entropy 3001 In 4-pass DSKPP, both the client and the server provide randomizing 3002 material to K_TOKEN , in a manner that allows both parties to verify 3003 that they did contribute to the resulting key. In the 1- and 2-pass 3004 DSKPP versions defined herein, only the server contributes to the 3005 entropy of K_TOKEN. This means that a broken or compromised 3006 (pseudo-)random number generator in the server may cause more damage 3007 than it would in the 4-pass variant. Server implementations SHOULD 3008 therefore take extreme care to ensure that this situation does not 3009 occur. 3011 7.6.2. Key Confirmation 3013 4-pass DSKPP servers provide key confirmation through the MAC on R_C 3014 in the message. In the 1- and 2-pass DSKPP variants 3015 described herein, key confirmation is provided by the MAC including I 3016 (in the 1-pass case) or R (2-pass case), using K_MAC. 3018 7.6.3. Server Authentication 3020 DSKPP servers MUST authenticate themselves whenever a successful 3021 DSKPP 1- or 2-pass protocol run would result in an existing K_TOKEN 3022 being replaced by a K_TOKEN', or else a denial-of-service attack 3023 where an unauthorized DSKPP server replaces a K_TOKEN with another 3024 key would be possible. In 1- and 2-pass DSKPP, servers authenticate 3025 by including the AuthenticationDataType extension containing a MAC as 3026 described in Section 4.8 above. 3028 7.6.4. Client Authentication 3030 A DSKPP server MUST authenticate a client to ensure that K_TOKEN is 3031 delivered to the intended device. The following measures SHOULD be 3032 considered: 3034 o When a device certificate is used for client authentication, the 3035 DSKPP server SHOULD follow standard certificate verification 3036 processes to ensure that it is a trusted device. 3037 o When an Authentication Code is used for client authentication, a 3038 password dictionary attack on the authentication data is possible. 3039 When a secure channel, e.g., SSL or TLS, is established between a 3040 DSKPP client and server, an attacker could successfully brute- 3041 force guess an Authentication Code, allowing him to illegitimately 3042 receive K_TOKEN. 3043 o The length the of the Authentication Code when used over a non- 3044 secure channel SHOULD be longer than what is used over a secure 3045 channel. When a device, e.g., some mobile phones with small 3046 screens, cannot handle a long Authentication Code in a user- 3047 friendly manner, DSKPP SHOULD rely on a secure channel for 3048 communication. 3049 o In the case that a non-secure channel has to be used, the 3050 Authentication Code SHOULD be sent to the server MAC's with a 3051 DSKPP server's nonce value. The Authentication Code and nonce 3052 value MUST be strong enough to prevent offline brute-force 3053 recovery of the Authentication Code from the HMAC data. Because 3054 the nonce value is almost public across a non-secure channel, the 3055 key strength is dependent on the Authentication Code. 3057 7.6.5. Key Protection in the Passphrase Profile 3059 The passphrase-based key wrap profile uses the PBKDF2 function from 3060 [PKCS-5] to generate an encryption key from a passphrase and salt 3061 string. The derived key, K_DERIVED is used by the server to encrypt 3062 K_TOKEN and by the cryptographic module to decrypt the newly 3063 delivered K_TOKEN. It is important to note that passphrase-based 3064 encryption is generally limited in the security that it provides 3065 despite the use of salt and iteration count in PBKDF2 to increase the 3066 complexity of attack. Implementations SHOULD therefore take 3067 additional measures to strengthen the security of the passphrase- 3068 based key wrap profile. The following measures SHOULD be considered 3069 where applicable: 3071 o The passphrase SHOULD be selected well, and usage guidelines such 3072 as the ones in [NIST-PWD] SHOULD be taken into account. 3073 o A different passphrase SHOULD be used for every key initialization 3074 wherever possible (the use of a global passphrase for a batch of 3075 cryptographic modules SHOULD be avoided, for example). One way to 3076 achieve this is to use randomly-generated passphrases. 3077 o The passphrase SHOULD be protected well if stored on the server 3078 and/or on the cryptographic module and SHOULD be delivered to the 3079 device's user using secure methods. 3081 o User pre-authentication SHOULD be implemented to ensure that 3082 K_TOKEN is not delivered to a rogue recipient. 3083 o The iteration count in PBKDF2 SHOULD be high to impose more work 3084 for an attacker using brute-force methods (see [PKCS-5] for 3085 recommendations). However, it MUST be noted that the higher the 3086 count, the more work is required on the legitimate cryptographic 3087 module to decrypt the newly delivered K_TOKEN. Servers MAY use 3088 relatively low iteration counts to accommodate devices with 3089 limited processing power such as some PDA and cell phones when 3090 other security measures are implemented and the security of the 3091 passphrase-based key wrap method is not weakened. 3092 o Transport level security (e.g. TLS) SHOULD be used where possible 3093 to protect a 2-pass or 1-pass protocol run. Transport level 3094 security provides a second layer of protection for the newly 3095 generated K_TOKEN. 3097 8. IANA Considerations 3099 This document calls for registration of new URNs within the IETF sub- 3100 namespace per RFC3553 [RFC3553]. The following URNs are RECOMMENDED: 3101 o DSKPP XML schema: "urn:ietf:params:xml:schema:keyprov:protocol" 3102 o DSKPP XML namespace: "urn:ietf:params:xml:ns:keyprov:protocol" 3104 9. Intellectual Property Considerations 3106 RSA and RSA Security are registered trademarks or trademarks of RSA 3107 Security Inc. in the United States and/or other countries. The names 3108 of other products and services mentioned may be the trademarks of 3109 their respective owners. 3111 10. Acknowledgements 3113 The authors would like to thank all the members of OATH [OATH] and 3114 participants of OTPS workshops for their review and comments related 3115 to this document. 3117 11. References 3119 11.1. Normative references 3121 [UNICODE] Davis, M. and M. Duerst, "Unicode Normalization Forms", 3122 March 2001, 3123 . 3126 [XMLDSIG] W3C, "XML Signature Syntax and Processing", 3127 W3C Recommendation, February 2002, 3128 . 3130 [XMLENC] W3C, "XML Encryption Syntax and Processing", 3131 W3C Recommendation, December 2002, 3132 . 3134 11.2. Informative references 3136 [CT-KIP-P11] 3137 RSA Laboratories, "PKCS #11 Mechanisms for the 3138 Cryptographic Token Key Initialization Protocol", PKCS #11 3139 Version 2.20 Amd.2, December 2005, 3140 . 3142 [FAQ] RSA Laboratories, "Frequently Asked Questions About 3143 Today's Cryptography", Version 4.1, 2000. 3145 [FIPS180-SHA] 3146 National Institute of Standards and Technology, "Secure 3147 Hash Standard", FIPS 180-2, February 2004, . 3151 [FIPS197-AES] 3152 National Institute of Standards and Technology, 3153 "Specification for the Advanced Encryption Standard 3154 (AES)", FIPS 197, November 2001, . 3157 [FSE2003] Iwata, T. and K. Kurosawa, "OMAC: One-Key CBC MAC. In Fast 3158 Software Encryption", FSE 2003, Springer-Verlag , 2003, 3159 . 3161 [NIST-PWD] 3162 National Institute of Standards and Technology, "Password 3163 Usage", FIPS 112, May 1985, 3164 . 3166 [OATH] "Initiative for Open AuTHentication", 2005, 3167 . 3169 [PKCS-1] RSA Laboratories, "RSA Cryptography Standard", PKCS #1 3170 Version 2.1, June 2002, 3171 . 3173 [PKCS-11] RSA Laboratories, "Cryptographic Token Interface 3174 Standard", PKCS #11 Version 2.20, June 2004, 3175 . 3177 [PKCS-12] "Personal Information Exchange Syntax Standard", PKCS #12 3178 Version 1.0, 2005, 3179 . 3182 [PKCS-5] RSA Laboratories, "Password-Based Cryptography Standard", 3183 PKCS #5 Version 2.0, March 1999, 3184 . 3186 [PKCS-5-XML] 3187 RSA Laboratories, "XML Schema for PKCS #5 Version 2.0", 3188 PKCS #5 Version 2.0 Amd.1 (FINAL DRAFT), October 2006, 3189 . 3191 [PSKC] "Portable Symmetric Key Container", 2005, . 3196 [RFC2104] Krawzcyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 3197 Hashing for Message Authentication", RFC 2104, 3198 February 1997. 3200 [RFC2119] "Key words for use in RFCs to Indicate Requirement 3201 Levels", BCP 14, RFC 2119, March 1997, 3202 . 3204 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 3205 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 3206 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999, 3207 . 3209 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 3210 IETF URN Sub-namespace for Registered Protocol 3211 Parameters", RFC 3553, BCP 73, June 2003. 3213 [RFC4758] RSA, The Security Division of EMC, "Cryptographic Token 3214 Key Initialization Protocol (CT-KIP)", November 2006, 3215 . 3217 Appendix A. Key Initialization Profiles of DSKPP 3218 A.1. Introduction 3220 This appendix introduces three profiles of DSKPP for key 3221 initialization. They MAY all be used for two- as well as one-pass 3222 initialization of cryptographic modules. Further profiles MAY be 3223 defined by external entities or through the IETF process. 3225 A.2. Key Transport Profile 3227 A.2.1. Introduction 3229 This profile initializes the cryptographic module with a symmetric 3230 key, K_TOKEN, through key transport and key derivation. The key 3231 transport is carried out using a public key, K_CLIENT, whose private 3232 key part resides in the cryptographic module as the transport key. A 3233 key K from which two keys, K_TOKEN and K_MAC are derived MUST be 3234 transported. 3236 A.2.2. Identification 3238 This profile MUST be identified with the following URN: 3240 urn:ietf:params:xml:schema:keyprov:protocol#transport 3242 A.2.3. Payloads 3244 In the two-pass version of DSKPP, the client MUST send a payload 3245 associated with this key initialization method. The payload MUST be 3246 of type ds:KeyInfoType ([XMLDSIG]), and only those choices of the ds: 3247 KeyInfoType that identify a public key are allowed. The ds: 3248 X509Certificate option of the ds:X509Data alternative is RECOMMENDED 3249 when the public key corresponding to the private key on the 3250 cryptographic module has been certified. 3252 The server payload associated with this key initialization method 3253 MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those 3254 encryption methods utilizing a public key that are supported by the 3255 DSKPP client (as indicated in the 3256 element of the message in the case of 2-pass DSKPP, or 3257 as otherwise known in the case of 1-pass DSKPP) are allowed as values 3258 for the element. Further, in the case of 3259 2-pass DSKPP, the element MUST contain the same value 3260 (i.e. identify the same public key) as the of the 3261 corresponding supported key initialization method in the 3262 message that triggered the response. The 3263 element MAY be present, but MUST, when present, 3264 contain the same value as the element of the 3265 message. The Type attribute of the xenc:EncryptedKeyType MUST be 3266 present and MUST identify the type of the wrapped key. The type MUST 3267 be one of the types supported by the DSKPP client (as reported in the 3268 of the preceding message in the 3269 case of 2-pass DSKPP, or as otherwise known in the case of 1-pass 3270 DSKPP). The transported key MUST consist of two parts of equal 3271 length. The first half constitutes K_MAC and the second half 3272 constitutes K_TOKEN. The length of K_TOKEN (and hence also the 3273 length of K_MAC) is determined by the type of K_TOKEN. 3275 DSKPP servers and cryptographic modules supporting this profile MUST 3276 support the http://www.w3.org/2001/04/xmlenc#rsa-1_5 key-wrapping 3277 mechanism defined in [XMLENC]. 3279 When this profile is used, the MacAlgorithm attribute of the 3280 element of the message MUST be present and MUST 3281 identify the selected MAC algorithm. The selected MAC algorithm MUST 3282 be one of the MAC algorithms supported by the DSKPP client (as 3283 indicated in the element of the 3284 message in the case of 2-pass DSKPP, or as otherwise 3285 known in the case of 1-pass DSKPP). The MAC MUST be calculated as 3286 described in Section 4.8 3288 In addition, DSKPP servers MUST include the AuthenticationDataType 3289 element (see further Section 4.8) in their messages 3290 whenever a successful protocol run will result in an existing K_TOKEN 3291 being replaced. 3293 A.3. Key wrap profile 3295 A.3.1. Introduction 3297 This profile initializes the cryptographic module with a symmetric 3298 key, K_TOKEN, through key wrap and key derivation. The key wrap MUST 3299 be carried out using a (symmetric) key-wrapping key, K_SHARED, known 3300 in advance by both the cryptographic module and the DSKPP server. A 3301 key K from which two keys, K_TOKEN and K_MAC are derived MUST be 3302 wrapped. 3304 A.3.2. Identification 3306 This profile MUST be identified with the following URI: 3308 urn:ietf:params:xml:schema:keyprov:protocol#wrap 3310 A.3.3. Payloads 3312 In the 2-pass version of DSKPP, the client MUST send a payload 3313 associated with this key initialization method. The payload MUST be 3314 of type ds:KeyInfoType ([XMLDSIG]), and only those choices of the ds: 3315 KeyInfoType that identify a symmetric key are allowed. The ds: 3316 KeyName alternative is RECOMMENDED. 3318 The server payload associated with this key initialization method 3319 MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those 3320 encryption methods utilizing a symmetric key that are supported by 3321 the DSKPP client (as indicated in the 3322 element of the message in the case of 2-pass DSKPP, or 3323 as otherwise known in the case of 1-pass DSKPP) are allowed as values 3324 for the element. Further, in the case of 3325 2-pass DSKPP, the element MUST contain the same value 3326 (i.e. identify the same symmetric key) as the of the 3327 corresponding supported key initialization method in the 3328 message that triggered the response. The 3329 element MAY be present, and MUST, when present, 3330 contain the same value as the element of the 3331 message. The Type attribute of the xenc:EncryptedKeyType MUST be 3332 present and MUST identify the type of the wrapped key. The type MUST 3333 be one of the types supported by the DSKPP client (as reported in the 3334 of the preceding message in the 3335 case of 2-pass DSKPP, or as otherwise known in the case of 1-pass 3336 DSKPP). The wrapped key MUST consist of two parts of equal length. 3337 The first half constitutes K_MAC and the second half constitutes 3338 K_TOKEN. The length of K_TOKEN (and hence also the length of K_MAC) 3339 is determined by the type of K_TOKEN. 3341 DSKP servers and cryptographic modules supporting this profile MUST 3342 support the http://www.w3.org/2001/04/xmlenc#kw-aes128 key-wrapping 3343 mechanism defined in [XMLENC]. 3345 When this profile is used, the MacAlgorithm attribute of the 3346 element of the message MUST be present and MUST 3347 identify the selected MAC algorithm. The selected MAC algorithm MUST 3348 be one of the MAC algorithms supported by the DSKPP client (as 3349 indicated in the element of the 3350 message in the case of 2-pass DSKPP, or as otherwise 3351 known in the case of 1-pass DSKPP). The MAC MUST be calculated as 3352 described in Section 4.8 3354 In addition, DSKPP servers MUST include the AuthenticationDataType 3355 element (see further Section 4.8) in their messages 3356 whenever a successful protocol run will result in an existing K_TOKEN 3357 being replaced. 3359 A.4. Passphrase-based key wrap profile 3361 A.4.1. Introduction 3363 This profile is a variation of the key wrap profile. It initializes 3364 the cryptographic module with a symmetric key, K_TOKEN, through key 3365 wrap and key derivation, using a passphrase-derived key-wrapping key, 3366 K_DERIVED. The passphrase is known in advance by both the device 3367 user and the DSKPP server. To preserve the property of not exposing 3368 K_TOKEN to any other entity than the DSKPP server and the 3369 cryptographic module itself, the method SHOULD be employed only when 3370 the device contains facilities (e.g. a keypad) for direct entry of 3371 the passphrase. A key K from which two keys, K_TOKEN and K_MAC are 3372 derived MUST be wrapped. 3374 A.4.2. Identification 3376 This profile MUST be identified with the following URI: 3378 urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap 3380 A.4.3. Payloads 3382 In the 2-pass version of DSKPP, the client MUST send a payload 3383 associated with this key initialization method. The payload MUST be 3384 of type ds:KeyInfoType ([XMLDSIG]). The ds:KeyName option MUST be 3385 used and the key name MUST identify the passphrase that will be used 3386 by the server to generate the key-wrapping key. As an example, the 3387 identifier could be a user identifier or a registration identifier 3388 issued by the server to the user during a session preceding the DSKPP 3389 protocol run. 3391 The server payload associated with this key initialization method 3392 MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those 3393 encryption methods utilizing a passphrase to derive the key-wrapping 3394 key that are supported by the DSKPP client (as indicated in the 3395 element of the message 3396 in the case of 2-pass DSKPP, or as otherwise known in the case of 3397 1-pass DSKPP) are allowed as values for the 3398 element. Further, in the case of 2-pass DSKPP, the 3399 element MUST contain the same value (i.e. identify the same 3400 passphrase) as the of the corresponding supported key 3401 initialization method in the message that triggered the 3402 response. The element MAY be present, and MUST, 3403 when present, contain the same value as the element of the 3404 message. The Type attribute of the xenc: 3405 EncryptedKeyType MUST be present and MUST identify the type of the 3406 wrapped key. The type MUST be one of the types supported by the 3407 DSKPP client (as reported in the of the preceding 3408 message in the case of 2-pass DSKPP, or as otherwise 3409 known in the case of 1-pass DSKPP). The wrapped key MUST consist of 3410 two parts of equal length. The first half constitutes K_MAC and the 3411 second half constitutes K_TOKEN. The length of K_TOKEN (and hence 3412 also the length of K_MAC) is determined by the type of K_TOKEN. 3414 DSKPP servers and cryptographic modules supporting this profile MUST 3415 support the PBES2 password based encryption scheme defined in 3416 [PKCS-5] (and identified as 3417 http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2 in 3418 [PKCS-5-XML]), the PBKDF2 passphrase-based key derivation function 3419 also defined in [PKCS-5] (and identified as 3420 http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbkdf2 in 3421 [PKCS-5-XML]), and the http://www.w3.org/2001/04/xmlenc#kw-aes128 3422 key-wrapping mechanism defined in [XMLENC]. 3424 When this profile is used, the MacAlgorithm attribute of the 3425 element of the message MUST be present and MUST 3426 identify the selected MAC algorithm. The selected MAC algorithm MUST 3427 be one of the MAC algorithms supported by the DSKPP client (as 3428 indicated in the element of the 3429 message in the case of 2-pass DSKPP, or as otherwise 3430 known in the case of 1-pass DSKPP). The MAC MUST be calculated as 3431 described in Section 4.8 3433 In addition, DSKPP servers MUST include the AuthenticationDataType 3434 element (see further Section 4.8) in their messages 3435 whenever a successful protocol run will result in an existing K_TOKEN 3436 being replaced. 3438 Appendix B. Example Messages 3440 All examples are syntactically correct. MAC and cipher values are 3441 fictitious however. 3443 B.1. Example Messages in a Four-pass Exchange 3445 The examples below illustrate a complete four-pass DSKPP exchange. 3447 B.1.1. Example of a DSKPP Initialization (Trigger) Message 3449 3450 3455 3456 3457 3458 ManufacturerABC 3459 XL0000000001234 3460 U2 3461 3462 3463 112dsdfwf312asder394jw== 3464 3465 3467 B.1.2. Example of a Message 3469 3470 3476 3477 3478 ManufacturerABC 3479 XL0000000001234 3480 U2 3481 3482 3483 112dsdfwf312asder394jw== 3484 3485 http://www.rsa.com/rsalabs/otps/schemas/2005/09/ 3486 otps-wst#SecurID-AES 3487 http://www.openauthentication.org/OATH/2006/10/PSKC# 3488 HOTP 3489 3490 3491 http://www.w3.org/2001/05/xmlenc#rsa_1_5 3492 urn:ietf:params:xml:schema:keyprov:protocol# 3493 dskpp-prf-aes 3494 3495 urn:ietf:params:xml:schema:keyprov:protocol# 3496 dskpp-prf-aes 3497 3498 FourPass 3499 3500 3501 urn:ietf:params:xml:schema:keyprov:container 3502 3503 3504 3505 1erd354657689102abcd 3506 3507 3509 B.1.3. Example of a Message 3511 3512 3518 3519 http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst# 3520 SecurID-AES 3521 3522 3523 urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes 3524 3525 3526 urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes 3527 3528 3529 KEY-1 3530 3531 3532 urn:ietf:params:xml:schema:keyprov:container 3533 3534 3535 qw2ewasde312asder394jw== 3536 3537 3539 B.1.4. Example of a Message 3541 3542 3547 VXENc+Um/9/NvmYKiHDLaErK0gk= 3548 3549 1erd354657689102abcd 3550 3551 3553 B.1.5. Example of a Message 3554 3555 3560 3561 3562 3564 CredentialIssuer 3565 3566 3567 3568 MyFirstToken 3569 3570 Time 3571 3572 10/30/2009 3573 3574 3575 3576 miidfasde312asder394jw== 3577 3579 B.2. Example Messages in a Two- or One-pass Exchange 3581 The examples illustrate a complete two-pass DSKPP exchange. The 3582 server messages MAY also constitute the only messages in a one-pass 3583 DSKPP exchange. 3585 B.2.1. Example of a Message Indicating Support for Two- 3586 pass DSKPP 3588 The client indicates support both for the two-pass key transport 3589 variant as well as the two-pass key wrap variant. 3591 3592 3600 3601 3602 ManufacturerABC 3603 XL0000000001234 3604 U2 3605 3606 3607 1523sdfxe798jowie913ol== 3608 3609 3610 http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst# 3611 SecurID-AES 3612 3613 3614 http://www.openauthentication.org/OATH/2006/10/PSKC#HOTP 3615 3616 3617 3618 3619 http://www.w3.org/2001/05/xmlenc#rsa_1_5 3620 3621 3622 http://www.w3.org/2001/04/xmlenc#kw-aes128 3623 3624 3625 http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5# 3626 pbes2 3627 3628 3629 urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes 3630 3631 3632 urn:ietf:params:xml:schema:keyprov:protocol# 3633 dskpp-prf-aes 3634 3635 3636 3637 3638 3639 urn:ietf:params:xml:schema:keyprov:protocol#wrap 3640 3641 3642 Key_001 3643 3644 3645 urn:ietf:params:xml:schema:keyprov:protocol#transport 3646 3647 3648 3649 miib 3651 3652 3653 3654 3655 3657 3658 urn:ietf:params:xml:schema:keyprov:container 3659 3660 3661 3662 1erd354657689102abcd 3663 3664 3666 B.2.2. Example of a Message Using the Key Transport 3667 Profile 3669 In this example, the server responds to the previous request using 3670 the key transport profile. 3672 3673 3680 3681 3683 43212093< 3684 3685 3686 miib 3687 3688 3689 3690 3691 3692 CredentialIssuer 3693 3694 3695 3696 MyFirstToken 3697 3698 3699 7JHUyp3azOkqJENSsh6b2vxXzwGBYypzJxEr+ikQAa229KV/BgZhGA== 3700 3701 3702 9AEDpd4td44mRSASab625oPqlvHHIplzADer+pPOlL118JW/AhIoHB== 3703 3704 3705 3706 1 3707 3708 10/30/2009 3709 3710 3711 3712 3714 miidfasde312asder394jw== 3715 3716 3718 B.2.3. Example of a Message Using the Key Wrap Profile 3720 In this example, the server responds to the previous request using 3721 the key wrap profile. 3723 3724 3731 3732 3734 43212093 3735 3736 Key-001 3737 3738 3739 3740 3741 CredentialIssuer 3742 3743 3744 3745 MyFirstToken 3746 3747 3748 7JHUyp3azOkqJENSsh6b2vxXzwGBYypzJxEr+ikQAa229KV/BgZhGA== 3749 3750 3751 9AEDpd4td44mRSASab625oPqlvHHIplzADer+pPOlL118JW/AhIoHB== 3752 3753 3754 3755 1 3756 3757 10/30/2009 3758 3759 3760 3761 3763 miidfasde312asder394jw== 3764 3765 3767 B.2.4. Example of a Message using the Passphrase-based 3768 Key Wrap Profile 3770 In this example, the server responds to the previous request using 3771 the passphrase-based key wrap profile. 3773 3774 3783 3784 3786 3787 3790 3791 3792 32113435 3793 3794 1024 3795 128 3796 3797 3798 3799 3801 3803 43212093 3804 3805 Passphrase1 3806 3807 3808 3809 3810 CredentialIssuer 3811 3812 3813 3814 MyFirstToken 3815 3816 3817 7JHUyp3azOkqJENSsh6b2vxXzwGBYypzJxEr+ikQAa229KV/BgZhGA== 3818 3819 3820 9AEDpd4td44mRSASab625oPqlvHHIplzADer+pPOlL118JW/AhIoHB== 3821 3822 3823 3824 1 3825 3826 10/30/2009 3827 3828 3829 3830 3832 miidfasde312asder394jw== 3833 3834 3836 Appendix C. Requirements 3838 This section specifies mandatory and desirable protocol requirements. 3840 Req-1: 3842 The protocol MUST support provisioning of keys for use with 3843 multiple types of symmetric cryptographic algorithms. 3845 Req-2: 3847 The protocol MUST support pre-generated symmetric keys (by 3848 separate key issuance service) or locally generated keys in real- 3849 time (by provisioning server). 3851 Req-3: 3853 The protocol MUST support mutually generated symmetric keys by 3854 both client and server (i.e., joint key control). 3856 Req-4: 3858 The protocol MUST allow cryptographic modules to acquire multiple 3859 symmetric keys; each key MAY be acquired in a separate 3860 provisioning session. 3862 Req-5: 3864 The protocol MUST support renewal of a symmetric key with the 3865 original key ID. 3867 Req-6: 3869 The protocol MUST allow clients to specify their cryptographic 3870 capabilities to the server and the server to indicate the 3871 cryptography and algorithm types that it will be using. 3873 Req-7: 3875 The protocol MUST support mutual authentication and 3876 confidentiality of sensitive data during provisioning. 3878 Req-8: 3880 The protocol MAY use a public-key infrastructure and the use of 3881 client certificates for device authentication or symmetric key 3882 data protection. The protocol MUST allow for other mechanisms, 3883 such as symmetric key-based techniques, to be used. 3885 Req-9: 3887 The protocol SHOULD NOT only rely on transport layer security. It 3888 SHOULD be compatible with transport layer security when available. 3890 Req-10: 3892 The protocol SHOULD allow the server to use pre-loaded symmetric 3893 transport keys if available on the device that hosts the 3894 cryptographic module (i.e., smart card update keys, such as used 3895 by Global Platform for establishing a secure channel). 3897 Req-11: 3899 The protocol MUST protect against replay attacks. 3901 Req-12: 3903 The protocol MUST protect against MITM attacks. 3905 Req-13: 3907 The protocol MAY support a cryptographic module request to acquire 3908 multiple symmetric keys in the same session. 3910 Req-14: 3912 The protocol MAY allow the provisioning server to verify that the 3913 key has been correctly provisioned to the cryptographic module 3914 (i.e., key confirmation). 3916 Req-15: 3918 The protocol MAY allow a cryptographic module to notify the 3919 provisioning server upon symmetric key deletion. 3921 Req-16: 3923 The protocol MAY limit a protocol run to complete within a certain 3924 time window. 3926 Req-17: 3928 The protocol MAY support download of a key to a cryptographic 3929 module via SMS depending upon whether the application can provide 3930 an acceptable level of protection for transport of the symmetric 3931 key. 3933 The following is a list of features that are not required by the 3934 protocol: 3936 Non-Req-1: 3938 Support for cryptographic module generated symmetric key upload to 3939 a provisioning server. 3941 Non-Req-2: 3943 Support for other key lifecycle management functions, such as key 3944 suspension, lock, and activation. These functions are supported 3945 in a symmetric key-based application, such as an authentication 3946 system. 3948 Non-Req-3: 3950 Support for asymmetric key pair provisioning. 3952 Appendix D. Integration with PKCS #11 3954 A DSKPP client that needs to communicate with a conncected 3955 cryptographic module to perform a DSKPP exchange MAY use PKCS #11 3957 [PKCS-11]as a programming interface. 3959 D.1. The 4-pass Variant 3961 When performing 4-pass DSKPP with a cryptographic module using the 3962 PKCS #11 programming interface, the procedure described in 3963 [CT-KIP-P11], Appendix B, is RECOMMENDED. 3965 D.2. The 2-pass Variant 3967 A suggested procedure to perform 2-pass DSKPP with a cryptographic 3968 module through the PKCS #11 interface using the mechanisms defined in 3969 [CT-KIP-P11] is as follows: 3971 a. On the client side, 3972 1. The client selects a suitable slot and token (e.g. through 3973 use of the or the element 3974 of the DSKPP trigger message). 3975 2. A nonce R is generated, e.g. by calling C_SeedRandom and 3976 C_GenerateRandom. 3977 3. The client sends its first message to the server, including 3978 the nonce R. 3979 b. On the server side, 3980 1. A generic key K = K_TOKEN | K _MAC (where '|' denotes 3981 concatenation) is generated, e.g. by calling C_GenerateKey 3982 (using key type CKK_GENERIC_SECRET). The template for K MUST 3983 allow it to be exported (but only in wrapped form, i.e. 3984 CKA_SENSITIVE MUST be set to CK_TRUE and CKA_EXTRACTABLE MUST 3985 also be set to CK_TRUE), and also to be used for further key 3986 derivation. From K, a token key K_TOKEN of suitable type is 3987 derived by calling C_DeriveKey using the PKCS #11 mechanism 3988 CKM_EXTRACT_KEY_FROM_KEY and setting the CK_EXTRACT_PARAMS to 3989 the first bit of the generic secret key (i.e. set to 0). 3990 Likewise, a MAC key K_MAC is derived from K by calling 3991 C_DeriveKey using the CKM_EXTRACT_KEY_FROM_KEY mechanism, 3992 this time setting CK_EXTRACT_PARAMS to the length of K (in 3993 bits) divided by two. 3994 2. The server wraps K with either the token's public key 3995 K_CLIENT, the shared secret key K_SHARED, or the derived 3996 shared secret key K_DERIVED by using C_WrapKey. If use of 3997 the DSKPP key wrap algorithm has been negotiated then the 3998 CKM_KIP_WRAP mechanism MUST be used to wrap K. When calling 3999 C_WrapKey, the hKey handle in the CK_KIP_PARAMS structure 4000 MUST be set to NULL_PTR. The pSeed parameter in the 4001 CK_KIP_PARAMS structure MUST point to the nonce R provided by 4002 the DSKPP client, and the ulSeedLen parameter MUST indicate 4003 the length of R. The hWrappingKey parameter in the call to 4004 C_WrapKey MUST be set to refer to the wrapping key. 4006 3. Next, the server needs to calculate a MAC using K_MAC. If 4007 use of the DSKPP MAC algorithm has been negotiated, then the 4008 MAC is calculated by calling C_SignInit with the CKM_KIP_MAC 4009 mechanism followed by a call to C_Sign. In the call to 4010 C_SignInit, K_MAC MUST be the signature key, the hKey 4011 parameter in the CK_KIP_PARAMS structure MUST be set to 4012 NULL_PTR, the pSeed parameter of the CT_KIP_PARAMS structure 4013 MUST be set to NULL_PTR, and the ulSeedLen parameter MUST be 4014 set to zero. In the call to C_Sign, the pData parameter MUST 4015 be set to the concatenation of the string ID_S and the nonce 4016 R, and the ulDataLen parameter MUST be set to the length of 4017 the concatenated string. The desired length of the MAC MUST 4018 be specified through the pulSignatureLen parameter and MUST 4019 be set to the length of R. 4020 4. If the server also needs to authenticate its message (due to 4021 an existing K_TOKEN being replaced), the server MUST 4022 calculate a second MAC. Again, if use of the DSKPP MAC 4023 algorithm has been negotiated, then the MAC is calculated by 4024 calling C_SignInit with the CKM_KIP_MAC mechanism followed by 4025 a call to C_Sign. In this call to C_SignInit, the K_MAC 4026 existing before this DSKPP protocol run MUST be the signature 4027 key, the hKey parameter in the CK_KIP_PARAMS structure MUST 4028 be set to NULL, the pSeed parameter of the CT_KIP_PARAMS 4029 structure MUST be set to NULL_PTR, and the ulSeeidLen 4030 parameter MUST be set to zero. In the call to C_Sign, the 4031 pData parameter MUST be set to the concatenation of the 4032 string ID_S and the nonce R, and the ulDataLen parameter MUST 4033 be set to the length of concatenated string. The desired 4034 length of the MAC MUST be specified through the 4035 pulSignatureLen parameter and MUST be set to the length of R. 4036 5. The server sends its message to the client, including the 4037 wrapped key K, the MAC and possibly also the authenticating 4038 MAC. 4039 c. On the client side, 4040 1. The client calls C_UnwrapKey to receive a handle to K. After 4041 this, the client calls C_DeriveKey twice: Once to derive 4042 K_TOKEN and once to derive K_MAC. The client MUST use the 4043 same mechanism (CKM_EXTRACT_KEY_FROM_KEY) and the same 4044 mechanism parameters as used by the server above. When 4045 calling C_UnwrapKey and C_DeriveKey, the pTemplate parameter 4046 MUST be used to set additional key attributes in accordance 4047 with local policy and as negotiated and expressed in the 4048 protocol. In particular, the value of the element in 4049 the server's response message MAY be used as CKA_ID for 4050 K_TOKEN. The key K MUST be destroyed after deriving K_TOKEN 4051 and K_MAC. 4053 2. The MAC is verified in a reciprocal fashion as it was 4054 generated by the server. If use of the CKM_KIP_MAC mechanism 4055 has been negotiated, then in the call to C_VerifyInit, the 4056 hKey parameter in the CK_KIP_PARAMS structure MUST be set to 4057 NULL_PTR, the pSeed parameter MUST be set to NULL_PTR, and 4058 ulSeedLen MUST be set to 0. The hKey parameter of 4059 C_VerifyInit MUST refer to K_MAC. In the call to C_Verify, 4060 pData MUST be set to the concatenation of the string ID_S and 4061 the nonce R, and the ulDataLen parameter MUST be set to the 4062 length of the concatenated string, pSignature to the MAC 4063 value received from the server, and ulSignatureLen to the 4064 length of the MAC. If the MAC does not verify the protocol 4065 session ends with a failure. The token MUST be constructed 4066 to not "commit" to the new K_TOKEN or the new K_MAC unless 4067 the MAC verifies. 4068 3. If an authenticating MAC was received (REQUIRED if the new 4069 K_TOKEN will replace an existing key on the token), then it 4070 is verified in a similar vein but using the K_MAC associated 4071 with this server and existing before the protocol run. 4072 Again, if the MAC does not verify the protocol session ends 4073 with a failure, and the token MUST be constructed no to 4074 "commit" to the new K_TOKEN or the new K_MAC unless the MAC 4075 verifies. 4077 D.3. The 1-pass Variant 4079 A suggested procedure to perform 1-pass DSKPP with a cryptographic 4080 module through the PKCS #11 interface using the mechanisms defined in 4081 [CT-KIP-P11] is as follows: 4083 a. On the server side, 4084 1. A generic key K = K_TOKEN | K _MAC (where '|' denotes 4085 concatenation) is generated, e.g. by calling C_GenerateKey 4086 (using key type CKK_GENERIC_SECRET). The template for K MUST 4087 allow it to be exported (but only in wrapped form, i.e. 4088 CKA_SENSITIVE MUST be set to CK_TRUE and CKA_EXTRACTABLE MUST 4089 also be set to CK_TRUE), and also to be used for further key 4090 derivation. From K, a token key K_TOKEN of suitable type is 4091 derived by calling C_DeriveKey using the PKCS #11 mechanism 4092 CKM_EXTRACT_KEY_FROM_KEY and setting the CK_EXTRACT_PARAMS to 4093 the first bit of the generic secret key (i.e. set to 0). 4094 Likewise, a MAC key K_MAC is derived from K by calling 4095 C_DeriveKey using the CKM_EXTRACT_KEY_FROM_KEY mechanism, 4096 this time setting CK_EXTRACT_PARAMS to the length of K (in 4097 bits) divided by two. 4099 2. The server wraps K with either the token's public key, 4100 K_CLIENT, the shared secret key, K_SHARED, or the derived 4101 shared secret key, K_DERIVED by using C_WrapKey. If use of 4102 the DSKPP key wrap algorithm has been negotiated, then the 4103 CKM_KIP_WRAP mechanism MUST be used to wrap K. When calling 4104 C_WrapKey, the hKey handle in the CK_KIP_PARAMS structure 4105 MUST be set to NULL_PTR. The pSeed parameter in the 4106 CK_KIP_PARAMS structure MUST point to the octet-string 4107 representation of an integer I whose value MUST be 4108 incremented before each protocol run, and the ulSeedLen 4109 parameter MUST indicate the length of the octet-string 4110 representation of I. The hWrappingKey parameter in the call 4111 to C_WrapKey MUST be set to refer to the wrapping key. 4113 Note: The integer-to-octet string conversion MUST be made 4114 using the I2OSP primitive from [PKCS-1]. There MUST be no 4115 leading zeros. 4116 3. For the server's message to the client, if use of the DSKPP 4117 MAC algorithm has been negotiated, then the MAC is calculated 4118 by calling C_SignInit with the CKM_KIP_MAC mechanism followed 4119 by a call to C_Sign. In the call to C_SignInit, K_MAC MUST 4120 be the signature key, the hKey parameter in the CK_KIP_PARAMS 4121 structure MUST be set to NULL_PTR, the pSeed parameter of the 4122 CT_KIP_PARAMS structure MUST be set to NULL_PTR, and the 4123 ulSeedLen parameter MUST be set to zero. In the call to 4124 C_Sign, the pData parameter MUST be set to the concatenation 4125 of the string ID_S and the octet-string representation of the 4126 integer I, and the ulDataLen parameter MUST be set to the 4127 length of concatenated string. The desired length of the MAC 4128 MUST be specified through the pulSignatureLen parameter as 4129 usual, and MUST be equal to, or greater than, sixteen (16). 4130 4. If the server also needs to authenticate its message (due to 4131 an existing K_TOKEN being replaced), the server calculates a 4132 second MAC. If the DSKPP MAC mechanism is used, the server 4133 does this by calling C_SignInit with the CKM_KIP_MAC 4134 mechanism followed by a call to C_Sign. In the call to 4135 C_SignInit, the K_MAC existing on the token before this 4136 protocol run MUST be the signature key, the hKey parameter in 4137 the CK_KIP_PARAMS structure MUST be set to NULL_PTR, the 4138 pSeed parameter of the CT_KIP_PARAMS structure MUST be set to 4139 NULL_PTR, and the ulSeedLen parameter MUST be set to zero. 4140 In the call to C_Sign, the pData parameter MUST be set to the 4141 concatenation of the string ID_S and the octet-string 4142 representation of the integer I+1 (i.e. I MUST be 4143 incremented before each use), and the ulDataLen parameter 4144 MUST be set to the length of the concatenated string. The 4145 desired length of the MAC MUST be specified through the 4146 pulSignatureLen parameter as usual, and MUST be equal to, or 4147 greater than, sixteen (16). 4148 5. The server sends its message to the client, including the MAC 4149 and possibly also the authenticating MAC. 4150 b. On the client side, 4151 1. The client calls C_UnwrapKey to receive a handle to K. After 4152 this, the client calls C_DeriveKey twice: Once to derive 4153 K_TOKEN and once to derive K_MAC. The client MUST use the 4154 same mechanism (CKM_EXTRACT_KEY_FROM_KEY) and the same 4155 mechanism parameters as used by the server above. When 4156 calling C_UnwrapKey and C_DeriveKey, the pTemplate parameter 4157 MUST be used to set additional key attributes in accordance 4158 with local policy and as negotiated and expressed in the 4159 protocol. In particular, the value of the element in 4160 the server's response message MAY be used as CKA_ID for 4161 K_TOKEN. The key K MUST be destroyed after deriving K_TOKEN 4162 and K_MAC. 4163 2. The MAC is verified in a reciprocal fashion as it was 4164 generated by the server. If use of the CKM_KIP_MAC mechanism 4165 has been negotiated, then in the call to C_VerifyInit, the 4166 hKey parameter in the CK_KIP_PARAMS structure MUST be set to 4167 NULL_PTR, the pSeed parameter MUST be set to NULL_PTR, and 4168 ulSeedLen MUST be set to 0. The hKey parameter of 4169 C_VerifyInit MUST refer to K_MAC. In the call to C_Verify, 4170 pData MUST be set to the concatenation of the string ID_S and 4171 the octet-string representation of the provided value for I, 4172 and the ulDataLen parameter MUST be set to the length of the 4173 concatenated string, pSignature to the MAC value received 4174 from the server, and ulSignatureLen to the length of the MAC. 4175 If the MAC does not verify or if the provided value of I is 4176 not larger than any stored value I' for the identified server 4177 ID_S the protocol session ends with a failure. The token 4178 MUST be constructed to not "commit" to the new K_TOKEN or the 4179 new K_MAC unless the MAC verifies. If the verification 4180 succeeds, the token MUST store the provided value of I as a 4181 new I' for ID_S. 4182 3. If an authenticating MAC was received (REQUIRED if K_TOKEN 4183 will replace an existing key on the token), it is verified in 4184 a similar vein but using the K_MAC existing before the 4185 protocol run. Again, if the MAC does not verify the protocol 4186 session ends with a failure, and the token MUST be 4187 constructed no to "commit" to the new K_TOKEN or the new 4188 K_MAC unless the MAC verifies. 4190 Appendix E. Example of DSKPP-PRF Realizations 4191 E.1. Introduction 4193 This example appendix defines DSKPP-PRF in terms of AES [FIPS197-AES] 4194 and HMAC [RFC2104]. 4196 E.2. DSKPP-PRF-AES 4198 E.2.1. Identification 4200 For cryptographic modules supporting this realization of DSKPP-PRF, 4201 the following URI MAY be used to identify this algorithm in DSKPP: 4203 urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes 4205 When this URI is used to identify the encryption algorithm to use, 4206 the method for encryption of R_C values described in Section 4.7 MUST 4207 be used. 4209 E.2.2. Definition 4211 DSKPP-PRF-AES (k, s, dsLen) 4213 Input: 4214 k Encryption keyto use 4215 s Octet string consisting of randomizing material. The 4216 length of the string s is sLen. 4217 dsLen Desired length of the output 4219 Output: 4221 DS A pseudorandom string, dsLen-octets long 4223 Steps: 4225 1. Let bLen be the output block size of AES in octets: 4227 bLen = (AES output block length in octets) 4228 (normally, bLen = 16) 4229 2. If dsLen > (2**32 - 1) * bLen, output "derived data too long" and 4230 stop 4231 3. Let n be the number of bLen-octet blocks in the output data, 4232 rounding up, and let j be the number of octets in the last block: 4234 n = ROUND( dsLen / bLen) 4235 j = dsLen - (n - 1) * bLen 4237 4. For each block of the pseudorandom string DS, apply the function 4238 F defined below to the key k, the string s and the block index to 4239 compute the block: 4241 B1 = F (k, s, 1) , 4242 B2 = F (k, s, 2) , 4243 ... 4244 Bn = F (k, s, n) 4245 The function F is defined in terms of the OMAC1 construction from 4246 [FSE2003], using AES as the block cipher: 4248 F (k, s, i) = OMAC1-AES (k, INT (i) || s) 4250 where INT (i) is a four-octet encoding of the integer i, most 4251 significant octet first, and the output length of OMAC1 is set to 4252 bLen. 4254 Concatenate the blocks and extract the first dsLen octets to product 4255 the desired data string DS: 4257 DS = B1 || B2 || ... || Bn<0..j-1> 4259 Output the derived data DS. 4261 E.2.3. Example 4263 If we assume that dsLen = 16, then: 4265 n = 16 / 16 = 1 4267 j = 16 - (1 - 1) * 16 = 16 4269 DS = B1 = F (k, s, 1) = OMAC1-AES (k, INT (1) || s) 4271 E.3. DSKPP-PRF-SHA256 4273 E.3.1. Identification 4275 For cryptographic modules supporting this realization of DSKPP-PRF, 4276 the following URI MAY be used to identify this algorithm in DSKPP: 4278 urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-sha256 4280 When this URI is used to identify the encryption algorithm to use, 4281 the method for encryption of R_C values described in Section 4.7 MUST 4282 be used. 4284 E.3.2. Definition 4286 DSKPP-PRF-SHA256 (k, s, dsLen) 4288 Input: 4289 k Encryption key to use 4290 s Octet string consisting of randomizing material. The 4291 length of the string s is sLen. 4292 dsLen Desired length of the output 4294 Output: 4296 DS A pseudorandom string, dsLen-octets long 4298 Steps: 4300 1. Let bLen be the output size of SHA-256 in octets of [FIPS180-SHA] 4301 (no truncation is done on the HMAC output): 4303 bLen = 32 4304 (normally, bLen = 16) 4305 2. If dsLen > (2**32 - 1) * bLen, output "derived data too long" and 4306 stop 4307 3. Let n be the number of bLen-octet blocks in the output data, 4308 rounding up, and let j be the number of octets in the last block: 4310 n = ROUND( dsLen / bLen) 4311 j = dsLen - (n - 1) * bLen 4312 4. For each block of the pseudorandom string DS, apply the function 4313 F defined below to the key k, the string s and the block index to 4314 compute the block: 4316 B1 = F (k, s, 1) , 4317 B2 = F (k, s, 2) , 4318 ... 4319 Bn = F (k, s, n) 4320 The function F is defined in terms of the HMAC construction from 4321 [RFC2104], using SHA-256 as the digest algorithm: 4323 F (k, s, i) = HMAC-SHA256 (k, INT (i) || s) 4325 where INT (i) is a four-octet encoding of the integer i, most 4326 significant octet first, and the output length of HMAC is set to 4327 bLen. 4329 Concatenate the blocks and extract the first dsLen octets to product 4330 the desired data string DS: 4332 DS = B1 || B2 || ... || Bn<0..j-1> 4334 Output the derived data DS. 4336 E.3.3. Example 4338 If we assume that sLen = 256 (two 128-octet long values) and dsLen = 4339 16, then: 4341 n = ROUND ( 16 / 32 ) = 1 4343 j = 16 - (1 - 1) * 32 = 16 4345 B1 = F (k, s, 1) = HMAC-SHA256 (k, INT (1) || s) 4347 DS = B1<0 ... 15> 4349 That is, the result will be the first 16 octets of the HMAC output. 4351 Authors' Addresses 4353 Andrea Doherty 4354 RSA, The Security Division of EMC 4356 Email: adoherty@rsa.com 4358 Mingliang Pei 4359 VeriSign, Inc. 4361 Email: mpei@verisign.com 4363 Magnus Nystroem 4364 RSA, The Security Division of EMC 4366 Email: magnus@rsa.com 4368 Salah Machani 4369 Diversinet Corp. 4371 Email: smachani@diversinet.com 4373 Full Copyright Statement 4375 Copyright (C) The IETF Trust (2007). 4377 This document is subject to the rights, licenses and restrictions 4378 contained in BCP 78, and except as set forth therein, the authors 4379 retain all their rights. 4381 This document and the information contained herein are provided on an 4382 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 4383 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 4384 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 4385 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 4386 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 4387 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 4389 Intellectual Property 4391 The IETF takes no position regarding the validity or scope of any 4392 Intellectual Property Rights or other rights that might be claimed to 4393 pertain to the implementation or use of the technology described in 4394 this document or the extent to which any license under such rights 4395 might or might not be available; nor does it represent that it has 4396 made any independent effort to identify any such rights. Information 4397 on the procedures with respect to rights in RFC documents can be 4398 found in BCP 78 and BCP 79. 4400 Copies of IPR disclosures made to the IETF Secretariat and any 4401 assurances of licenses to be made available, or the result of an 4402 attempt made to obtain a general license or permission for the use of 4403 such proprietary rights by implementers or users of this 4404 specification can be obtained from the IETF on-line IPR repository at 4405 http://www.ietf.org/ipr. 4407 The IETF invites any interested party to bring to its attention any 4408 copyrights, patents or patent applications, or other proprietary 4409 rights that may cover technology that may be required to implement 4410 this standard. Please address the information to the IETF at 4411 ietf-ipr@ietf.org. 4413 Acknowledgment 4415 Funding for the RFC Editor function is provided by the IETF 4416 Administrative Support Activity (IASA).