idnits 2.17.1 draft-kivinen-ipsecme-oob-pubkey-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 7 longer pages, the longest (page 2) being 60 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC7296, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (April 2015) is 3298 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Obsolete informational reference (is this intentional?): RFC 3447 (Obsoleted by RFC 8017) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 5996 (Obsoleted by RFC 7296) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IP Security Maintenance and Extensions (ipsecme) T. Kivinen 3 Internet-Draft INSIDE Secure 4 Updates: 7296 P. Wouters 5 Intended status: Standards Track Red Hat 6 Expires: October 13, 2015 H. Tschofenig 7 April 2015 9 More Raw Public Keys for IKEv2 10 draft-kivinen-ipsecme-oob-pubkey-09.txt 12 Abstract 14 The Internet Key Exchange Version 2 (IKEv2) protocol currently only 15 supports raw RSA keys. In constrained environments it is useful to 16 make use of other types of public keys, such as those based on 17 Elliptic Curve Cryptography. This documents adds support for other 18 types of raw public keys to IKEv2. 20 Status of this Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on October 13, 2015. 37 Copyright Notice 39 Copyright (c) 2015 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents (http://trustee.ietf.org/ 44 license-info) in effect on the date of publication of this document. 45 Please review these documents carefully, as they describe your rights 46 and restrictions with respect to this document. Code Components 47 extracted from this document must include Simplified BSD License text 48 as described in Section 4.e of the Trust Legal Provisions and are 49 provided without warranty as described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 54 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 55 3. Certificate Encoding Payload . . . . . . . . . . . . . . . . . 2 56 4. Security Considerations . . . . . . . . . . . . . . . . . . . 3 57 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 58 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 4 59 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 4 60 7.1. Normative References . . . . . . . . . . . . . . . . . . . 4 61 7.2. Informative References . . . . . . . . . . . . . . . . . . 4 62 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . . 5 63 Appendix A.1. ECDSA Example . . . . . . . . . . . . . . . . . . 5 64 Appendix A.2. RSA Example . . . . . . . . . . . . . . . . . . . 6 65 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 8 67 1. Introduction 69 Secure DNS allows public keys to be associated with domain names for 70 usage with security protocols like Internet Key Exchange Version 2 71 (IKEv2) [RFC7296] and Transport Layer Security (TLS) [RFC5246] but it 72 relies on extensions in those protocols to be specified. 74 In [RFC5996] IKEv2 had support for PKCS #1 encoded RSA keys, i.e., a 75 DER-encoded RSAPublicKey structure (see [RSA] and [RFC3447]). Other 76 raw public key types are, however, not supported. In [RFC7296] this 77 feature was removed, and this document adds support for raw public 78 keys back to IKEv2 in a more generic way. 80 The TLS Out-of-Band Public Key Validation specification ([RFC7250]) 81 adds generic support for raw public keys to TLS by re-using the 82 SubjectPublicKeyInfo format from the X.509 Public Key Infrastructure 83 Certificate profile [RFC5280]. 85 This document is similar to the TLS Out-of-Band Public Key Validation 86 specification, and applies the concept to IKEv2 to support all public 87 key formats defined by PKIX. This approach also allows future public 88 key extensions to be supported without the need to introduce further 89 enhancements to IKEv2. 91 To support new types of public keys in IKEv2 the following changes 92 are needed: 94 o A new Certificate Encoding format needs to be defined for carrying 95 the SubjectPublicKeyInfo structure. [cert-encoding] specifies 96 this new encoding format. 97 o A new Certificate Encoding type needs to be allocated from the 98 IANA registry. [iana] contains this request to IANA. 100 2. Terminology 102 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 103 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 104 document are to be interpreted as described in [RFC2119]. 106 3. Certificate Encoding Payload 108 Section 3.6 of RFC 7296 defines the Certificate payload format as 109 shown in [payload]. 111 1 2 3 112 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 113 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 114 | Next Payload |C| RESERVED | Payload Length | 115 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 116 | Cert Encoding | | 117 +-+-+-+-+-+-+-+-+ | 118 ~ Certificate Data ~ 119 | | 120 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 122 To support raw public keys, the field values are as follows: 124 o Certificate Encoding (1 octet) - This field indicates the type of 125 certificate or certificate-related information contained in the 126 Certificate Data field. 128 Certificate Encoding Value 129 ---------------------------------------------------- 130 Raw Public Key TBD 131 o Certificate Data (variable length) - Actual encoding of the 132 certificate data. 134 In order to provide a simple and standard way to indicate the key 135 type when the encoding type is 'Raw Public Key', the 136 SubjectPublicKeyInfo structure of the PKIX certificate is used. This 137 is a a very simple encoding, as most of the ASN.1 part can be 138 included literally, and recognized by block comparison. See 139 [RFC7250] Appendix A for a detailed breakdown. In addition, 140 [examples] has several examples. 142 In addition to the Certificate payload, the Cert Encoding for Raw 143 Public Key can be used in the Certificate Request payload. In that 144 case the Certification Authority field MUST be empty if the "Raw 145 Public Key" certificate encoding is used. 147 Implementations MUST follow the public key processing rules of 148 section 1.2 of the Additional Algorithms and Identifiers for RSA 149 Cryptography for PKIX ([RFC4055]) even when the SubjectPublicKeyInfo 150 is not part of a certificate, but rather sent as a Certificate Data 151 field. This means that RSASSA-PSS and RSASSA-PSS-params inside the 152 SubjectPublicKeyInfo structure MUST be sent when applicable. 154 4. Security Considerations 156 An IKEv2 deployment using raw public keys needs to utilize an out-of- 157 band public key validation procedure to be confident in the 158 authenticity of the keys being used. One way to achieve this goal is 159 to use a configuration mechanism for provisioning raw public keys 160 into the IKEv2 software. "Smart object" deployments are likely to 161 use such preconfigured public keys. 163 Another approach is to rely on secure DNS to associate public keys 164 with domain names using the IPSECKEY DNS RRtype [RFC4025]. More 165 information can be found in DNS-Based Authentication of Named 166 Entities (DANE) [RFC6394]. 168 This document does not change the security assumptions made by the 169 IKEv2 specification since "Raw RSA Key" support was already available 170 in IKEv2. This document only generalizes raw public key support. 172 5. IANA Considerations 174 This document allocates a new value from the IKEv2 Certificate 175 Encodings registry: 177 TBD Raw Public Key 179 6. Acknowledgements 181 This document reproduces some parts of the similar TLS document 182 ([RFC7250]). 184 7. References 186 7.1. Normative References 188 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 189 Requirement Levels", BCP 14, RFC 2119, March 1997. 191 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 192 Housley, R. and W. Polk, "Internet X.509 Public Key 193 Infrastructure Certificate and Certificate Revocation List 194 (CRL) Profile", RFC 5280, May 2008. 196 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P. and T. 197 Kivinen, "Internet Key Exchange Protocol Version 2 198 (IKEv2)", STD 79, RFC 7296, October 2014. 200 7.2. Informative References 202 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 203 Standards (PKCS) #1: RSA Cryptography Specifications 204 Version 2.1", RFC 3447, February 2003. 206 [RFC4025] Richardson, M., "A Method for Storing IPsec Keying 207 Material in DNS", RFC 4025, March 2005. 209 [RFC4055] Schaad, J., Kaliski, B. and R. Housley, "Additional 210 Algorithms and Identifiers for RSA Cryptography for use in 211 the Internet X.509 Public Key Infrastructure Certificate 212 and Certificate Revocation List (CRL) Profile", RFC 4055, 213 June 2005. 215 [RFC4754] Fu, D. and J. Solinas, "IKE and IKEv2 Authentication Using 216 the Elliptic Curve Digital Signature Algorithm (ECDSA)", 217 RFC 4754, January 2007. 219 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 220 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 222 [RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R. and T. Polk, 223 "Elliptic Curve Cryptography Subject Public Key 224 Information", RFC 5480, March 2009. 226 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y. and P. Eronen, "Internet 227 Key Exchange Protocol Version 2 (IKEv2)", RFC 5996, 228 September 2010. 230 [RFC6394] Barnes, R., "Use Cases and Requirements for DNS-Based 231 Authentication of Named Entities (DANE)", RFC 6394, 232 October 2011. 234 [RFC7250] Wouters, P., Tschofenig, H., Gilmore, J., Weiler, S. and 235 T. Kivinen, "Using Raw Public Keys in Transport Layer 236 Security (TLS) and Datagram Transport Layer Security 237 (DTLS)", RFC 7250, June 2014. 239 [RSA] R. Rivest, , A. Shamir, and L. Adleman, "A Method for 240 Obtaining Digital Signatures and Public-Key 241 Cryptosystems", February 1978. 243 Appendix A. Examples 245 This appendix provides examples of the actual payloads sent on the 246 wire. 248 Appendix A.1. ECDSA Example 250 This first example uses the 256-bit ECDSA private/public key pair 251 defined in section 8.1 of the IKEv2 ECDSA document [RFC4754]. 253 The public key is as follows: 255 o Algorithm : id-ecPublicKey (1.2.840.10045.2.1) 256 o Fixed curve: secp256r1 (1.2.840.10045.3.1.7) 257 o Public key x coordinate : cb28e099 9b9c7715 fd0a80d8 e47a7707 258 9716cbbf 917dd72e 97566ea1 c066957c 259 o Public key y coordinate : 2b57c023 5fb74897 68d058ff 4911c20f 260 dbe71e36 99d91339 afbb903e e17255dc 262 The SubjectPublicKeyInfo ASN.1 object is as follows: 264 0000 : SEQUENCE 265 0002 : SEQUENCE 266 0004 : OBJECT IDENTIFIER id-ecPublicKey (1.2.840.10045.2.1) 267 000d : OBJECT IDENTIFIER secp256r1 (1.2.840.10045.3.1.7) 268 0017 : BIT STRING (66 bytes) 269 00000000: 0004 cb28 e099 9b9c 7715 fd0a 80d8 e47a 270 00000010: 7707 9716 cbbf 917d d72e 9756 6ea1 c066 271 00000020: 957c 2b57 c023 5fb7 4897 68d0 58ff 4911 272 00000030: c20f dbe7 1e36 99d9 1339 afbb 903e e172 273 00000040: 55dc 275 The first byte (00) of the bit string indicates that there is no 276 "number of unused bits", and the second byte (04) indicates 277 uncompressed form ([RFC5480]). Those two octets are followed by the 278 values of X and Y. 280 The final encoded SubjectPublicKeyInfo object is as follows: 282 00000000: 3059 3013 0607 2a86 48ce 3d02 0106 082a 283 00000010: 8648 ce3d 0301 0703 4200 04cb 28e0 999b 284 00000020: 9c77 15fd 0a80 d8e4 7a77 0797 16cb bf91 285 00000030: 7dd7 2e97 566e a1c0 6695 7c2b 57c0 235f 286 00000040: b748 9768 d058 ff49 11c2 0fdb e71e 3699 287 00000050: d913 39af bb90 3ee1 7255 dc 289 This will result in the final IKEv2 Certificate Payload: 291 00000000: NN00 0060 XX30 5930 1306 072a 8648 ce3d 292 00000010: 0201 0608 2a86 48ce 3d03 0107 0342 0004 293 00000020: cb28 e099 9b9c 7715 fd0a 80d8 e47a 7707 294 00000030: 9716 cbbf 917d d72e 9756 6ea1 c066 957c 295 00000040: 2b57 c023 5fb7 4897 68d0 58ff 4911 c20f 296 00000050: dbe7 1e36 99d9 1339 afbb 903e e172 55dc 298 Where NN is the next payload type (i.e. the type of the payload that 299 immediately follows this Certificate payload). 301 Note to the RFC editor / IANA, replace the XX above with the newly 302 allocated Raw Public Key number (in hex notation), and remove this 303 note. 305 Appendix A.2. RSA Example 307 This second example uses a random 1024-bit RSA key. 309 The public key is as follows: 311 o Algorithm : rsaEncryption (1.2.840.113549.1.1.1) 312 o Modulus n (1024 bits, decimal): 313 1323562071162740912417075551025599045700 314 3972512968992059076067098474693867078469 315 7654066339302927451756327389839253751712 316 9485277759962777278073526290329821841100 317 9721044682579432931952695408402169276996 318 5181887843758615443536914372816830537901 319 8976615344413864477626646564638249672329 320 04996914356093900776754835411 321 o Modulus n (1024 bits, hexadecimal): bc7b4347 49c7b386 00bfa84b 322 44f88187 9a2dda08 d1f0145a f5806c2a ed6a6172 ff0dc3d4 cd601638 323 e8ca348e bdca5742 31cadc97 12e209b1 fddba58a 8c62b369 038a3d1e 324 aa727c1f 39ae49ed 6ebc30f8 d9b52e23 385a4019 15858c59 be72f343 325 fb1eb87b 16ffc5ab 0f8f8fe9 f7cb3e66 3d8fe9f9 ecfa1230 66f36835 326 8ceaefd3 327 o Exponent e (17 bits, decimal): 65537 328 o Exponent e (17 bits, hexadecimal): 10001 330 The SubjectPublicKeyInfo ASN.1 object is as follows: 332 0000 : SEQUENCE 333 0003 : SEQUENCE 334 0005 : OBJECT IDENTIFIER rsaEncryption (1.2.840.113549.1.1.1) 335 0016 : NULL 336 0018 : BIT STRING (141 bytes) 337 00000000: 0030 8189 0281 8100 bc7b 4347 49c7 b386 338 00000010: 00bf a84b 44f8 8187 9a2d da08 d1f0 145a 339 00000020: f580 6c2a ed6a 6172 ff0d c3d4 cd60 1638 340 00000030: e8ca 348e bdca 5742 31ca dc97 12e2 09b1 341 00000040: fddb a58a 8c62 b369 038a 3d1e aa72 7c1f 342 00000050: 39ae 49ed 6ebc 30f8 d9b5 2e23 385a 4019 343 00000060: 1585 8c59 be72 f343 fb1e b87b 16ff c5ab 344 00000070: 0f8f 8fe9 f7cb 3e66 3d8f e9f9 ecfa 1230 345 00000080: 66f3 6835 8cea efd3 0203 0100 01 347 The first byte (00) of the bit string indicates that there is no 348 "number of unused bits". Inside that bit string there is an ASN.1 349 sequence having 2 integers. The second byte (30) indicates that this 350 is beginning of the sequence, and the next byte (81) indicates the 351 length does not fit in 7 bits, but requires one byte, so the length 352 is in the next byte (89). Then starts the first integer with tag (02) 353 and length (81 81). After that we have the modulus (prefixed with 0 354 so it will not be a negative number). After the modulus there follows 355 the tag (02) and length (03) of the exponent, and the last 3 bytes 356 are the exponent. 358 The final encoded SubjectPublicKeyInfo object is as follows: 360 00000000: 3081 9f30 0d06 092a 8648 86f7 0d01 0101 361 00000010: 0500 0381 8d00 3081 8902 8181 00bc 7b43 362 00000020: 4749 c7b3 8600 bfa8 4b44 f881 879a 2dda 363 00000030: 08d1 f014 5af5 806c 2aed 6a61 72ff 0dc3 364 00000040: d4cd 6016 38e8 ca34 8ebd ca57 4231 cadc 365 00000050: 9712 e209 b1fd dba5 8a8c 62b3 6903 8a3d 366 00000060: 1eaa 727c 1f39 ae49 ed6e bc30 f8d9 b52e 367 00000070: 2338 5a40 1915 858c 59be 72f3 43fb 1eb8 368 00000080: 7b16 ffc5 ab0f 8f8f e9f7 cb3e 663d 8fe9 369 00000090: f9ec fa12 3066 f368 358c eaef d302 0301 370 000000a0: 0001 372 This will result in the final IKEv2 Certificate Payload: 374 00000000: NN00 00a7 XX30 819f 300d 0609 2a86 4886 375 00000010: f70d 0101 0105 0003 818d 0030 8189 0281 376 00000020: 8100 bc7b 4347 49c7 b386 00bf a84b 44f8 377 00000030: 8187 9a2d da08 d1f0 145a f580 6c2a ed6a 378 00000040: 6172 ff0d c3d4 cd60 1638 e8ca 348e bdca 379 00000050: 5742 31ca dc97 12e2 09b1 fddb a58a 8c62 380 00000060: b369 038a 3d1e aa72 7c1f 39ae 49ed 6ebc 381 00000070: 30f8 d9b5 2e23 385a 4019 1585 8c59 be72 382 00000080: f343 fb1e b87b 16ff c5ab 0f8f 8fe9 f7cb 383 00000090: 3e66 3d8f e9f9 ecfa 1230 66f3 6835 8cea 384 000000a0: efd3 0203 0100 01 386 Where NN is the next payload type (i.e. the type of the payload that 387 immediately follows this Certificate payload). 389 Note to the RFC editor / IANA, replace the XX above with the newly 390 allocated Raw Public Key number, and remove this note. 392 Authors' Addresses 394 Tero Kivinen 395 INSIDE Secure 396 Eerikinkatu 28 397 HELSINKI, FI-00180 398 FI 400 Email: kivinen@iki.fi 402 Paul Wouters 403 Red Hat 405 Email: pwouters@redhat.com 407 Hannes Tschofenig 409 Email: Hannes.Tschofenig@gmx.net 410 URI: http://www.tschofenig.priv.at