idnits 2.17.1 draft-gutmann-scep-14.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: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (June 9, 2019) is 1783 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: 'CERT-NONEXISTENT' on line 378 -- Looks like a reference, but probably isn't: 'CERT-REQ-PENDING' on line 378 -- Looks like a reference, but probably isn't: 'CERT-ISSUED' on line 378 ** Obsolete normative reference: RFC 7230 (ref. '11') (Obsoleted by RFC 9110, RFC 9112) -- Obsolete informational reference (is this intentional?): RFC 5751 (ref. '20') (Obsoleted by RFC 8551) Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group P. Gutmann 3 Internet-Draft University of Auckland 4 Intended status: Informational June 9, 2019 5 Expires: December 11, 2019 7 Simple Certificate Enrolment Protocol 8 draft-gutmann-scep-14 10 Abstract 12 This document specifies the Simple Certificate Enrolment Protocol 13 (SCEP), a PKI protocol that leverages existing technology by using 14 CMS (formerly known as PKCS #7) and PKCS #10 over HTTP. SCEP is the 15 evolution of the enrolment protocol sponsored by Cisco Systems, which 16 enjoys wide support in both client and server implementations, as 17 well as being relied upon by numerous other industry standards that 18 work with certificates. 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 https://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 December 11, 2019. 37 Copyright Notice 39 Copyright (c) 2019 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 44 (https://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 This document may contain material from IETF Documents or IETF 53 Contributions published or made publicly available before November 54 10, 2008. The person(s) controlling the copyright in some of this 55 material may not have granted the IETF Trust the right to allow 56 modifications of such material outside the IETF Standards Process. 57 Without obtaining an adequate license from the person(s) controlling 58 the copyright in such materials, this document may not be modified 59 outside the IETF Standards Process, and derivative works of it may 60 not be created outside the IETF Standards Process, except to format 61 it for publication as an RFC or to translate it into languages other 62 than English. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 67 1.1. Conventions Used in This Document . . . . . . . . . . . . 4 68 2. SCEP Overview . . . . . . . . . . . . . . . . . . . . . . . . 4 69 2.1. SCEP Entities . . . . . . . . . . . . . . . . . . . . . . 4 70 2.1.1. Client . . . . . . . . . . . . . . . . . . . . . . . 4 71 2.1.2. Certificate Authority . . . . . . . . . . . . . . . . 5 72 2.2. CA Certificate Distribution . . . . . . . . . . . . . . . 5 73 2.3. Client authentication . . . . . . . . . . . . . . . . . . 6 74 2.4. Enrolment authorisation . . . . . . . . . . . . . . . . . 7 75 2.5. Certificate Enrolment/Renewal . . . . . . . . . . . . . . 8 76 2.5.1. Client State Transitions . . . . . . . . . . . . . . 8 77 2.6. Certificate Access . . . . . . . . . . . . . . . . . . . 10 78 2.7. CRL Access . . . . . . . . . . . . . . . . . . . . . . . 11 79 2.8. Certificate Revocation . . . . . . . . . . . . . . . . . 11 80 2.9. Mandatory-to-Implement Functionality . . . . . . . . . . 11 81 3. SCEP Secure Message Objects . . . . . . . . . . . . . . . . . 12 82 3.1. SCEP Message Object Processing . . . . . . . . . . . . . 14 83 3.2. SCEP pkiMessage . . . . . . . . . . . . . . . . . . . . . 14 84 3.2.1. Signed Transaction Attributes . . . . . . . . . . . . 14 85 3.2.1.1. transactionID . . . . . . . . . . . . . . . . . . 16 86 3.2.1.2. messageType . . . . . . . . . . . . . . . . . . . 17 87 3.2.1.3. pkiStatus . . . . . . . . . . . . . . . . . . . . 17 88 3.2.1.4. failInfo and failInfoText . . . . . . . . . . . . 17 89 3.2.1.5. senderNonce and recipientNonce . . . . . . . . . 18 90 3.2.2. SCEP pkcsPKIEnvelope . . . . . . . . . . . . . . . . 18 91 3.3. SCEP pkiMessage types . . . . . . . . . . . . . . . . . . 19 92 3.3.1. PKCSReq/RenewalReq . . . . . . . . . . . . . . . . . 19 93 3.3.2. CertRep . . . . . . . . . . . . . . . . . . . . . . . 19 94 3.3.2.1. CertRep SUCCESS . . . . . . . . . . . . . . . . . 20 95 3.3.2.2. CertRep FAILURE . . . . . . . . . . . . . . . . . 20 96 3.3.2.3. CertRep PENDING . . . . . . . . . . . . . . . . . 20 98 3.3.3. CertPoll (GetCertInitial) . . . . . . . . . . . . . . 21 99 3.3.4. GetCert and GetCRL . . . . . . . . . . . . . . . . . 21 100 3.4. Degenerate certificates-only CMS Signed-Data . . . . . . 22 101 3.5. CA Capabilities . . . . . . . . . . . . . . . . . . . . . 22 102 3.5.1. GetCACaps HTTP Message Format . . . . . . . . . . . . 22 103 3.5.2. CA Capabilities Response Format . . . . . . . . . . . 22 104 4. SCEP Transactions . . . . . . . . . . . . . . . . . . . . . . 25 105 4.1. HTTP POST and GET Message Formats . . . . . . . . . . . . 25 106 4.2. Get CA Certificate . . . . . . . . . . . . . . . . . . . 26 107 4.2.1. Get CA Certificate Response Message Format . . . . . 27 108 4.2.1.1. CA Certificate Response Message Format . . . . . 27 109 4.2.1.2. CA Certificate Chain Response Message Format . . 27 110 4.3. Certificate Enrolment/Renewal . . . . . . . . . . . . . . 27 111 4.3.1. Certificate Enrolment/Renewal Response Message . . . 28 112 4.4. Poll for Client Initial Certificate . . . . . . . . . . . 28 113 4.4.1. Polling Response Message Format . . . . . . . . . . . 29 114 4.5. Certificate Access . . . . . . . . . . . . . . . . . . . 29 115 4.5.1. Certificate Access Response Message Format . . . . . 29 116 4.6. CRL Access . . . . . . . . . . . . . . . . . . . . . . . 29 117 4.6.1. CRL Access Response Message Format . . . . . . . . . 29 118 4.7. Get Next Certificate Authority Certificate . . . . . . . 29 119 4.7.1. Get Next CA Response Message Format . . . . . . . . . 30 120 5. SCEP Transaction Examples . . . . . . . . . . . . . . . . . . 30 121 5.1. Successful Transactions . . . . . . . . . . . . . . . . . 30 122 5.2. Transactions with Errors . . . . . . . . . . . . . . . . 31 123 6. Contributors/Acknowledgements . . . . . . . . . . . . . . . . 34 124 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 125 8. Security Considerations . . . . . . . . . . . . . . . . . . . 35 126 8.1. General Security . . . . . . . . . . . . . . . . . . . . 35 127 8.2. Use of the CA private key . . . . . . . . . . . . . . . . 35 128 8.3. ChallengePassword Shared Secret Value . . . . . . . . . . 36 129 8.4. Lack of Certificate Issue Confirmation . . . . . . . . . 36 130 8.5. GetCACaps Issues . . . . . . . . . . . . . . . . . . . . 37 131 8.6. Lack of PoP in Renewal Requests . . . . . . . . . . . . . 37 132 8.7. Traffic Monitoring . . . . . . . . . . . . . . . . . . . 38 133 8.8. Unnecessary cryptography . . . . . . . . . . . . . . . . 38 134 8.9. Use of SHA-1 . . . . . . . . . . . . . . . . . . . . . . 38 135 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 39 136 9.1. Normative References . . . . . . . . . . . . . . . . . . 39 137 9.2. Informative References . . . . . . . . . . . . . . . . . 40 138 Appendix A. Background Notes . . . . . . . . . . . . . . . . . . 41 139 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 44 141 1. Introduction 143 X.509 certificates serve as the basis for several standardised 144 security protocols such as TLS [23], S/MIME [20], and IKE/IPsec [19]. 145 When an X.509 certificate is issued there typically is a need for a 146 certificate management protocol to enable a PKI client to request or 147 renew a certificate from a Certificate Authority (CA). This 148 specification defines a protocol, Simple Certificate Enrolment 149 Protocol (SCEP), for certificate management and certificate and CRL 150 queries. 152 The SCEP protocol supports the following general operations: 154 o CA public key distribution. 155 o Certificate enrolment and issue. 156 o Certificate renewal. 157 o Certificate query. 158 o CRL query. 160 SCEP makes extensive use of CMS [10] and PKCS #10 [13]. 162 1.1. Conventions Used in This Document 164 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 165 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 166 "OPTIONAL" in this document are to be interpreted as described in [1] 167 and [5] when, and only when, they appear in all capitals, as shown 168 here. 170 This document uses the Augmented Backus-Naur Form (ABNF) notation as 171 specified in [6] for defining formal syntax of commands. Non- 172 terminals not defined in [6] are defined in Section 4.1. 174 2. SCEP Overview 176 This section provides an overview of the functionality of SCEP. 178 2.1. SCEP Entities 180 The entity types defined in SCEP are a client requesting a 181 certificate and a Certificate Authority (CA) that issues the 182 certificate. These are described in the following sections. 184 2.1.1. Client 186 A client MUST have the following information locally configured: 188 1. The CA's fully qualified domain name or IP address. 189 2. Any identification and/or authorisation information required by 190 the CA before a certificate will be issued, as described in 191 Section 3.3.1. 192 3. The identifying information that is used for authentication of 193 the CA in Section 4.2.1, typically a certificate fingerprint. 195 2.1.2. Certificate Authority 197 A SCEP CA is the entity that signs client certificates. A CA may 198 enforce policies and apply them to certificate requests, and may 199 reject a request for any reason. 201 Since the client is expected to perform signature verification and 202 optionally encryption using the CA certificate, the keyUsage 203 extension in the CA certificate MUST indicate that it is valid for 204 digitalSignature and keyEncipherment (if the key is to be used for 205 en/decryption) alongside the usual CA usages of keyCertSign and/or 206 cRLSign. 208 2.2. CA Certificate Distribution 210 If the CA certificate(s) have not previously been acquired by the 211 client through some other means, the client MUST retrieve them before 212 any PKI operation (Section 3) can be started. Since no public key 213 has yet been exchanged between the client and the CA, the messages 214 cannot be secured using CMS, and the CA certificate request and 215 response data is instead transferred in the clear. 217 If an intermediate CA is in use, a certificates-only CMS Signed-Data 218 message with a certificate chain consisting of all CA certificates is 219 returned. Otherwise the CA certificate itself is returned. 221 The CA certificate MAY be provided out-of-band to the client. 222 Alternatively, the CA certificate fingerprint MAY be used to 223 authenticate a CA Certificate distributed by the GetCACert response 224 (Section 4.2) or via HTTP certificate-store access [17]. The 225 fingerprint is created by calculating a SHA-256 hash over the whole 226 CA certificate (for legacy reasons, a SHA-1 hash may be used by some 227 implementations). 229 After the client gets the CA certificate, it SHOULD authenticate it 230 in some manner unless this is deemed unnecessary, for example because 231 the device is being provisioned inside a trusted environment. For 232 example it could compare its fingerprint with locally configured, 233 out-of-band distributed, identifying information, or by some 234 equivalent means such as a direct comparison with a locally-stored 235 copy of the certificate. 237 Intermediate CA certificates, if any, are signed by a higher-level CA 238 so there is no need to authenticate them against the out-of-band 239 data. Since intermediate CA certificates are rolled over more 240 frequently than long-lived top-level CA certificates, clients MUST 241 verify intermediate-level CA certificates before use during protocol 242 exchanges in case the intermediate CA certificate has expired or 243 otherwise been invalidated. 245 When a CA certificate expires, certificates that have been signed by 246 it may no longer be regarded as valid. CA key rollover provides a 247 mechanism by which the CA can distribute a new CA certificate which 248 is valid in the future once the current certificate has expired. 249 This is done via the GetNextCACert message (section Section 4.7). 251 2.3. Client authentication 253 As with every protocol that uses public-key cryptography, the 254 association between the public keys used in the protocol and the 255 identities with which they are associated must be authenticated in a 256 cryptographically secure manner. Communications between the client 257 and the CA are secured using SCEP Secure Message Objects as explained 258 in Section 3, which specifies how CMS is used to encrypt and sign the 259 data. In order to perform the signing operation the client uses an 260 appropriate local certificate: 262 1. If the client does not have an appropriate existing certificate 263 then a locally generated self-signed certificate MUST be used. 264 The keyUsage extension in the certificate MUST indicate that it 265 is valid for digitalSignature and keyEncipherment (if available). 266 The self-signed certificate SHOULD use the same subject name and 267 key as in the PKCS #10 request. In this case the messageType is 268 PKCSReq (see Section 3.2.1.2). 269 2. If the client already has a certificate issued by the SCEP CA and 270 the CA supports renewal (see Section 2.5), that certificate 271 SHOULD be used. In this case the messageType is RenewalReq (see 272 Section 3.2.1.2). 273 3. Alternatively, if the client has no certificate issued by the 274 SCEP CA but has credentials from an alternate CA then the 275 certificate issued by the alternate CA MAY be used in a renewal 276 request as described above. The SCEP CA's policy will determine 277 whether the request can be accepted or not. 279 Note that although the above text describes several different types 280 of operations, for historical reasons most implementations always 281 apply the first one even if an existing certificate already exists. 282 For this reason support for the first case is mandatory while support 283 for the latter ones are optional (see Section 2.9). 285 During the certificate enrolment process, the client MUST use the 286 selected certificate's key when signing the CMS envelope (see 287 Section 3). This certificate will be either the self-signed one 288 matching the PKCS #10 request or the CA-issued one used to authorise 289 a renewal, and MUST be included in the signedData certificates field 290 (possibly as part of a full certificate chain). If the key being 291 certified allows encryption then the CA's CertResp will use the same 292 certificate's public key when encrypting the response. 294 Note that in the case of renewal operations this means that the 295 request will be signed and authenticated with the key in the 296 previously-issued certificate rather than the key in the PKCS #10 297 request, and the response may similarly be returned encrypted with 298 the key in the previously-issued certificate. This has security 299 implications, see Section 8.6. 301 2.4. Enrolment authorisation 303 PKCS #10 [13] specifies a PKCS #9 [12] challengePassword attribute to 304 be sent as part of the enrolment request. When utilizing the 305 challengePassword, the CA distributes a shared secret to the client 306 which will be used to authenticate the request from the the client. 307 It is RECOMMENDED that the challengePassword be a one-time 308 authenticator value to limit the ability of an attacker who can 309 capture the authenticator from the client or CA to re-use it to 310 request further certificates. 312 Inclusion of the challengePassword by the SCEP client is RECOMMENDED, 313 however its omission allows for unauthenticated authorisation of 314 enrolment requests (which may, however, require manual approval of 315 each certificate issue if other security measures to control issue 316 aren't in place, see below). Inclusion is OPTIONAL for renewal 317 requests that are authenticated by being signed with an existing 318 certificate. The CMS envelope protects the privacy of the 319 challengePassword. 321 A client that is performing certificate renewal as per Section 2.5 322 SHOULD omit the challengePassword but MAY send the originally 323 distributed shared secret in the challengePassword attribute. The 324 SCEP CA MAY use the challengePassword in addition to the previously 325 issued certificate that signs the request to authenticate the 326 request. The SCEP CA MUST NOT attempt to authenticate a client based 327 on a self-signed certificate unless it has been verified through out- 328 of-band means such as a certificate fingerprint. 330 To perform the authorisation in manual mode the client's request is 331 placed in the PENDING state until the CA operator authorises or 332 rejects it. Manual authorisation is used when the client has only a 333 self-signed certificate that hasn't been previously authenticated by 334 the CA and/or a challengePassword is not available. The SCEP CA MAY 335 either reject unauthorised requests or mark them for manual 336 authorisation according to CA policy. 338 2.5. Certificate Enrolment/Renewal 340 A client starts an enrolment transaction (Section 3.3.1) by creating 341 a certificate request using PKCS #10 and sends it to the CA enveloped 342 using CMS (Section 3). 344 If the CA supports certificate renewal and if the CA policy permits 345 then a new certificate with new validity dates can be issued even 346 though the old one is still valid. To renew an existing certificate, 347 the client uses the RenewalReq message (see Section 3.3) and signs it 348 with the existing client certificate. The client SHOULD use a new 349 keypair when requesting a new certificate, but MAY request a new 350 certificate using the old keypair. 352 If the CA returns a CertRep message (Section 3.3.2) with status set 353 to PENDING, the client enters into polling mode by periodically 354 sending a CertPoll message (Section 3.3.3) to the CA until the CA 355 operator completes the manual authentication (approving or denying 356 the request). The frequency of the polling operation is a CA/client 357 configuration issue, and may range from seconds or minutes when the 358 issue process is automatic but not instantaneous, through to hours or 359 days if the certificate issue operation requires manual approval. 361 If polling mode is being used then the client will send a single 362 PKCSReq/RenewalReq message (Section 3.3.1), followed by 0 or more 363 CertPoll messages (Section 3.3.3). The CA will in return send 0 or 364 more CertRep messages (Section 3.3.2) with status set to PENDING in 365 response to CertPolls, followed by a single CertRep message 366 (Section 3.3.2) with status set to either SUCCESS or FAILURE. 368 2.5.1. Client State Transitions 370 The client state transitions during the SCEP process are indicated in 371 Figure 1. 373 CertPoll 374 +-----<----+ 375 | | 376 | | CertRep(PENDING) 377 | | 378 [CERT-NONEXISTENT] ------> [CERT-REQ-PENDING] ---------> [CERT-ISSUED] 379 ^ PKCSReq | CertRep(SUCCESS) 380 | RenewalReq | 381 | | 382 +-----------------------+ 383 CertRep(FAILURE) or 384 Max-time/max-polls exceeded 386 Figure 1: State Transition Diagram 388 The certificate issue process starts at state CERT-NONEXISTENT. 389 Sending a PKCSReq/RenewalReq message changes the state to CERT-REQ- 390 PENDING. 392 If the CA returns a CertRep message with pkiStatus set to SUCCESS 393 then the state changes to CERT-ISSUED. 395 If the CA returns a CertRep message with pkiStatus set to FAILURE or 396 there is no response then the state reverts back to CERT-NONEXISTENT. 398 If the CA returns a CertRep message with pkiStatus set to PENDING 399 then the client will keep polling by sending a CertPoll message until 400 either a CertRep message with status set to SUCCESS or FAILURE is 401 received or a timeout occurs or the maximum number of polls has been 402 exceeded. 404 A successful transaction in automatic mode: 406 CLIENT CA SERVER 408 PKCSReq: PKI cert. enrolment message 409 --------------------------------> CertRep: pkiStatus = SUCCESS 410 Certificate attached 411 <------------------------------ 412 Receive issued certificate. 414 A successful transaction in manual mode: 416 CLIENT CA SERVER 418 PKCSReq: PKI cert. enrolment message 419 --------------------------------> CertRep: pkiStatus = PENDING 420 <------------------------------ 421 CertPoll: Polling message 422 --------------------------------> CertRep: pkiStatus = PENDING 423 <------------------------------ 424 ................ ............... 426 CertPoll: Polling message 427 --------------------------------> CertRep: pkiStatus = SUCCESS 428 Certificate attached 429 <------------------------------ 430 Receive issued certificate. 432 2.6. Certificate Access 434 A certificate query message is defined for clients to retrieve a copy 435 of their own certificate from the CA. It allows clients that do not 436 store their certificates locally to obtain a copy when needed. This 437 functionality is not intended to provide a general purpose 438 certificate access service, which may be instead be achieved via HTTP 439 certificate-store access [17] or LDAP. 441 To retrieve a certificate from the CA, a client sends a request 442 consisting of the certificate's issuer name and serial number. This 443 assumes that the client has saved the issuer name and the serial 444 number of the issued certificate from the previous enrolment 445 transaction. The transaction to retrieve a certificate consists of 446 one GetCert (Section 3.3.4) message and one CertRep (Section 3.3.2) 447 message, as shown below. 449 CLIENT CA SERVER 451 GetCert: PKI certificate query message 452 -------------------------------> CertRep: pkiStatus = SUCCESS 453 Certificate attached 454 <----------------------------- 455 Receive the certificate. 457 2.7. CRL Access 459 SCEP clients MAY request a CRL via one of three methods: 461 1. If the CA supports the CRL Distribution Points (CRLDPs) extension 462 [14] in issued certificates, then the CRL MAY be retrieved via 463 the mechanism specified in the CRDLP. 464 2. If the CA supports HTTP certificate-store access [17], then the 465 CRL MAY be retrieved via the AuthorityInfoAcces [14] location 466 specified in the certificate. 467 3. Only if the CA does not support CRDLPs or HTTP access should a 468 CRL query be composed by creating a GetCRL message consisting of 469 the issuer name and serial number from the certificate whose 470 revocation status is being queried. 472 The message is sent to the SCEP CA in the same way as the other SCEP 473 requests. The transaction to retrieve a CRL consists of one GetCRL 474 PKI message and one CertRep PKI message, which contains only the CRL 475 (no certificates) in a degenerate certificates-only CMS Signed-Data 476 message (Section 3.4), as shown below. 478 CLIENT CA SERVER 480 GetCRL: PKI CRL query message 481 ----------------------------------> 482 CertRep: CRL attached 483 <----------------------------- 484 Receive the CRL 486 2.8. Certificate Revocation 488 SCEP does not specify a method to request certificate revocation. In 489 order to revoke a certificate, the client must contact the CA using a 490 non-SCEP defined mechanism. 492 2.9. Mandatory-to-Implement Functionality 494 At a minimum, all SCEP implementations compliant with this 495 specification MUST support GetCACaps (Section 3.5.1), GetCACert 496 (Section 4.2), PKCSReq (Section 3.3.1) (and its associated response 497 messages), communication of binary data via HTTP POST (Section 4.1), 498 and the AES128-CBC [7] and SHA-256 [8] algorithms to secure 499 pkiMessages (Section 3.2). 501 For historical reasons implementations MAY support communications of 502 binary data via HTTP GET (Section 4.1), and the triple DES-CBC and 503 SHA-1 algorithms to secure pkiMessages (Section 3.2). 504 Implementations MUST NOT support the obsolete and/or insecure single 505 DES and MD5 algorithms used in earlier versions of this 506 specification, since the unsecured nature of GetCACaps means that an 507 in-path attacker can trivially roll back the encryption used to these 508 insecure algorithms, see Section 8.5. 510 3. SCEP Secure Message Objects 512 CMS is a general enveloping mechanism that enables both signed and 513 encrypted transmission of arbitrary data. SCEP messages that require 514 confidentiality use two layers of CMS, as shown using ASN.1-like 515 pseudocode in Figure 2. By applying both enveloping and signing 516 transformations, the SCEP message is protected both for the integrity 517 of its end-to-end transaction information and the confidentiality of 518 its information portion. 520 pkiMessage { 521 contentType = signedData { pkcs-7 2 }, 522 content { 523 digestAlgorithms, 524 encapsulatedContentInfo { 525 eContentType = data { pkcs-7 1 }, 526 eContent { -- pkcsPKIEnvelope, optional 527 contentType = envelopedData { pkcs-7 3 }, 528 content { 529 recipientInfo, 530 encryptedContentInfo { 531 contentType = data { pkcs-7 1 }, 532 contentEncrAlgorithm, 533 encryptedContent { 534 messageData -- Typically PKCS #10 request 535 } 536 } 537 } 538 } 539 }, 540 certificates, -- Optional 541 crls, -- Optional 542 signerInfo { 543 signedAttrs { 544 transactionID, 545 messageType, 546 pkiStatus, 547 failInfo, -- Optional 548 senderNonce / recipientNonce, 549 }, 550 signature 551 } 552 } 553 } 555 Figure 2: CMS Layering 557 When a particular SCEP message carries data, this data is carried in 558 the messageData. CertRep messages will lack any signed content and 559 consist only of a pkcsPKIEnvelope (Section 3.2.2). 561 The remainder of this document will refer only to 'messageData', but 562 it is understood to always be encapsulated in the pkcsPKIEnvelope 563 (Section 3.2.2). The format of the data in the messageData is 564 defined by the messageType attribute (see Section 3.2) of the Signed- 565 Data. If there is no messageData to be transmitted, the entire 566 pkcsPKIEnvelope MUST be omitted. 568 Samples of SCEP messages are available through the JSCEP project [18] 569 in the src/samples directory. 571 3.1. SCEP Message Object Processing 573 Creating a SCEP message consists of several stages. The content to 574 be conveyed (in other words the messageData) is first encrypted, and 575 the encrypted content is then signed. 577 The form of encryption to be applied depends on the capabilities of 578 the recipient's public key. If the key is encryption-capable (for 579 example RSA) then the messageData is encrypted using the recipient's 580 public key with the CMS KeyTransRecipientInfo mechanism. If the key 581 is not encryption-capable (for example DSA or ECDSA) then the 582 messageData is encrypted using the challengePassword with the CMS 583 PasswordRecipientInfo mechanism. 585 Once the messageData has been encrypted, it is signed with the 586 sender's public key. This completes the SCEP message that is then 587 sent to the recipient. 589 Note that some early implementations of this specification dealt with 590 non-encryption-capable keys by omitting the encryption stage, based 591 on the text in Section 3 that indicated that "the EnvelopedData is 592 omitted". This alternative processing mechanism SHOULD NOT be used 593 since it exposes in cleartext the challengePassword used to authorise 594 the certificate issue. 596 3.2. SCEP pkiMessage 598 The basic building block of all secured SCEP messages is the SCEP 599 pkiMessage. It consists of a CMS Signed-Data content type. The 600 following restrictions apply: 602 o The eContentType in encapsulatedContentInfo MUST be data ({pkcs-7 603 1}). 604 o The signed content, if present (FAILURE and PENDING CertRep 605 messages will lack any signed content), MUST be a pkcsPKIEnvelope 606 (Section 3.2.2), and MUST match the messageType attribute. 607 o The SignerInfo MUST contain a set of authenticatedAttributes 608 (Section 3.2.1). 610 3.2.1. Signed Transaction Attributes 612 At a minimum, all messages MUST contain the following 613 authenticatedAttributes: 615 o A transactionID attribute (see Section 3.2.1.1). 617 o A messageType attribute (see Section 3.2.1.2). 618 o A fresh senderNonce attribute (see Section 3.2.1.5). Note however 619 the comment about senderNonces and polling in Section 3.3.2 620 o Any attributes required by CMS. 622 If the message is a CertRep, it MUST also include the following 623 authenticatedAttributes: 625 o A pkiStatus attribute (see Section 3.2.1.3). 626 o A failInfo and optional failInfotext attribute (see 627 Section 3.2.1.4) if pkiStatus = FAILURE. 628 o A recipientNonce attribute (see Section 3.2.1.5) copied from the 629 senderNonce in the request that this is a response to. 631 The following transaction attributes are encoded as authenticated 632 attributes, and are carried in the SignerInfo for this Signed-Data. 634 +----------------+-----------------+--------------------------------+ 635 | Attribute | Encoding | Comment | 636 +----------------+-----------------+--------------------------------+ 637 | transactionID | PrintableString | Unique ID for this transaction | 638 | | | as a text string | 639 | | | | 640 | messageType | PrintableString | Decimal value as a numeric | 641 | | | text string | 642 | | | | 643 | pkiStatus | PrintableString | Decimal value as a numeric | 644 | | | text string | 645 | | | | 646 | failInfo | PrintableString | Decimal value as a numeric | 647 | | | text string | 648 | | | | 649 | failInfoText | UTF8String | Descriptive text for the | 650 | | | failInfo value | 651 | | | | 652 | senderNonce | OCTET STRING | Random nonce as a 16-byte | 653 | | | binary data string | 654 | | | | 655 | recipientNonce | OCTET STRING | Random nonce as a 16-byte | 656 | | | binary data string | 657 +----------------+-----------------+--------------------------------+ 658 The OIDs used for these attributes are as follows: 660 +----------------------+--------------------------------------------+ 661 | Name | ASN.1 Definition | 662 +----------------------+--------------------------------------------+ 663 | id-VeriSign | OBJECT_IDENTIFIER ::= {2 16 US(840) 1 | 664 | | VeriSign(113733)} | 665 | | | 666 | id-pki | OBJECT_IDENTIFIER ::= {id-VeriSign pki(1)} | 667 | | | 668 | id-attributes | OBJECT_IDENTIFIER ::= {id-pki | 669 | | attributes(9)} | 670 | | | 671 | id-transactionID | OBJECT_IDENTIFIER ::= {id-attributes | 672 | | transactionID(7)} | 673 | | | 674 | id-messageType | OBJECT_IDENTIFIER ::= {id-attributes | 675 | | messageType(2)} | 676 | | | 677 | id-pkiStatus | OBJECT_IDENTIFIER ::= {id-attributes | 678 | | pkiStatus(3)} | 679 | | | 680 | id-failInfo | OBJECT_IDENTIFIER ::= {id-attributes | 681 | | failInfo(4)} | 682 | | | 683 | id-senderNonce | OBJECT_IDENTIFIER ::= {id-attributes | 684 | | senderNonce(5)} | 685 | | | 686 | id-recipientNonce | OBJECT_IDENTIFIER ::= {id-attributes | 687 | | recipientNonce(6)} | 688 | | | 689 | id-scep | OBJECT IDENTIFIER ::= {id-pkix TBD1} | 690 | | | 691 | id-scep-failInfoText | OBJECT IDENTIFIER ::= {id-scep 1} | 692 +----------------------+--------------------------------------------+ 694 The attributes are detailed in the following sections. 696 3.2.1.1. transactionID 698 A PKI operation is a transaction consisting of the messages exchanged 699 between a client and the CA. The transactionID is a text string 700 provided by the client when starting a transaction. The client MUST 701 use a unique string as the transaction identifier, encoded as a 702 PrintableString, which MUST be used for all PKI messages exchanged 703 for a given operation such as a certificate issue. 705 Note that the transactionID must be unique, but not necessarily 706 randomly generated. For example it may be a value assigned by the CA 707 to allow the client to be identified by their transactionID, using a 708 value such as the client device's EUI or RTU ID or a similar unique 709 identifier. This can be useful when the client doesn't have a pre- 710 assigned Distinguished Name that the CA can identify their request 711 through, for example when enrolling SCADA devices. 713 3.2.1.2. messageType 715 The messageType attribute specifies the type of operation performed 716 by the transaction. This attribute MUST be included in all PKI 717 messages. The following message types are defined: 719 o CertRep ("3") -- Response to certificate or CRL request. 720 o RenewalReq ("17") -- PKCS #10 certificate request authenticated 721 with an existing certificate. 722 o PKCSReq ("19") -- PKCS #10 certificate request authenticated with 723 a shared secret. 724 o CertPoll ("20") -- Certificate polling in manual enrolment. 725 o GetCert ("21") -- Retrieve a certificate. 726 o GetCRL ("22") -- Retrieve a CRL. 728 Message types not defined above MUST be treated as an error unless 729 their use has been negotiated through GetCACaps (Section 3.5.1). 731 3.2.1.3. pkiStatus 733 All response messages MUST include transaction status information, 734 which is defined as a pkiStatus attribute: 736 o SUCCESS ("0") -- Request granted. 737 o FAILURE ("2") -- Request rejected. In this case the failInfo 738 attribute, as defined in Section 3.2.1.4, MUST also be present. 739 o PENDING ("3") -- Request pending for manual approval. 741 PKI status values not defined above MUST be treated as an error 742 unless their use has been negotiated through GetCACaps 743 (Section 3.5.1). 745 3.2.1.4. failInfo and failInfoText 747 The failInfo attribute MUST contain one of the following failure 748 reasons: 750 o badAlg ("0") -- Unrecognized or unsupported algorithm. 751 o badMessageCheck ("1") -- Integrity check (meaning signature 752 verification of the CMS message) failed. 754 o badRequest ("2") -- Transaction not permitted or supported. 755 o badTime ("3") -- The signingTime attribute from the CMS 756 authenticatedAttributes was not sufficiently close to the system 757 time. This condition may occur if the CA is concerned about 758 replays of old messages. 759 o badCertId ("4") -- No certificate could be identified matching the 760 provided criteria. 762 Failure reasons not defined above MUST be treated as an error unless 763 their use has been negotiated through GetCACaps (Section 3.5.1). 765 The failInfoText is a free-form UTF-8 text string that provides 766 further information in the case of pkiStatus = FAILURE. In 767 particular it may be used to provide details on why a certificate 768 request was not granted that go beyond what's provided by the near- 769 universal failInfo = badRequest status. Since this is a free-form 770 text string intended for interpretation by humans, implementations 771 SHOULD NOT assume that it has any type of machine-processable 772 content. 774 3.2.1.5. senderNonce and recipientNonce 776 The senderNonce and recipientNonce attributes are a 16 byte random 777 number generated for each transaction. These are intended to prevent 778 replay attacks. 780 When a sender sends a PKI message to a recipient, a fresh senderNonce 781 MUST be included in the message. The recipient MUST copy the 782 senderNonce into the recipientNonce of the reply as a proof of 783 liveliness. The original sender MUST verify that the recipientNonce 784 of the reply matches the senderNonce it sent in the request. If the 785 nonce does not match then the message MUST be rejected. 787 Note that since SCEP exchanges consist of a single request followed 788 by a single response, the use of distinct sender and recipient nonces 789 is redundant since the client sends a nonce in its request and the CA 790 responds with the same nonce in its reply. In effect there's just a 791 single nonce, identified as senderNonce in the client's request and 792 recipientNonce in the CA's reply. 794 3.2.2. SCEP pkcsPKIEnvelope 796 The information portion of a SCEP message is carried inside an 797 EnvelopedData content type, as defined in CMS, with the following 798 restrictions: 800 o contentType in encryptedContentInfo MUST be data ({pkcs-7 1}). 802 o encryptedContent MUST be the SCEP message being transported (see 803 Section 4), and must match the messageType authenticated Attribute 804 in the pkiMessage. 806 3.3. SCEP pkiMessage types 808 All of the messages in this section are pkiMessages (Section 3.2), 809 where the type of the message MUST be specified in the 'messageType' 810 authenticated Attribute. Each section defines a valid message type, 811 the corresponding messageData formats, and mandatory authenticated 812 attributes for that type. 814 3.3.1. PKCSReq/RenewalReq 816 The messageData for this type consists of a PKCS #10 Certificate 817 Request. The certificate request MUST contain at least the following 818 items: 820 o The subject Distinguished Name. 821 o The subject public key. 822 o For a PKCSReq and if authorisation based on a shared secret is 823 being used, a challengePassword attribute. 825 In addition the message must contain the the authenticatedAttributes 826 specified in Section 3.2.1. 828 3.3.2. CertRep 830 The messageData for this type consists of a degenerate certificates- 831 only CMS Signed-Data message (Section 3.4). The exact content 832 required for the reply depends on the type of request that this 833 message is a response to. The request types are detailed in 834 Section 3.3.2.1 and in Section 4. In addition the message must 835 contain the the authenticatedAttributes specified in Section 3.2.1. 837 Earlier versions of this specification required that this message 838 include a senderNonce alongside the recipientNonce, which was to be 839 used to chain to subsequent polling operations. However if a single 840 message was lost during the potentially extended interval over which 841 polling could take place (see Section 5 for an example of this) then 842 if the implementation were to enforce this requirement the overall 843 transaction would fail even though nothing had actually gone wrong. 844 Because of this issue, implementations mostly ignored the requirement 845 to carry this nonce over to subsequent polling messages or to verify 846 its presence. More recent versions of the specification no longer 847 require the chaining of nonces across polling operations. 849 3.3.2.1. CertRep SUCCESS 851 When the pkiStatus attribute is set to SUCCESS, the messageData for 852 this message consists of a degenerate certificates-only CMS Signed- 853 Data message (Section 3.4). The content of this degenerate 854 certificates-only Signed-Data depends on what the original request 855 was, as outlined below. 857 +--------------+----------------------------------------------------+ 858 | Request-type | Reply-contents | 859 +--------------+----------------------------------------------------+ 860 | PKCSReq | The reply MUST contain at least the issued | 861 | | certificate in the certificates field of the | 862 | | Signed-Data. The reply MAY contain additional | 863 | | certificates, but the issued certificate MUST be | 864 | | the leaf certificate. | 865 | | | 866 | RenewalReq | Same as PKCSReq | 867 | | | 868 | CertPoll | Same as PKCSReq | 869 | | | 870 | GetCert | The reply MUST contain at least the requested | 871 | | certificate in the certificates field of the | 872 | | Signed-Data. The reply MAY contain additional | 873 | | certificates, but the requested certificate MUST | 874 | | be the leaf certificate. | 875 | | | 876 | GetCRL | The reply MUST contain the CRL in the crls field | 877 | | of the Signed-Data. | 878 +--------------+----------------------------------------------------+ 880 3.3.2.2. CertRep FAILURE 882 When the pkiStatus attribute is set to FAILURE, the reply MUST also 883 contain a failInfo (Section 3.2.1.4) attribute set to the appropriate 884 error condition describing the failure. The reply MAY also contain a 885 failInfoText attribute providing extended details on why the 886 operation failed, typically to expand on the catch-all failInfo = 887 badRequest status. The pkcsPKIEnvelope (Section 3.2.2) MUST be 888 omitted. 890 3.3.2.3. CertRep PENDING 892 When the pkiStatus attribute is set to PENDING, the pkcsPKIEnvelope 893 (Section 3.2.2) MUST be omitted. 895 3.3.3. CertPoll (GetCertInitial) 897 This message is used for certificate polling. For unknown reasons it 898 was referred to as "GetCertInitial" in earlier versions of this 899 specification. The messageData for this type consists of an 900 IssuerAndSubject: 902 issuerAndSubject ::= SEQUENCE { 903 issuer Name, 904 subject Name 905 } 907 The issuer is set to the subjectName of the CA (in other words the 908 intended issuerName of the certificate that's being requested). The 909 subject is set to the subjectName used when requesting the 910 certificate. 912 Note that both of these fields are redundant, the CA is identified by 913 the recipientInfo in the pkcsPKIEnvelope (or in most cases simply by 914 the server that the message is being sent to) and the client/ 915 transaction being polled is identified by the transactionID. Both of 916 these fields can be processed by the CA without going through the 917 cryptographically expensive process of unwrapping and processing the 918 issuerAndSubject. For this reason implementations SHOULD assume that 919 the polling operation will be controlled by the recipientInfo and 920 transactionID rather than the contents of the messageData. In 921 addition the message must contain the the authenticatedAttributes 922 specified in Section 3.2.1. 924 3.3.4. GetCert and GetCRL 926 The messageData for these types consist of an IssuerAndSerialNumber 927 as defined in CMS which uniquely identifies the certificate being 928 requested, either the certificate itself for GetCert or its 929 revocation status via a CRL for GetCRL. In addition the message must 930 contain the the authenticatedAttributes specified in Section 3.2.1. 932 These message types, while included here for completeness, apply 933 unnecessary cryptography and messaging overhead to the simple task of 934 transferring a certificate or CRL (see Section 8.8). Implementations 935 SHOULD prefer HTTP certificate-store access [17] or LDAP over the use 936 of these messages. 938 3.4. Degenerate certificates-only CMS Signed-Data 940 CMS includes a degenerate case of the Signed-Data content type in 941 which there are no signers. The use of such a degenerate case is to 942 disseminate certificates and CRLs. For SCEP the content field of the 943 ContentInfo value of a degenerate certificates-only Signed-Data MUST 944 be omitted. When carrying certificates, the certificates are 945 included in the 'certificates' field of the Signed-Data. When 946 carrying a CRL, the CRL is included in the 'crls' field of the 947 Signed-Data. 949 3.5. CA Capabilities 951 In order to provide support for future enhancements to the protocol, 952 CAs MUST implement the GetCACaps message to allow clients to query 953 which functionality is available from the CA. 955 3.5.1. GetCACaps HTTP Message Format 957 This message requests capabilities from a CA, with the format: 959 "GET" SP SCEPPATH "?operation=GetCACaps" SP HTTP-version CRLF 961 as described in Section 4.1. 963 3.5.2. CA Capabilities Response Format 964 The response for a GetCACaps message is a list of CA capabilities, in 965 plain text and in any order, separated by or 966 characters. This specification defines the following keywords 967 (quotation marks are not sent): 969 +--------------------+----------------------------------------------+ 970 | Keyword | Description | 971 +--------------------+----------------------------------------------+ 972 | "AES" | CA supports the AES128-CBC encryption | 973 | | algorithm. | 974 | | | 975 | "DES3" | CA supports the triple DES-CBC encryption | 976 | | algorithm. | 977 | | | 978 | "GetNextCACert" | CA supports the GetNextCACert message. | 979 | | | 980 | "POSTPKIOperation" | CA supports PKIOPeration messages sent via | 981 | | HTTP POST. | 982 | | | 983 | "Renewal" | CA supports the Renewal CA operation. | 984 | | | 985 | "SHA-1" | CA supports the SHA-1 hashing algorithm. | 986 | | | 987 | "SHA-256" | CA supports the SHA-256 hashing algorithm. | 988 | | | 989 | "SHA-512" | CA supports the SHA-512 hashing algorithm. | 990 | | | 991 | "SCEPStandard" | CA supports all mandatory-to-implement | 992 | | sections of the SCEP standard. This keyword | 993 | | implies "AES", "POSTPKIOperation", and | 994 | | "SHA-256", as well as the provisions of | 995 | | Section 2.9. | 996 +--------------------+----------------------------------------------+ 998 The table above lists all of the keywords that are defined in this 999 specification. A CA MAY provide additional keywords advertising 1000 further capabilities and functionality. A client MUST be able to 1001 accept and ignore any unknown keywords that might be sent by a CA. 1003 The CA MUST use the text case specified here, but clients SHOULD 1004 ignore the text case when processing this message. Clients MUST 1005 accept the standard HTTP-style -delimited text as well as the 1006 - delimited text specified in an earlier version of this 1007 specification. 1009 The client SHOULD use SHA-256 in preference to SHA-1 hashing and 1010 AES128-CBC in preference to triple DES-CBC if they are supported by 1011 the CA. Although the CMS format allows any form of AES and SHA-2 to 1012 be specified, in the interests of interoperability the de facto 1013 universal standards of AES128-CBC and SHA-256 SHOULD be used. 1015 Announcing some of these capabilities individually is redundant since 1016 they're required as mandatory-to-implement functionality (see 1017 Section 2.9) whose presence as a whole is signalled by the 1018 "SCEPStandard" capability, but it may be useful to announce them in 1019 order to deal with older implementations that would otherwise default 1020 to obsolete, insecure algorithms and mechanisms. 1022 If the CA supports none of the above capabilities it SHOULD return an 1023 empty message. A CA MAY simply return an HTTP error. A client that 1024 receives an empty message or an HTTP error SHOULD interpret the 1025 response as if none of the capabilities listed are supported by the 1026 CA. 1028 Note that at least one widely-deployed server implementation supports 1029 several of the above operations but doesn't support the GetCACaps 1030 message to indicate that it supports them, and will close the 1031 connection if sent a GetCACaps message. This means that the 1032 equivalent of GetCACaps must be performed through server 1033 fingerprinting, which can be done using the ID string "Microsoft- 1034 IIS". Newer versions of the same server, if sent a SCEP request 1035 using AES and SHA-2, will respond with an invalid response that can't 1036 be decrypted, requiring the use of 3DES and SHA-1 in order to obtain 1037 a response that can be processed even if AES and/or SHA-2 are 1038 allegedly supported. In addition the server will generate CA 1039 certificates that only have one, but not both, of the keyEncipherment 1040 and digitalSignature keyUsage flags set, requiring that the client 1041 ignore the keyUsage flags in order to use the certificates for SCEP. 1043 The Content-type of the reply SHOULD be "text/plain". Clients SHOULD 1044 ignore the Content-type, as older implementations of SCEP may send 1045 various Content-types. 1047 Example: 1049 GET /cgi-bin/pkiclient.exe?operation=GetCACaps HTTP/1.1 1050 might return: 1052 AES 1053 GetNextCACert 1054 POSTPKIOperation 1055 SCEPStandard 1056 SHA-256 1058 This means that the CA supports modern crypto algorithms, the 1059 GetNextCACert message, allows PKIOperation messages (PKCSReq/ 1060 RenewalReq, GetCert, CertPoll, ...) to be sent using HTTP POST, and 1061 is compliant with the final version of the SCEP standard. 1063 4. SCEP Transactions 1065 This section describes the SCEP Transactions and their HTTP [11] 1066 transport mechanism. 1068 Note that SCEP doesn't follow best current practices on usage of 1069 HTTP. In particular it recommends ignoring some Media Types and 1070 hardcodes specific URI paths. Guidance on the appropriate 1071 application of HTTP in these circumstances may be found in [16]. 1073 4.1. HTTP POST and GET Message Formats 1075 SCEP uses the HTTP "POST" and "GET" HTTP methods [11] to exchange 1076 information with the CA. The following defines the ABNF syntax of 1077 HTTP POST and GET methods sent from a client to a CA: 1079 POSTREQUEST = "POST" SP SCEPPATH "?operation=" OPERATION 1080 SP HTTP-version CRLF 1082 GETREQUEST = "GET" SP SCEPPATH "?operation=" OPERATION 1083 "&message=" MESSAGE SP HTTP-version CRLF 1085 where: 1087 o SCEPPATH is the HTTP URL path for accessing the CA. Clients 1088 SHOULD set SCEPPATH to the fixed string "/cgi-bin/pkiclient.exe" 1089 unless directed to do otherwise by the CA. 1090 o OPERATION depends on the SCEP transaction and is defined in the 1091 following sections. 1092 o HTTP-version is the HTTP version string, which is "HTTP/1.1" for 1093 [11]. 1095 o SP and CRLF are space and carriage return/linefeed as defined in 1096 [6]. 1098 The CA will typically ignore SCEPPATH since it's unlikely to be 1099 issuing certificates via a web server. Clients SHOULD set SCEPPATH 1100 to the fixed string "/cgi-bin/pkiclient.exe" unless directed to do 1101 otherwise by the CA. The CA SHOULD ignore the SCEPPATH unless its 1102 precise format is critical to the CA's operation. 1104 Early SCEP drafts performed all communications via "GET" messages, 1105 including non-idempotent ones that should have been sent via "POST" 1106 messages, see [16] for details. This has caused problems because of 1107 the way that the (supposedly) idempotent GET interacts with caches 1108 and proxies, and because the extremely large GET requests created by 1109 encoding CMS messages may be truncated in transit. These issues are 1110 typically not visible when testing on a LAN, but crop up during 1111 deployment over WANs. If the remote CA supports POST, the CMS- 1112 encoded SCEP messages MUST be sent via HTTP POST instead of HTTP GET. 1113 This applies to any SCEP message except GetCACert, GetNextCACert, and 1114 GetCACaps, and avoids the need for base64- and URL-encoding that's 1115 required for GET messaging. The client can verify that the CA 1116 supports SCEP messages via POST by looking for the "SCEPStandard" or 1117 "POSTPKIOperation" capability (See Section 3.5.2). 1119 If a client or CA uses HTTP GET and encounters HTTP-related problems 1120 such as messages being truncated, seeing errors such as HTTP 414 1121 ("Request URI too long"), or simply having the message not sent/ 1122 received at all, when standard requests to the server (for example 1123 via a web browser) work, then this is a symptom of the problematic 1124 use of HTTP GET. The solution to this problem is to update the 1125 implementation to use HTTP POST instead. In addition when using GET 1126 it's recommended to test the implementation from as many different 1127 network locations as possible to determine whether the use of GET 1128 will cause problems with communications. 1130 When using GET messages to communicate binary data, base64 encoding 1131 as specified in [9] Section 4 MUST be used. The base64 encoded data 1132 is distinct from "base64url" and may contain URI reserved characters, 1133 thus it MUST be escaped as specified in [15] in addition to being 1134 base64 encoded. Finally, the encoded data is inserted into the 1135 MESSAGE portion of the HTTP GET request. 1137 4.2. Get CA Certificate 1139 To get the CA certificate(s), the client sends a GetCACert message to 1140 the CA. The OPERATION MUST be set to "GetCACert". There is no 1141 request data associated with this message. 1143 4.2.1. Get CA Certificate Response Message Format 1145 The response for GetCACert is different between the case where the CA 1146 directly communicates with the client during the enrolment and the 1147 case where an intermediate CA exists and the client communicates with 1148 this CA during the enrolment. 1150 4.2.1.1. CA Certificate Response Message Format 1152 If the CA does not have any intermediate CA certificates, the 1153 response consists of a single X.509 CA certificate. The response 1154 will have a Content-Type of "application/x-x509-ca-cert". 1156 "Content-Type: application/x-x509-ca-cert" 1158 1160 4.2.1.2. CA Certificate Chain Response Message Format 1162 If the CA has intermediate CA certificates, the response consists of 1163 a degenerate certificates-only CMS Signed-Data message (Section 3.4) 1164 containing the certificates, with the intermediate CA certificate(s) 1165 as the leaf certificate(s). The response will have a Content-Type of 1166 "application/x-x509-ca-ra-cert". Note that this designation is used 1167 for historical reasons due to its use in older versions of this 1168 specification, no special meaning should be attached to the label. 1170 "Content-Type: application/x-x509-ca-ra-cert" 1172 1174 4.3. Certificate Enrolment/Renewal 1176 A PKCSReq/RenewalReq (Section 3.3.1) message is used to perform a 1177 certificate enrolment or renewal transaction. The OPERATION MUST be 1178 set to "PKIOperation". Note that when used with HTTP POST, the only 1179 OPERATION possible is "PKIOperation", so many CAs don't check this 1180 value or even notice its absence. When implemented using HTTP POST 1181 the message is sent with a Content-Type of "application/x-pki- 1182 message" and might look as follows: 1184 POST /cgi-bin/pkiclient.exe?operation=PKIOperation HTTP/1.1 1185 Content-Length: 1186 Content-Type: application/x-pki-message 1188 1190 When implemented using HTTP GET this might look as follows: 1192 GET /cgi-bin/pkiclient.exe?operation=PKIOperation& \ 1193 message=MIAGCSqGSIb3DQEHA6CAMIACAQAxgDCBzAIBADB2MG \ 1194 IxETAPBgNVBAcTCE......AAAAAA== HTTP/1.1 1196 4.3.1. Certificate Enrolment/Renewal Response Message 1198 If the request is granted, a CertRep SUCCESS message 1199 (Section 3.3.2.1) is returned. If the request is rejected, a CertRep 1200 FAILURE message (Section 3.3.2.2) is returned. If the CA is 1201 configured to manually authenticate the client, a CertRep PENDING 1202 message (Section 3.3.2.3) MAY be returned. The CA MAY return a 1203 PENDING for other reasons. 1205 The response will have a Content-Type of "application/x-pki-message". 1207 "Content-Type: application/x-pki-message" 1209 1211 4.4. Poll for Client Initial Certificate 1213 When the client receives a CertRep message with pkiStatus set to 1214 PENDING, it will enter the polling state by periodically sending 1215 CertPoll messages to the CA until either the request is granted and 1216 the certificate is sent back or the request is rejected or some 1217 preconfigured time limit for polling or maximum number of polls is 1218 exceeded. The OPERATION MUST be set to "PKIOperation". 1220 CertPoll messages exchanged during the polling period MUST carry the 1221 same transactionID attribute as the previous PKCSReq/RenewalReq. A 1222 CA receiving a CertPoll for which it does not have a matching 1223 PKCSReq/RenewalReq MUST reject this request. 1225 Since at this time the certificate has not been issued, the client 1226 can only use its own subject name (which was contained in the 1227 original PKCS# 10 sent via PKCSReq/RenewalReq) to identify the polled 1228 certificate request (but see the note on identification during 1229 polling in Section 3.3.3). In theory there can be multiple 1230 outstanding requests from one client (for example, if different keys 1231 and different key-usages were used to request multiple certificates), 1232 so the transactionID must also be included to disambiguate between 1233 multiple requests. In practice however the client SHOULD NOT have 1234 multiple requests outstanding at any one time, since this tends to 1235 confuse some CAs. 1237 4.4.1. Polling Response Message Format 1239 The response messages for CertPoll are the same as in Section 4.3.1. 1241 4.5. Certificate Access 1243 A client can query an issued certificate from the SCEP CA, as long as 1244 the client knows the issuer name and the issuer assigned certificate 1245 serial number. 1247 This transaction consists of one GetCert (Section 3.3.4) message sent 1248 to the CA by a client, and one CertRep (Section 3.3.2) message sent 1249 back from the CA. The OPERATION MUST be set to "PKIOperation". 1251 4.5.1. Certificate Access Response Message Format 1253 In this case, the CertRep from the CA is same as in Section 4.3.1, 1254 except that the CA will either grant the request (SUCCESS) or reject 1255 it (FAILURE). 1257 4.6. CRL Access 1259 Clients can request a CRL from the SCEP CA as described in 1260 Section 2.7. The OPERATION MUST be set to "PKIOperation". 1262 4.6.1. CRL Access Response Message Format 1264 The CRL is sent back to the client in a CertRep (Section 3.3.2) 1265 message. The information portion of this message is a degenerate 1266 certificates-only Signed-Data (Section 3.4) that contains only the 1267 most recent CRL in the crls field of the Signed-Data. 1269 4.7. Get Next Certificate Authority Certificate 1271 When a CA certificate is about to expire, clients need to retrieve 1272 the CA's next CA certificate (i.e. the rollover certificate). This 1273 is done via the GetNextCACert message. The OPERATION MUST be set to 1274 "GetNextCACert". There is no request data associated with this 1275 message. 1277 4.7.1. Get Next CA Response Message Format 1279 The response consists of a Signed-Data CMS message, signed by the 1280 current CA signing key. Clients MUST validate the signature on the 1281 message before trusting any of its contents. The response will have 1282 a Content-Type of "application/x-x509-next-ca-cert". 1284 "Content-Type: application/x-x509-next-ca-cert" 1286 1288 The content of the Signed-Data message is a degenerate certificates- 1289 only Signed-Data message (Section 3.4) containing the new CA 1290 certificate(s) to be used when the current CA certificate expires. 1292 5. SCEP Transaction Examples 1294 The following section gives several examples of client to CA 1295 transactions. Client actions are indicated in the left column, CA 1296 actions are indicated in the right column, and the transactionID is 1297 given in parentheses (for ease of reading small integer values have 1298 been used, in practice full transaction IDs would be used). The 1299 first transaction, for example, would read like this: 1301 "Client Sends PKCSReq message with transactionID 1 to the CA. The CA 1302 signs the certificate and constructs a CertRep Message containing the 1303 signed certificate with a transaction ID 1. The client receives the 1304 message and installs the certificate locally". 1306 5.1. Successful Transactions 1308 Successful Enrolment Case: Automatic processing 1310 PKCSReq (1) ----------> CA issues certificate 1311 <---------- CertRep (1) SUCCESS 1312 Client installs certificate 1313 Successful Enrolment Case: Manual authentication required 1315 PKCSReq (2) ----------> Cert request goes into queue 1316 <---------- CertRep (2) PENDING 1317 CertPoll (2) ----------> Still pending 1318 <---------- CertRep (2) PENDING 1319 CertPoll (2) ----------> CA issues certificate 1320 <---------- CertRep (2) SUCCESS 1321 Client installs certificate 1323 CA certificate rollover case: 1325 GetNextCACert ----------> 1326 <---------- New CA certificate 1328 PKCSReq* ----------> CA issues certificate with 1329 new key 1330 <---------- CertRep SUCCESS 1331 Client stores certificate 1332 for installation when 1333 existing certificate expires. 1335 * Enveloped for the new CA certificate. The CA will use the envelope 1336 to determine which key to use to issue the client certificate. 1338 5.2. Transactions with Errors 1340 In the case of polled transactions that aren't completed 1341 automatically, there are two potential options for dealing with a 1342 transaction that's interrupted due to network or software/hardware 1343 issues. The first is for the client to preserve its transaction 1344 state and resume the CertPoll polling when normal service is 1345 restored. The second is for the client to begin a new transaction by 1346 sending a new PKCSReq/RenewalReq rather than continuing the previous 1347 CertPoll. Both options have their own advantages and disadvantages. 1349 The CertPoll continuation requires that the client maintain its 1350 transaction state for the time when it resumes polling. This is 1351 relatively simple if the problem is a brief network outage, but less 1352 simple when the problem is a client crash and restart. In addition 1353 the CA may treat a lost network connection as the end of a 1354 transaction, so that a new connection followed by a CertPoll will be 1355 treated as an error. 1357 The PKCSReq/RenewalReq continuation doesn't require any state to be 1358 maintained since it's a new transaction, however it may cause 1359 problems on the CA side if the certificate was successfully issued 1360 but the client never received it, since the resumed transaction 1361 attempt will appear to be a request for a duplicate certificate (see 1362 Section 8.4 for more on why this is a problem). In this case the CA 1363 may refuse the transaction, or require manual intervention to remove/ 1364 revoke the previous certificate before the client can request another 1365 one. 1367 Since the new-transaction resume is more robust in the presence of 1368 errors and doesn't require special-case handling by either the client 1369 or CA, clients SHOULD use the new-transaction option in preference to 1370 the resumed-CertPoll option to recover from errors. 1372 Resync Case 1: Client resyncs via new PKCSReq (recommended): 1374 PKCSReq (3) ----------> Cert request goes into queue 1375 <---------- CertRep (3) PENDING 1376 CertPoll (3) ----------> Still pending 1377 X-------- CertRep(3) PENDING 1378 (Network outage) 1379 (Client reconnects) 1380 PKCSReq (4) ----------> 1381 <---------- CertRep (4) PENDING 1382 etc... 1384 Resync Case 2: Client resyncs via resumed CertPoll after a network 1385 outage (not recommended, use PKCSReq to resync): 1387 PKCSReq (5) ----------> Cert request goes into queue 1388 <---------- CertRep (5) PENDING 1389 CertPoll (5) ----------> Still pending 1390 X-------- CertRep(5) PENDING 1391 (Network outage) 1392 (Client reconnects) 1393 CertPoll (5) ----------> CA issues certificate 1394 <---------- CertRep (5) SUCCESS 1395 Client installs certificate 1396 Resync Case 3: Special-case variation of case 2 where the CertRep 1397 SUCCESS rather than the CertRep PENDING is lost (recommended): 1399 PKCSReq (6) ----------> Cert request goes into queue 1400 <---------- CertRep (6) PENDING 1401 CertPoll (6) ----------> Still pending 1402 <---------- CertRep (6) PENDING 1403 CertPoll (6) ----------> CA issues certificate 1404 X-------- CertRep(6) SUCCESS 1405 (Network outage) 1406 (Client reconnects) 1407 PKCSReq (7) ----------> There is already a valid 1408 certificate with this DN. 1409 <---------- CertRep (7) FAILURE 1410 Admin revokes certificate 1411 PKCSReq (8) ----------> CA issues new certificate 1412 <---------- CertRep (8) SUCCESS 1413 Client installs certificate 1415 Resync Case 4: Special-case variation of case 1 where the CertRep 1416 SUCCESS rather than the CertRep PENDING is lost (not recommended, use 1417 PKCSReq to resync): 1419 PKCSReq (9) ----------> Cert request goes into queue 1420 <---------- CertRep (9) PENDING 1421 CertPoll (9) ----------> Still pending 1422 <---------- CertRep (9) PENDING 1423 CertPoll (9) ----------> CA issues certificate 1424 X-------- CertRep(9) SIGNED CERT 1425 (Network outage) 1426 (Client reconnects) 1427 CertPoll (9) ----------> Certificate already issued 1428 <---------- CertRep (9) SUCCESS 1429 Client installs certificate 1431 As these examples indicate, resumption from an error via a resumed 1432 CertPoll is tricky due to the state that needs to be held by both the 1433 client and/or the CA. A PKCSReq/RenewalReq resume is the easiest to 1434 implement since it's stateless and is identical for both polled and 1435 non-polled transactions, while a CertPoll resume treats the two 1436 differently (a non-polled transaction is resumed with a PKCSReq/ 1437 RenewalReq, a polled transaction is resumed with a CertPoll). For 1438 this reason error recovery SHOULD be handled via a new PKCSReq rather 1439 than a resumed CertPoll. 1441 6. Contributors/Acknowledgements 1443 The editor would like to thank all of the previous editors, authors 1444 and contributors: Cheryl Madson, Xiaoyi Liu, David McGrew, David 1445 Cooper, Andy Nourse, Max Pritikin, Jan Vilhuber, and others for their 1446 work maintaining the draft over the years. The IETF reviewers 1447 provided much useful feedback that helped improve the draft, and in 1448 particular spotted a number of things that were present in SCEP 1449 through established practice rather than by being explicitly 1450 described in the text. Numerous other people have contributed during 1451 the long life cycle of the draft and all deserve thanks. In addition 1452 several PKCS #7 / CMS libraries contributed to interoperability by 1453 doing the right thing despite what earlier SCEP drafts required. 1455 The earlier authors would like to thank Peter William of ValiCert, 1456 Inc. (formerly of VeriSign, Inc.) and Alex Deacon of VeriSign, Inc. 1457 and Christopher Welles of IRE, Inc. for their contributions to early 1458 versions of this protocol and this document. 1460 7. IANA Considerations 1462 One object identifier for an arc to assign SCEP Attribute Identifiers 1463 was assigned in the SMI Security for PKIX (1.3.6.1.5.5.7) registry, 1464 Simple Certificate Enrollment Protocol Attributes denoted as id-scep: 1466 id-scep OBJECT IDENTIFIER ::= { id-pkix TBD1 } 1468 (Editor's note: When the OID is assigned, the values in the OID table 1469 in Section 3.2 will also need to be updated). 1471 This assignment created the new SMI Security for SCEP Attribute 1472 Identifiers ((1.3.6.1.5.5.7.TBD1) registry with the following entries 1473 with references to this document: 1475 id-scep-failInfoText OBJECT IDENTIFIER ::= { id-scep 1 } 1477 Entries in the registry are assigned according to the "Specification 1478 Required" policy defined in [4]. 1480 Section 3.2.1.2 describes a SCEP Message Type Registry and 1481 Section 3.5 describes a SCEP CA Capabilities Registry to be 1482 maintained by the IANA, defining a number of such code point 1483 identifiers. Entries in the registry are to be assigned according to 1484 the "Specification Required" policy defined in [4]. 1486 This document defines four media types for IANA registration: 1488 "application/x-x509-ca-cert" 1489 "application/x-x509-ca-ra-cert" 1490 "application/x-x509-next-ca-cert" 1491 "application/x-pki-message" 1493 Note that these are grandfathered media types registered as per 1494 Appendix A of [2]. 1496 8. Security Considerations 1498 The security goal of SCEP is that no adversary can subvert the public 1499 key/identity binding from that intended. An adversary is any entity 1500 other than the client and the CA participating in the protocol. 1502 This goal is met through the use of CMS and PKCS #10 encryption and 1503 digital signatures using authenticated public keys. The CA's public 1504 key is authenticated via out-of-band means such as the checking of 1505 the CA fingerprint and the SCEP client's public key is authenticated 1506 through manual or pre-shared secret authentication. 1508 8.1. General Security 1510 Common key-management considerations such as keeping private keys 1511 truly private and using adequate lengths for symmetric and asymmetric 1512 keys must be followed in order to maintain the security of this 1513 protocol. This is especially true for CA keys which, when 1514 compromised, compromise the security of all relying parties. 1516 8.2. Use of the CA private key 1518 A CA private key is generally meant for, and is usually flagged as, 1519 being usable for certificate (and CRL) signing exclusively rather 1520 than data signing or encryption. The SCEP protocol however uses the 1521 CA private key to both sign and optionally encrypt CMS transport 1522 messages. This is generally considered undesirable as it widens the 1523 possibility of an implementation weakness and provides an additional 1524 location where the private key must be used (and hence is slightly 1525 more vulnerable to exposure) and where a side-channel attack might be 1526 applied. 1528 8.3. ChallengePassword Shared Secret Value 1530 The security measures that should be applied to the challengePassword 1531 shared secret depend on the manner in which SCEP is employed. In the 1532 simplest case, with SCEP used to provision devices with certificates 1533 in the manufacturing facility, the physical security of the facility 1534 may be enough to protect the certificate issue process with no 1535 additional measures explicitly required. In general though the 1536 security of the issue process depends on the security employed around 1537 the use of the challengePassword shared secret. While it's not 1538 possible to enumerate every situation in which SCEP may be utilised, 1539 the following security measures should be considered. 1541 o The challengePassword, despite its name, shouldn't be a 1542 conventional password but a high-entropy shared secret 1543 authentication string. Using the base64 encoding of a keying 1544 value generated or exchanged as part of standard device 1545 authentication protocols like EAP or DNP3 SA makes for a good 1546 challengePassword. The use of high-entropy shared secrets is 1547 particulary important when the PasswordRecipientInfo option is 1548 used to encrypt SCEP messages, see Section 3.1. 1549 o If feasible, the challengePassword should be a one-time value used 1550 to authenticate the issue of a single certificate (subsequent 1551 certificate requests will be authenticated by being signed with 1552 the initial certificate). If the challengePassword is single-use 1553 then the arrival of subsequent requests using the same 1554 challengePassword can then be used to indicate a security breach. 1555 o The lifetime of a challengePassword can be limited, so that it can 1556 be used during initial device provisioning but will have expired 1557 at a later date if an attacker manages to compromise the 1558 challengePassword value, for example by compromising the device 1559 that it's stored in. 1560 o The CA should take appropriate measures to protect the 1561 challengePassword, for example via physical security measures, or 1562 by storing it as a salted iterated hash or equivalent memory-hard 1563 function or as a keyed MAC value if it's not being used for 1564 encryption, or by storing it in encrypted form if it is being used 1565 for encryption. 1567 8.4. Lack of Certificate Issue Confirmation 1569 SCEP provides no confirmation that the issued certificate was 1570 successfully received and processed by the client. This means that 1571 if the CertRep message is lost or can't be processed by the client 1572 then the CA will consider the certificate successfully issued while 1573 the client won't. If this situation is of concern then the correct 1574 issuance of the certificate will need to be verified by out-of-band 1575 means, for example through the client sending a message signed by the 1576 newly-issued certificate to the CA. This also provides the proof of 1577 possession that's not present in the case of a renewal operation, see 1578 Section 8.6. 1580 8.5. GetCACaps Issues 1582 The GetCACaps response is not authenticated by the CA. This allows 1583 an attacker to perform downgrade attacks on the cryptographic 1584 capabilities of the client/CA exchange. In particular if the server 1585 were to support MD5 and single DES then an in-path attacker could 1586 trivially roll back the encryption to use these insecure algorithms. 1587 By taking advantage of the presence of large amounts of static known 1588 plaintext in the SCEP messages, as of 2017 a DES rainbow table attack 1589 can recover most encryption keys in under a minute, and MD5 chosen- 1590 prefix collisions can be calculated for a few tens of cents of 1591 computing time using tools like HashClash. It is for this reason 1592 that this specification makes single DES and MD5 a MUST NOT feature. 1593 Note that all known servers support at least triple DES and SHA-1 1594 (regardless of whether "DES3" and "SHA-1" are indicated in 1595 GetCACaps), so there should never be a reason to fall all the way 1596 back to single DES and MD5. One simple countermeasure to a GetCACaps 1597 downgrade attack is for clients that are operating in an environment 1598 where on-path attacks are possible and that expect the "SCEPStandard" 1599 capability to be indicated by the CA but don't see it in the 1600 GetCACaps response to treat its absence as a security issue, and 1601 either discontinue the exchange or continue as if "SCEPStandard" had 1602 been returned. This requires a certain tradeoff between 1603 compatibility with old servers and security against active attacks. 1605 8.6. Lack of PoP in Renewal Requests 1607 Renewal operations (but not standard certificate-issue operations) 1608 are processed via a previously-issued certificate and its associated 1609 private key, not the key in the PKCS #10 request. This means that a 1610 client no longer demonstrates proof of possession (PoP) of the 1611 private key corresponding to the public key in the PKCS #10 request. 1612 It is therefore possible for a client to re-certify an existing key 1613 used by a third party, so that two or more certificates exist for the 1614 same key. By switching out the certificate in a signature, an 1615 attacker can appear to have a piece of data signed by their 1616 certificate rather than the original signer's certificate. This, and 1617 other, attacks are described in S/MIME ESS [21]. 1619 Avoiding these types of attacks requires situation-specific measures. 1620 For example CMS/SMIME implementations may use the ESSCertID attribute 1621 from S/MIME ESS [21] or its successor S/MIME ESSv2 [22] to 1622 unambiguously identify the signing certificate. However since other 1623 mechanisms and protocols that the certificates will be used with 1624 typically don't defend against this problem, it's unclear whether 1625 this is an actual issue with SCEP. 1627 8.7. Traffic Monitoring 1629 SCEP messages are signed with certificates that may contain 1630 identifying information. If these are sent over the public Internet 1631 and real identity information (rather than placeholder values or 1632 arbitrary device IDs) are included in the signing certificate data, 1633 an attacker may be able to monitor the identities of the entities 1634 submitting the certificate requests. If this is an issue then [3] 1635 should be consulted for guidance. 1637 8.8. Unnecessary cryptography 1639 Some of the SCEP exchanges use unnecessary signing and encryption 1640 operations. In particular the GetCert and GetCRL exchanges are 1641 encrypted and signed in both directions. The information requested 1642 is public and thus encrypting the requests is of questionable value. 1643 In addition CRLs and certificates sent in responses are already 1644 signed by the CA and can be verified by the recipient without 1645 requiring additional signing and encryption. More lightweight means 1646 of retrieving certificates and CRLs such as HTTP certificate-store 1647 access [17] and LDAP are recommended for this reason. 1649 8.9. Use of SHA-1 1651 The majority of the large numbers of devices that use SCEP today 1652 default to SHA-1, with many supporting only that hash algorithm with 1653 no ability to upgrade to a newer one. SHA-1 is no longer regarded as 1654 secure in all situations, but as used in SCEP it's still safe. There 1655 are three reasons for this. The first is that attacking SCEP would 1656 require creating a fully general SHA-1 collision in close to real 1657 time alongside breaking AES (more specifically, it would require 1658 creating a fully general SHA-1 collision for the PKCS #10 request, 1659 breaking the AES encryption around the PKCS #10 request, and then 1660 creating a second SHA-1 collision for the signature on the encrypted 1661 data), which won't be feasible for a long time. 1663 The second reason is that the signature over the message, in other 1664 words the SHA-1 hash that isn't protected by encryption, doesn't 1665 serve any critical cryptographic purpose: The PKCS #10 data itself is 1666 authenticated through its own signature, protected by encryption, and 1667 the overall request is authorised by the (encrypted) shared secret. 1668 The sole exception to this will be the small number of 1669 implementations that support the Renewal operation, which may be 1670 authorised purely through a signature, but presumably any 1671 implementation recent enough to support Renewal also supports SHA-2. 1673 Any legacy implementation that supports the historic core SCEP 1674 protocol would not be affected. 1676 The third reason is that SCEP uses the same key for encryption and 1677 signing, so that even if an attacker were able to capture an outgoing 1678 Renewal request that didn't include a shared secret (in other words 1679 one that was only authorised through a signature), break the AES 1680 encryption, forge the SHA-1 hash in real time, and forward the forged 1681 request to the CA, they couldn't decrypt the returned certificate, 1682 which is protected with the same key that was used to generate the 1683 signature. While Section 8.8 points out that SCEP uses unnecessary 1684 cryptography in places, the additional level of security provided by 1685 the extra crypto makes it immune to any issues with SHA-1. 1687 This doesn't mean that SCEP implementations should continue to use 1688 SHA-1 in perpetuity, merely that there's no need for a panicked 1689 switch to SHA-2. 1691 9. References 1693 9.1. Normative References 1695 [1] Bradner, S., "Key words for use in RFCs to Indicate 1696 Requirement Levels", BCP 14, RFC 2119, March 1997. 1698 [2] Freed, N., Klensin, J., and T. Hansen, "Media Type 1699 Specifications and Registration Procedures", RFC 6838, 1700 January 2013. 1702 [3] Farrell, S. and H. Tschofenig, "Guidelines for Writing an 1703 IANA Considerations Section in RFCs", RFC 7258, May 2014. 1705 [4] Leiba, B. and T. Narten, "Guidelines for Writing an IANA 1706 Considerations Section in RFCs", RFC 8126, June 2017. 1708 [5] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1709 2119 Key Words", RFC 8174, May 2017. 1711 [6] Crocker, R. and P. Overell, "Augmented BNF for Syntax 1712 Specifications: ABNF", RFC 5234, January 2008. 1714 [7] Technology, U. N. I. O. S. A., "The Advanced Encryption 1715 Standard (AES)", FIPS 197, November 2001. 1717 [8] Technology, U. N. I. O. S. A., "Secure Hash Standard 1718 (SHS)", FIPS 180-3, October 2008. 1720 [9] Josefsson, S., "The Base16, Base32, and Base64 Data 1721 Encodings", RFC 4648, October 2006. 1723 [10] Housley, R., "Cryptographic Message Syntax (CMS)", 1724 RFC 5652, September 2009. 1726 [11] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 1727 (HTTP/1.1): Message Syntax and Routing", RFC 7230, June 1728 2014. 1730 [12] Nystrom, M. and B. Kaliski, "PKCS #9: Selected Object 1731 Classes and Attribute Types Version 2.0", RFC 2985, 1732 November 2000. 1734 [13] Nystrom, M. and B. Kaliski, "PKCS #10: Certification 1735 Request Syntax Specification Version 1.7", RFC 2986, 1736 November 2000. 1738 [14] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1739 Housley, R., and W. Polk, "Internet X.509 Public Key 1740 Infrastructure Certificate and Certificate Revocation List 1741 (CRL) Profile", RFC 5280, May 2008. 1743 [15] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1744 Resource Identifiers (URI): Generic Syntax", RFC 3986, 1745 January 2005. 1747 9.2. Informative References 1749 [16] Nottingham, M., "Building Protocols with HTTP", November 1750 2018. 1752 [17] Gutmann, P., "Internet X.509 Public Key Infrastructure 1753 Operational Protocols: Certificate Store Access via HTTP", 1754 RFC 4387, February 2006. 1756 [18] "A Java implementation of the Simple Certificate Enrolment 1757 Protocol", . 1759 [19] Alighieri, D., "Internet Key Exchange (IKEv2) Protocol", 1760 RFC 7296, March 1300. 1762 [20] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 1763 Mail Extensions (S/MIME) Version 3.2 Message 1764 Specification", RFC 5751, January 2010. 1766 [21] Hoffman, P., "Enhanced Security Services for S/MIME", 1767 RFC 2634, June 1999. 1769 [22] Schaad, J., "Enhanced Security Services (ESS) Update: 1770 Adding CertID Algorithm Agility", RFC 5035, August 2007. 1772 [23] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1773 Version 1.3", RFC 8446, August 2018. 1775 Appendix A. Background Notes 1777 This specification has spent close to twenty years in the draft 1778 stage. Its original goal, provisioning IPsec routers with 1779 certificates, has long since changed to general device/embedded 1780 system/IoT use. To fit this role, extra features were bolted on in a 1781 haphazard manner through the addition of a growing list of appendices 1782 and by inserting additional, often conflicting, paragraphs in various 1783 locations in the body text. Since existing features were never 1784 updated as newer ones were added, the specification accumulated large 1785 amounts of historical baggage over time. If OpenPGP was described as 1786 "a museum of 1990s crypto" then the SCEP draft was its graveyard. 1788 About five years ago the specification, which even at that point had 1789 seen only sporadic re-posts of the existing document, was more or 1790 less abandoned by its original sponsors. Due to its widespread use 1791 in large segments of the industry, the specification was rebooted in 1792 2015, cleaning up fifteen years worth of accumulated cruft, fixing 1793 errors, clarifying ambiguities, and bringing the algorithms and 1794 standards used into the current century (prior to the update, the de- 1795 facto lowest-common denominator algorithms used for interoperability 1796 were the insecure forty-year-old single DES and broken MD5 hash 1797 algorithms). 1799 Note that although the text of the current specification has changed 1800 significantly due to the consolidation of features and appendices 1801 into the main document, the protocol it describes is identical on the 1802 wire to the original (with the unavoidable exception of the switch 1803 from single DES and MD5 to AES and SHA-2). The only two changes 1804 introduced, the "SCEPStandard" indicator in GetCACaps and the 1805 failInfoText attribute, are both optional values and would be ignored 1806 by older implementations that don't support them, or can be omitted 1807 from messages if they are found to cause problems. 1809 Other changes include: 1811 o Resolved contradictions in the text, for example a requirement 1812 given as a MUST in one paragraph and a SHOULD in the next, a MUST 1813 NOT in one paragraph and a MAY a few paragraphs later, a SHOULD 1814 NOT contradicted later by a MAY, and so on. 1816 o Merged several later fragmentary addenda placed in appendices (for 1817 example the handling of certificate renewal) with the body of the 1818 text. 1819 o Merged the SCEP Transactions and SCEP Transport sections, since 1820 the latter mostly duplicated (with occasional inconsistencies) the 1821 former. 1822 o Updated the algorithms to ones dating from at least this century. 1823 o Did the same for normative references to other standards. 1824 o Updated the text to use consistent terminology for the client and 1825 CA rather than a mixture of client, requester, requesting system, 1826 end entity, server, certificate authority, certification 1827 authority, and CA. 1828 o Corrected incorrect references to other standards, e.g. 1829 IssuerAndSerial -> IssuerAndSerialNumber. 1830 o Corrected errors such as a statement that when both signature and 1831 encryption certificates existed, the signature certificate was 1832 used for encryption. 1833 o Condensed redundant discussions of the same topic spread across 1834 multiple sections into a single location. For example the 1835 description of intermediate CA handling previously existed in 1836 three different locations, with slightly different reqirements in 1837 each one. 1838 o Added a description of how pkiMessages were processed, which was 1839 never made explicit in the original specification. This led to 1840 creative interpretations that had security problems but were 1841 employed anyway due to the lack of specific guidance on what to 1842 do. 1843 o Relaxed some requirements that didn't serve any obvious purpose 1844 and that major implementations didn't seem to be enforcing. For 1845 example the requirement that the self-signed certificate used with 1846 a request MUST contain a subject name that matched the one in the 1847 PKCS #10 request was relaxed to a SHOULD because a number of 1848 implementations either ignored the issue entirely or at worst 1849 performed some minor action like creating a log entry after which 1850 they continued anyway. 1851 o Removed discussion of the transactionID from the security 1852 considerations, since the instructions there were directly 1853 contradicted by the discussion of the use of the transactionID in 1854 Section 5. 1855 o Added a requirement that the signed message include the signing 1856 certificate(s) in the signedData certificates field. This was 1857 implicit in the original specification (without it, the message 1858 couldn't be verified by the CA) and was handled by the fact that 1859 most PKCS #7/CMS libraries do this by default, but was never 1860 explicitly mentioned. 1861 o Clarified sections that were unclear or even made no sense, for 1862 example the requirement for a "hash on the public key" [sic] 1863 encoded as a PrintableString. 1865 o Renamed "RA certificates" to "intermediate CA certificates". The 1866 original document at some point added mention of RA certificates 1867 without specifying how the client was to determine that an RA was 1868 in use, how the RA operations were identified in the protocol, or 1869 how it was used. It's unclear whether what was meant was a true 1870 RA or merely an intermediate CA, as opposed to the default 1871 practice of having certificates issued directly from a single root 1872 CA certificate. This update uses the term "intermediate CA 1873 certificates", since this seems to have been the original intent 1874 of the text. 1875 o Redid the PKIMessage diagram to match what was specified in CMS, 1876 the original diagram omitted a number of fields and nested data 1877 structures which meant that the diagram didn't match either the 1878 text or the CMS specification. 1879 o Removed the requirement for a CertPoll to contain a 1880 recipientNonce, since CertPoll is a client message and will never 1881 be sent in response to a message containing a senderNonce. See 1882 also the note in Section 3.3.2. 1883 o Clarified certificate renewal. This represents a capability that 1884 was bolted onto the original protocol with (at best) vaguely- 1885 defined semantics, including a requirement by the CA to guess 1886 whether a particular request was a renewal or not. In response to 1887 developer feedback that they either avoided renewal entirely 1888 because of this uncertainty or hardcoded in particular behaviour 1889 on a per-CA basis, this specification explicitly identifies 1890 renewal requests as such, and provides proper semantics for them. 1891 o Corrected the requirement that "undefined message types are 1892 treated as an error" since this negates the effect of GetCACaps, 1893 which is used to define new message types. In particular 1894 operations such as GetCACaps "Renewal" would be impossible if 1895 enforced as written, because the Renewal operation was an 1896 undefined message type at the time. 1897 o In line with the above, added IANA registries for several entries 1898 that had previously been defined in an ad-hoc manner in different 1899 locations in the text. 1900 o Added the "SCEPStandard" keyword to GetCACaps to indicate that the 1901 CA complies with the final version of the SCEP standard, since the 1902 definition of what constitutes SCEP standards compliance has 1903 changed significantly over the years. 1904 o Added the optional failInfoText attribute to deal with the fact 1905 that failInfo was incapable of adequately communicating to clients 1906 why a certificate request operation had been rejected. 1907 o Removed the discussion in the security considerations of 1908 revocation issues, since SCEP doesn't support revocation as part 1909 of the protocol. 1910 o Clarified the use of nonces, which if applied as originally 1911 specified would have made the use of polling in the presence of a 1912 lost message impossible. 1914 o Removed the discussion of generating a given transactionID by 1915 hashing the public key, since this implied that there was some 1916 special significance in the value generated this way. Since it 1917 was neither a MUST nor a MAY, it was unsound to imply that servers 1918 could rely on the value being generated a certain way. In 1919 addition it wouldn't work if multiple transactions as discussed in 1920 Section 4.4 were initiated, since the deterministic generation via 1921 hashing would lead to duplicate transactionIDs. 1922 o Added examples of SCEP messages to give implementers something to 1923 aim for. 1925 Author's Address 1927 Peter Gutmann 1928 University of Auckland 1929 Department of Computer Science 1930 Auckland 1931 New Zealand 1933 Email: pgut001@cs.auckland.ac.nz