Movatterモバイル変換


[0]ホーム

URL:


RFC 8894SCEPSeptember 2020
GutmannInformational[Page]
Stream:
Internet Engineering Task Force (IETF)
RFC:
8894
Category:
Informational
Published:
ISSN:
2070-1721
Author:
P. Gutmann
University of Auckland

RFC 8894

Simple Certificate Enrolment Protocol

Abstract

This document specifies the Simple Certificate Enrolment Protocol (SCEP), aPKI protocol that leverages existing technology by using Cryptographic MessageSyntax (CMS, formerly known as PKCS #7) and PKCS #10 over HTTP. SCEP is theevolution of the enrolmentprotocol sponsored by Cisco Systems, which enjoys wide support in both clientand server implementations, as well as being relied upon by numerous otherindustry standards that work with certificates.

Status of This Memo

This document is not an Internet Standards Track specification; it is published for informational purposes.

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are candidates for any level of Internet Standard; see Section 2 of RFC 7841.

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc8894.

Copyright Notice

Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

Table of Contents

1.Introduction

X.509 certificates serve as the basis for several standardised securityprotocols such asTLS [RFC8446],S/MIME [RFC8551], andIKE/IPsec [RFC7296]. When an X.509certificate is issued, there typically is a need for a certificate managementprotocol to enable a PKI client to request or renew a certificate from aCertificate Authority (CA). This specification defines a protocol, the SimpleCertificate Enrolment Protocol (SCEP), for certificate management andcertificate and CRL queries.

The SCEP protocol supports the following general operations:

SCEP makes extensive use ofCMS [RFC5652]andPKCS #10 [RFC2986].

1.1.Conventions Used in This Document

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14[RFC2119][RFC8174] when, and only when, they appear in all capitals, as shown here.

This document uses the Augmented Backus-Naur Form (ABNF) notation as specified in[RFC5234] for defining formal syntax of commands. Non-terminals not defined in[RFC5234] are defined inSection 4.1.

2.SCEP Overview

This section provides an overview of the functionality of SCEP.

2.1.SCEP Entities

The entity types defined in SCEP are a client requesting a certificate and aCertificate Authority (CA) that issues the certificate. These are describedin the following sections.

2.1.1.Client

A clientMUST have the following information locally configured:

  1. The CA's fully qualified domain name or IP address.
  2. Any identification and/or authorisation information required by the CA before a certificate will be issued, as described inSection 3.3.1.
  3. The identifying information that is used for authentication of the CA inSection 4.2.1, typically a certificate fingerprint.

2.1.2.Certificate Authority

A SCEP CA is the entity that signs client certificates. A CA may enforcepolicies and apply them to certificate requests, and it may reject a request forany reason.

Since the client is expected to perform signature verification and optionallyencryption using the CA certificate, the keyUsage extension in the CAcertificateMUST indicate that it is valid for digitalSignature andkeyEncipherment (if the key is to be used for en/decryption) alongside theusual CA usages of keyCertSign and/or cRLSign.

2.2.CA Certificate Distribution

If the CA certificate(s) have not previously been acquired by the clientthrough some other means, the clientMUST retrieve them before any PKIoperation (Section 3) can be started. Since no public keyhas yet been exchanged between the client and the CA, the messages cannot besecured using CMS, and the CA certificate request and response data is insteadtransferred in the clear.

If an intermediate CA is in use, a certificates-only CMS SignedData messagewith a certificate chain consisting of all CA certificates is returned.Otherwise, the CA certificate itself is returned.

The CA certificateMAY be provided out of band to the client. Alternatively,the CA certificate fingerprintMAY be used to authenticate a CA certificatedistributed by the GetCACert response (Section 4.2) or viaHTTP certificate-store access [RFC4387]. Thefingerprint is created by calculating a SHA-256 hash over the whole CAcertificate. (For legacy reasons, a SHA-1 hash may be used by someimplementations.)

After the client gets the CA certificate, itSHOULD authenticate it in somemanner unless this is deemed unnecessary, for example, because the device isbeing provisioned inside a trusted environment. For example, the client could comparethe certificate's fingerprint with locally configured, out-of-band distributed, identifyinginformation, or by some equivalent means such as a direct comparison with alocally stored copy of the certificate.

Intermediate CA certificates, if any, are signed by a higher-level CA, so thereis no need to authenticate them against the out-of-band data. Sinceintermediate CA certificates are rolled over more frequently than long-livedtop-level CA certificates, clientsMUST verify intermediate-level CAcertificates before use during protocol exchanges in case the intermediate CAcertificate has expired or otherwise been invalidated.

When a CA certificate expires, certificates that have been signed by it may nolonger be regarded as valid. CA key rollover provides a mechanism by whichthe CA can distribute a new CA certificate that will be valid in the future oncethe current certificate has expired. This is done via the GetNextCACertmessage (Section 4.7).

2.3.Client Authentication

As with every protocol that uses public-key cryptography, the associationbetween the public keys used in the protocol and the identities with whichthey are associated must be authenticated in a cryptographically securemanner. Communications between the client and the CA are secured using SCEPSecure Message Objects as explained inSection 3, whichspecifies how CMS is used to encrypt and sign the data. In order to performthe signing operation, the client uses an appropriate local certificate:

  1. If the client does not have an appropriate existing certificate, then a locally generated self-signed certificateMUST be used. The keyUsage extension in the certificateMUST indicate that it is valid for digitalSignature and keyEncipherment (if available). The self-signed certificateSHOULD use the same subject name and key as in the PKCS #10 request. In this case, the messageType is PKCSReq (seeSection 3.2.1.2).
  2. If the client already has a certificate issued by the SCEP CA, and the CA supports renewal (seeSection 2.5), that certificateSHOULD be used. In this case, the messageType is RenewalReq (seeSection 3.2.1.2).
  3. Alternatively, if the client has no certificate issued by the SCEP CA but has credentials from an alternate CA, then the certificate issued by the alternate CAMAY be used in a renewal request as described above. The SCEP CA's policy will determine whether the request can be accepted or not.

Note that although the above text describes several different types ofoperations, for historical reasons, most implementations always apply the firstone, even if an existing certificate already exists. For this reason, supportfor the first case is mandatory while support for the latter ones are optional(seeSection 2.9).

During the certificate-enrolment process, the clientMUST usethe selected certificate's key when signing the CMS envelope (seeSection 3). This certificate will be either theself-signed one matching the PKCS #10 request or the CA-issued one used toauthorise a renewal, and itMUST be included in the signedDatacertificates field (possibly as part of a full certificate chain). If the keybeing certified allows encryption, then the CA's CertResp will use the samecertificate's public key when encrypting the response.

Note that, in the case of renewal operations, this means that the request willbe signed and authenticated with the key in the previously issued certificaterather than the key in the PKCS #10 request, and the response may similarly bereturned encrypted with the key in the previously issued certificate. Thishas security implications; seeSection 7.6.

2.4.Enrolment Authorisation

PKCS #10 [RFC2986] specifies aPKCS#9 [RFC2985] challengePassword attribute to be sent as part of the enrolmentrequest. When utilising the challengePassword, the CA distributes a sharedsecret to the client, which will be used to authenticate the request from theclient. It isRECOMMENDED that the challengePassword be aone-timeauthenticator value to limit the ability of an attacker who can capture theauthenticator from the client or CA and reuse it to request furthercertificates.

Inclusion of the challengePassword by the SCEP client isRECOMMENDED; however,its omission allows for unauthenticated authorisation of enrolment requests(which may, however, require manual approval of each certificate issue ifother security measures to control issue aren't in place; see below).Inclusion isOPTIONAL for renewal requests that are authenticated by beingsigned with an existing certificate. The CMS envelope protects the privacy ofthe challengePassword.

A client that is performing certificate renewal as perSection 2.5SHOULD omit the challengePassword butMAY sendthe originally distributed shared secret in the challengePassword attribute.The SCEP CAMAY authenticate the request using thechallengePassword in addition to the previously issued certificate that signsthe request. The SCEP CAMUST NOT attempt to authenticate aclient based on a self-signed certificate unless it has been verified throughout-of-band means such as a certificate fingerprint.

To perform the authorisation in manual mode, the client's request is placed inthe PENDING state until the CA operator authorises or rejects it. Manualauthorisation is used when the client has only a self-signed certificate thathasn't been previously authenticated by the CA and/or a challengePassword isnot available. The SCEP CAMAY either reject unauthorised requests or markthem for manual authorisation according to CA policy.

2.5.Certificate Enrolment/Renewal

A client starts an enrolment transaction (Section 3.3.1) by creating acertificate request using PKCS #10 and sends the request to the CA envelopedusing CMS (Section 3).

If the CA supports certificate renewal and the CA policy permits, then a newcertificate with new validity dates can be issued, even though the old one isstill valid. To renew an existing certificate, the client uses the RenewalReqmessage (seeSection 3.3) and signs it with the existingclient certificate. The clientSHOULD use a new keypair when requesting a newcertificate butMAY request a new certificate using the old keypair.

If the CA returns a CertRep message (Section 3.3.2) with status setto PENDING, the client enters into polling mode by periodically sending aCertPoll message (Section 3.3.3) to the CA until the CA operatorcompletes the manual authentication (approving or denying the request). Thefrequency of the polling operation is a CA/client configuration issue and mayrange from seconds or minutes when the issue process is automatic but notinstantaneous, through to hours or days if the certificate-issue operationrequires manual approval.

If polling mode is being used, then the client will send a singlePKCSReq/RenewalReq message (Section 3.3.1), followed by 0 or moreCertPoll messages (Section 3.3.3). The CA will, in return, send 0or more CertRep messages (Section 3.3.2) with status set to PENDINGin response to CertPolls, followed by a single CertRep message (Section 3.3.2) with status set to either SUCCESS orFAILURE.

2.5.1.Client State Transitions

The client state transitions during the SCEP process are indicated inFigure 1.

                                CertPoll                              +-----<----+                              |          |                              |          | CertRep(PENDING)                              |          |[CERT-NONEXISTENT] ------> [CERT-REQ-PENDING] --------> [CERT-ISSUED]      ^            PKCSReq    |           CertRep(SUCCESS)      |          RenewalReq   |      |                       |      +-----------------------+      CertRep(FAILURE) or      Max-time/max-polls exceeded
Figure 1:State Transition Diagram

The certificate-issue process starts at state CERT-NONEXISTENT. Sending aPKCSReq/RenewalReq message changes the state to CERT-REQ-PENDING.

If the CA returns a CertRep message with pkiStatus set to SUCCESS, then thestate changes to CERT-ISSUED.

If the CA returns a CertRep message with pkiStatus set to FAILURE or there isno response, then the state reverts back to CERT-NONEXISTENT.

If the CA returns a CertRep message with pkiStatus set to PENDING, then theclient will keep polling by sending a CertPoll message until either a CertRepmessage with status set to SUCCESS or FAILURE is received, a timeout occurs,or the maximum number of polls has been exceeded.

Figure 2 shows a successful transaction in automatic mode

    CLIENT                              CA SERVERPKCSReq: PKI cert. enrolment message--------------------------------> CertRep: pkiStatus = SUCCESS                                  Certificate attached                                  <------------------------------Receive issued certificate.
Figure 2:Automatic Mode

Figure 3 shows a successful transaction in manual mode:

    CLIENT                              CA SERVERPKCSReq: PKI cert. enrolment message--------------------------------> CertRep: pkiStatus = PENDING                                  <------------------------------CertPoll: Polling message--------------------------------> CertRep: pkiStatus = PENDING                                  <------------------------------................ <Manual identity authentication> ...............CertPoll: Polling message--------------------------------> CertRep: pkiStatus = SUCCESS                                  Certificate attached                                  <------------------------------Receive issued certificate.
Figure 3:Manual Mode

2.6.Certificate Access

A certificate query message is defined for clients to retrieve a copy of theirown certificate from the CA. It allows clients that do not store theircertificates locally to obtain a copy when needed. This functionality is notintended to provide a general-purpose certificate-access service, which may beachieved instead viaHTTP certificate-storeaccess [RFC4387] or Lightweight Directory Access Protocol (LDAP).

To retrieve a certificate from the CA, a client sends a request consisting ofthe certificate's issuer name and serial number. This assumes that the clienthas saved the issuer name and the serial number of the issued certificate fromthe previous enrolment transaction. The transaction to retrieve a certificateconsists of one GetCert (Section 3.3.4) message and one CertRep(Section 3.3.2) message, as shown inFigure 4.

   CLIENT                               CA SERVERGetCert: PKI certificate query message-------------------------------> CertRep: pkiStatus = SUCCESS                                 Certificate attached                                 <-----------------------------Receive the certificate.
Figure 4:Retrieving a Certificate

2.7.CRL Access

SCEP clientsMAY request a CRL via one of three methods:

  1. If the CA supports theCRL Distribution Points (CRLDPs) extension [RFC5280] in issued certificates, then the CRLMAY be retrieved via the mechanism specified in the CRLDP.
  2. If the CA supportsHTTP certificate-store access [RFC4387], then the CRLMAY be retrieved via theAuthorityInfoAcces [RFC5280] location specified in the certificate.
  3. Only if the CA does not support CRLDPs or HTTP access should a CRL query be composed by creating a GetCRL message consisting of the issuer name and serial number from the certificate whose revocation status is being queried.

The message is sent to the SCEP CA in the same way as the other SCEP requests.The transaction to retrieve a CRL consists of one GetCRL PKI message and oneCertRep PKI message, which contains only the CRL (no certificates) in adegenerate certificates-only CMS SignedData message(Section 3.4), as shown inFigure 5.

       CLIENT                           CA SERVER   GetCRL: PKI CRL query message---------------------------------->                                  CertRep: CRL attached                                  <-----------------------------Receive the CRL
Figure 5:Retrieving a CRL

2.8.Certificate Revocation

SCEP does not specify a method to request certificate revocation. In order torevoke a certificate, the client must contact the CA using a non-SCEP-defined mechanism.

2.9.Mandatory-to-Implement Functionality

At a minimum, all SCEP implementations compliant with this specificationMUSTsupportGetCACaps (Section 3.5.1),GetCACert (Section 4.2),PKCSReq (Section 3.3.1) (and its associated response messages),communication of binary data viaHTTPPOST (Section 4.1), and theAES128-CBC [AES] andSHA-256 [SHA2] algorithms to securepkiMessages (Section 3.2).

For historical reasons, implementationsMAY support communications of binarydata viaHTTP GET (Section 4.1), and the triple DES-CBCand SHA-1 algorithms to securepkiMessages (Section 3.2).ImplementationsMUST NOT support the obsolete and/or insecure single DES andMD5 algorithms used in earlier versions of this specification, since theunsecured nature of GetCACaps means that an in-path attacker can triviallyroll back the encryption used to these insecure algorithms; seeSection 7.5.

3.SCEP Secure Message Objects

CMS is a general enveloping mechanism that enables both signed and encryptedtransmission of arbitrary data. SCEP messages that require confidentialityuse two layers of CMS, as shown using ASN.1-like pseudocode inFigure 6. By applying both enveloping and signingtransformations, the SCEP message is protected both for the integrity of itsend-to-end transaction information and the confidentiality of its informationportion.

pkiMessage {  contentType = signedData { pkcs-7 2 },  content {    digestAlgorithms,    encapsulatedContentInfo {      eContentType = data { pkcs-7 1 },      eContent {           -- pkcsPKIEnvelope, optional        contentType = envelopedData { pkcs-7 3 },        content {          recipientInfo,          encryptedContentInfo {            contentType = data { pkcs-7 1 },            contentEncrAlgorithm,            encryptedContent {              messageData  -- Typically PKCS #10 request              }            }          }        }      },    certificates,          -- Optional    crls,                  -- Optional    signerInfo {      signedAttrs {        transactionID,        messageType,        pkiStatus,        failInfo,          -- Optional        senderNonce / recipientNonce,        },      signature      }    }  }
Figure 6:CMS Layering

When a particular SCEP message carries data, this data is carried in themessageData. CertRep messages will lack any signed content and consist onlyof a pkcsPKIEnvelope (Section 3.2.2).

The remainder of this document will refer only to "messageData", but it isunderstood to always be encapsulated in the pkcsPKIEnvelope (Section 3.2.2). The format of the data in the messageData isdefined by the messageType attribute (seeSection 3.2) of theSignedData. If there is no messageData to be transmitted, the entirepkcsPKIEnvelopeMUST be omitted.

Samples of SCEP messages are available through theJSCEP project [JSCEP] in the src/samples directory.

3.1.SCEP Message Object Processing

Creating a SCEP message consists of several stages. The content to beconveyed (in other words, the messageData) is first encrypted, and theencrypted content is then signed.

The form of encryption to be applied depends on the capabilities of therecipient's public key. If the key is encryption capable (for example, RSA),then the messageData is encrypted using the recipient's public key with theCMS KeyTransRecipientInfo mechanism. If the key is not encryption capable(for example, DSA or ECDSA), thenthe messageData is encrypted using thechallengePassword with the CMS PasswordRecipientInfo mechanism.

Once the messageData has been encrypted, it is signed with the sender's publickey. This completes the SCEP message, which is then sent to the recipient.

Note that some early implementations of this specification dealt with keysthat were not encryption capable by omitting the encryption stage, based on thetext inSection 3 that indicated that "the EnvelopedData isomitted". This alternative processing mechanismSHOULD NOT be used since itexposes in cleartext the challengePassword used to authorise the certificateissue.

3.2.SCEP pkiMessage

The basic building block of all secured SCEP messages is the SCEP pkiMessage.It consists of a CMS SignedData content type. The following restrictionsapply:

  • The eContentType in encapsulatedContentInfoMUST be data ({pkcs-7 1}).
  • The signed content, if present (FAILURE and PENDING CertRep messages will lack any signed content),MUST be a pkcsPKIEnvelope (Section 3.2.2) andMUST match the messageType attribute.
  • The SignerInfoMUST contain a set of authenticatedAttributes (Section 3.2.1).

3.2.1.Signed Transaction Attributes

At a minimum, all messagesMUST contain the following authenticatedAttributes:

If the message is a CertRep, itMUST also include the followingauthenticatedAttributes:

  • A pkiStatus attribute (seeSection 3.2.1.3).
  • failInfo and optional failInfoText attributes (seeSection 3.2.1.4) if pkiStatus = FAILURE.
  • A recipientNonce attribute (seeSection 3.2.1.5) copied from the senderNonce in the request that this is a response to.

The following transaction attributes are encoded as authenticated attributesand carried in the SignerInfo for this SignedData.

Table 1:SCEP Attributes
AttributeEncodingComment
transactionIDPrintableStringUnique ID for this transaction as a text string
messageTypePrintableStringDecimal value as a numeric text string
pkiStatusPrintableStringDecimal value as a numeric text string
failInfoPrintableStringDecimal value as a numeric text string
failInfoTextUTF8StringDescriptive text for the failInfo value
senderNonceOCTET STRINGRandom nonce as a 16-byte binary data string
recipientNonceOCTET STRINGRandom nonce as a 16-byte binary data string

The OIDs used for these attributes are as follows:

Table 2:SCEP Attribute OIDs
NameASN.1 Definition
id-VeriSignOBJECT_IDENTIFIER ::= {2 16 US(840) 1 VeriSign(113733)}
id-pkiOBJECT_IDENTIFIER ::= {id-VeriSign pki(1)}
id-attributesOBJECT_IDENTIFIER ::= {id-pki attributes(9)}
id-transactionIDOBJECT_IDENTIFIER ::= {id-attributes transactionID(7)}
id-messageTypeOBJECT_IDENTIFIER ::= {id-attributes messageType(2)}
id-pkiStatusOBJECT_IDENTIFIER ::= {id-attributes pkiStatus(3)}
id-failInfoOBJECT_IDENTIFIER ::= {id-attributes failInfo(4)}
id-senderNonceOBJECT_IDENTIFIER ::= {id-attributes senderNonce(5)}
id-recipientNonceOBJECT_IDENTIFIER ::= {id-attributes recipientNonce(6)}
id-scepOBJECT IDENTIFIER ::= {id-pkix 24}
id-scep-failInfoTextOBJECT IDENTIFIER ::= {id-scep 1}

The attributes are detailed in the following sections.

3.2.1.1.transactionID

A PKI operation is a transaction consisting of the messages exchanged betweena client and the CA. The transactionID is a text string provided by theclient when starting a transaction. The clientMUST use a unique string asthe transaction identifier, encoded as a PrintableString, whichMUST be usedfor all PKI messages exchanged for a given operation, such as a certificateissue.

Note that the transactionID must be unique, but not necessarily randomlygenerated. For example, it may be a value assigned by the CA to allow theclient to be identified by their transactionID, using a value such as theclient device's Extended Unique Identifier (EUI), Remote Terminal Unit (RTU) ID, or a similar uniqueidentifier. This can beuseful when the client doesn't have a preassigned Distinguished Name throughwhich the CA can identify their request -- for example, when enrollingSupervisory Control and Data Acquisition (SCADA) devices.

3.2.1.2.messageType

The messageType attribute specifies the type of operation performed by thetransaction. This attributeMUST be included in all PKI messages. Thefollowing message types are defined:

Table 3:SCEP Message Types
ValueNameDescription
0Reserved
3CertRepResponse to certificate or CRL request.
17RenewalReqPKCS #10 certificate request authenticated with an existing certificate.
19PKCSReqPKCS #10 certificate request authenticated with a shared secret.
20CertPollCertificate polling in manual enrolment.
21GetCertRetrieve a certificate.
22GetCRLRetrieve a CRL.

Message types not defined aboveMUST be treated as errors unless their usehas been negotiated throughGetCACaps (Section 3.5.1).

3.2.1.3.pkiStatus

All response messagesMUST include transaction status information, which isdefined as a pkiStatus attribute:

Table 4:pkiStatus Attributes
ValueNameDescription
0SUCCESSRequest granted.
2FAILURERequest rejected. In this case, the failInfo attribute, as defined inSection 3.2.1.4,MUST also be present.
3PENDINGRequest pending for manual approval.

PKI status values not defined aboveMUST be treated as errors unless theiruse has been negotiated throughGetCACaps (Section 3.5.1).

3.2.1.4.failInfo and failInfoText

The failInfo attributeMUST contain one of the following failure reasons:

Table 5:failInfo Attributes
ValueNameDescription
0badAlgUnrecognised or unsupported algorithm.
1badMessageCheckIntegrity check (meaning signature verification of the CMS message) failed.
2badRequestTransaction not permitted or supported.
3badTimeThe signingTime attribute from the CMS authenticatedAttributes was not sufficiently close to the system time. This condition may occur if the CA is concerned about replays of old messages.
4badCertIdNo certificate could be identified matching the provided criteria.

Failure reasons not defined aboveMUST be treated as errors unless their usehas been negotiated throughGetCACaps (Section 3.5.1).

The failInfoText is a free-form UTF-8 text string that provides furtherinformation in the case of pkiStatus = FAILURE. In particular, it may be usedto provide details on why a certificate request was not granted that go beyondwhat's provided by the near-universal failInfo = badRequest status. Sincethis is a free-form text string intended for interpretation by humans,implementationsSHOULD NOT assume that it has any type of machine-processablecontent.

3.2.1.5.senderNonce and recipientNonce

The senderNonce and recipientNonce attributes are each a 16-byte random numbergenerated for each transaction. These are intended to prevent replay attacks.

When a sender sends a PKI message to a recipient, a fresh senderNonceMUST beincluded in the message. The recipientMUST copy the senderNonce into therecipientNonce of the reply as a proof of liveliness. The original senderMUST verify that the recipientNonce of the reply matches the senderNonce itsent in the request. If the nonce does not match, then the messageMUST berejected.

Note that since SCEP exchanges consist of a single request followed by asingle response, the use of distinct sender and recipient nonces is redundant,since the client sends a nonce in its request and the CA responds with thesame nonce in its reply. In effect, there's just a single nonce, identified assenderNonce in the client's request and recipientNonce in the CA's reply.

3.2.2.SCEP pkcsPKIEnvelope

The information portion of a SCEP message is carried inside an EnvelopedDatacontent type, as defined in CMS, with the following restrictions:

  • contentType in encryptedContentInfoMUST be data ({pkcs-7 1}).
  • encryptedContentMUST be the SCEP message being transported (seeSection 4) andMUST match the messageType authenticated Attribute in the pkiMessage.

3.3.SCEP pkiMessage types

All of the messages in this section are pkiMessages (Section 3.2), where the type of the messageMUST be specified in the"messageType" authenticated Attribute. Each section defines a valid messagetype, the corresponding messageData formats, and mandatory authenticatedattributes for that type.

3.3.1.PKCSReq/RenewalReq

The messageData for this type consists of a PKCS #10 Certificate Request. Thecertificate requestMUST contain at least the following items:

  • The subject Distinguished Name.
  • The subject public key.
  • For a PKCSReq, if authorisation based on a shared secret is being used, a challengePassword attribute.

In addition, the message must contain the authenticatedAttributes specified inSection 3.2.1.

3.3.2.CertRep

The messageData for this type consists of a degenerate certificates-only CMSSignedData message (Section 3.4). The exact content requiredfor the reply depends on the type of request that this message is a responseto. The request types are detailed in Sections3.3.2.1 and4. Inaddition, the message must contain theauthenticatedAttributes specified inSection 3.2.1.

Earlier draft versions of this specification required that this message include asenderNonce alongside the recipientNonce, which was to be used to chain tosubsequent polling operations. However, if a single message was lost duringthe potentially extended interval over which polling could take place (seeSection 5 for an example of this), then if theimplementation were to enforce this requirement, the overall transaction wouldfail, even though nothing had actually gone wrong. Because of this issue,implementations mostly ignored the requirement to either carry this nonce over tosubsequent polling messages or verify its presence. More recent versionsof the specification no longer require the chaining of nonces across pollingoperations.

3.3.2.1.CertRep SUCCESS

When the pkiStatus attribute is set to SUCCESS, the messageData for thismessage consists of a degenerate certificates-only CMS SignedData message(Section 3.4). The content of this degeneratecertificates-only SignedData message depends on what the original request was, asoutlined inTable 6.

Table 6:CertRep Response Types
Request-typeReply-contents
PKCSReqThe replyMUST contain at least the issued certificate in the certificates field of the SignedData. The replyMAY contain additional certificates, but the issued certificateMUST be the leaf certificate.
RenewalReqSame as PKCSReq
CertPollSame as PKCSReq
GetCertThe replyMUST contain at least the requested certificate in the certificates field of the SignedData. The replyMAY contain additional certificates, but the requested certificateMUST be the leaf certificate.
GetCRLThe replyMUST contain the CRL in the crls field of the SignedData.
3.3.2.2.CertRep FAILURE

When the pkiStatus attribute is set to FAILURE, the replyMUST also contain afailInfo (Section 3.2.1.4) attribute set to the appropriate errorcondition describing the failure. The replyMAY also contain a failInfoTextattribute providing extended details on why the operation failed, typically toexpand on the catchall failInfo = badRequest status. The pkcsPKIEnvelope(Section 3.2.2)MUST be omitted.

3.3.2.3.CertRep PENDING

When the pkiStatus attribute is set to PENDING, the pkcsPKIEnvelope (Section 3.2.2)MUST be omitted.

3.3.3.CertPoll (GetCertInitial)

This message is used for certificate polling. For unknown reasons, it wasreferred to as "GetCertInitial" in earlier draft versions of this specification.The messageData for this type consists of an IssuerAndSubject:

issuerAndSubject ::= SEQUENCE {    issuer     Name,    subject    Name    }

The issuer is set to the subjectName of the CA (in other words, the intendedissuerName of the certificate that's being requested). The subject is set tothe subjectName used when requesting the certificate.

Note that both of these fields are redundant; the CA is identified by therecipientInfo in the pkcsPKIEnvelope (or in most cases, simply by the serverthat the message is being sent to), and the client/transaction being polled isidentified by the transactionID. Both of these fields can be processed by theCA without going through the cryptographically expensive process of unwrappingand processing the issuerAndSubject. For this reason, implementationsSHOULDassume that the polling operation will be controlled by the recipientInfo andtransactionID rather than the contents of the messageData. In addition, themessage must contain the authenticatedAttributes specified inSection 3.2.1.

3.3.4.GetCert and GetCRL

The messageData for these types consist of an IssuerAndSerialNumber, as definedin CMS, that uniquely identifies the certificate being requested, either thecertificate itself for GetCert or its revocation status via a CRL for GetCRL.In addition, the message must contain the authenticatedAttributes specifiedinSection 3.2.1.

These message types, while included here for completeness, apply unnecessarycryptography and messaging overhead to the simple task of transferring acertificate or CRL (seeSection 7.8).ImplementationsSHOULD preferHTTP certificate-store access [RFC4387] or LDAPover the use of these messages.

3.4.Degenerate certificates-only CMS SignedData

CMS includes a degenerate case of the SignedData content type in which thereare no signers. The use of such a degenerate case is to disseminatecertificates and CRLs. For SCEP, the content field of the ContentInfo value ofa degenerate certificates-only SignedDataMUST be omitted. When carryingcertificates, the certificates are included in the certificates field of theSignedData. When carrying a CRL, the CRL is included in the crls field ofthe SignedData.

3.5.CA Capabilities

In order to provide support for future enhancements to the protocol, CAsMUSTimplement the GetCACaps message to allow clients to query which functionalityis available from the CA.

3.5.1.GetCACaps HTTP Message Format

This message requests capabilities from a CA, with the format as described inSection 4.1:

"GET" SP SCEPPATH "?operation=GetCACaps" SP HTTP-version CRLF

3.5.2.CA Capabilities Response Format

The response for a GetCACaps message is a list of CA capabilities, in plain text and in any order, separated by <CR><LF> or <LF> characters. This specification defines the following keywords (quotation marks are not sent):

Table 7:GetCACaps Response Keywords
KeywordDescription
AESCA supports the AES128-CBC encryption algorithm.
DES3CA supports the triple DES-CBC encryption algorithm.
GetNextCACertCA supports the GetNextCACert message.
POSTPKIOperationCA supports PKIOPeration messages sent via HTTP POST.
RenewalCA supports the Renewal CA operation.
SHA-1CA supports the SHA-1 hashing algorithm.
SHA-256CA supports the SHA-256 hashing algorithm.
SHA-512CA supports the SHA-512 hashing algorithm.
SCEPStandardCA supports all mandatory-to-implement sections of the SCEP standard. This keyword implies "AES", "POSTPKIOperation", and "SHA-256", as well as the provisions ofSection 2.9.

Table 7 lists all of the keywords that are defined in thisspecification. A CAMAY provide additional keywords advertising furthercapabilities and functionality. A clientMUST be able to accept and ignoreany unknown keywords that might be sent by a CA.

The CAMUST use the text case specified here, but clientsSHOULD ignore the text case when processing this message. ClientsMUST accept the standardHTTP-style text delimited by <CR><LF> as well as thetext delimited by <LF> specified in an earlier draft version of thisspecification.

The clientSHOULD use SHA-256 in preference to SHA-1 hashing and AES128-CBC inpreference to triple DES-CBC if they are supported by the CA. Although theCMS format allows any form of AES and SHA-2 to be specified, in the interestsof interoperability the de facto universal standards of AES128-CBC and SHA-256SHOULD be used.

Announcing some of these capabilities individually is redundant, since they'rerequired as mandatory-to-implement functionality (seeSection 2.9)whose presence as a whole is signalled by the "SCEPStandard" capability. However,it may be useful to announce them in order to deal with older implementationsthat would otherwise default to obsolete, insecure algorithms and mechanisms.

If the CA supports none of the above capabilities, itSHOULD return an emptymessage. A CAMAY simply return an HTTP error. A client that receives anempty message or an HTTP errorSHOULD interpret the response as if none of thecapabilities listed are supported by the CA.

Note that at least one widely deployed server implementation supports severalof the above operations but doesn't support the GetCACaps message to indicatethat it supports them, and it will close the connection if sent a GetCACapsmessage. This means that the equivalent of GetCACaps must be performedthrough server fingerprinting, which can be done using the ID string"Microsoft-IIS". Newer versions of the same server, if sent a SCEP requestusing AES and SHA-2, will respond with an invalid response that can't bedecrypted, requiring the use of 3DES and SHA-1 in order to obtain a responsethat can be processed, even if AES and/or SHA-2 are allegedly supported. Inaddition, the server will generate CA certificates that only have one, but notboth, of the keyEncipherment and digitalSignature keyUsage flags set,requiring that the client ignore the keyUsage flags in order to use thecertificates for SCEP.

The Content-type of the replySHOULD be "text/plain". ClientsSHOULD ignorethe Content-type, as older implementations of SCEP may send variousContent-types.

Example:

GET /cgi-bin/pkiclient.exe?operation=GetCACaps HTTP/1.1

might return:

AESGetNextCACertPOSTPKIOperationSCEPStandardSHA-256

This means that the CA supports modern crypto algorithms, and the GetNextCACertmessage allows PKIOperation messages (PKCSReq/RenewalReq, GetCert, CertPoll,...) to be sent using HTTP POST and is compliant with the final version ofthe SCEP standard.

4.SCEP Transactions

This section describes the SCEP Transactions and theirHTTP [RFC7230] transport mechanism.

Note that SCEP doesn't follow best current practices on usage of HTTP. Inparticular, it recommends ignoring some media types and hard-codes specific URIpaths. Guidance on the appropriate application of HTTP in these circumstancesmay be found in[HTTP].

4.1.HTTP POST and GET Message Formats

SCEP uses the HTTP POST and GET methods[RFC7230] toexchange information with the CA. The following defines the ABNF syntax ofHTTP POST and GET methods sent from a client to a CA:

POSTREQUEST = "POST" SP SCEPPATH "?operation=" OPERATION              SP HTTP-version CRLFGETREQUEST = "GET" SP SCEPPATH "?operation=" OPERATION             "&message=" MESSAGE SP HTTP-version CRLF

where:

  • SCEPPATH is the HTTP URL path for accessing the CA. ClientsSHOULD set SCEPPATH to the fixed string "/cgi-bin/pkiclient.exe" unless directed to do otherwise by the CA.
  • OPERATION depends on the SCEP transaction and is defined in the following sections.
  • HTTP-version is the HTTP version string, which is "HTTP/1.1" for[RFC7230].
  • SP and CRLF are space and carriage return/linefeed, as defined in[RFC5234].

The CA will typically ignore SCEPPATH, since it's unlikely to be issuingcertificates via a web server. ClientsSHOULD set SCEPPATH to the fixedstring "/cgi-bin/pkiclient.exe" unless directed to do otherwise by the CA.The CASHOULD ignore the SCEPPATH unless its precise format is critical to theCA's operation.

Early SCEP drafts performed all communications via GET messages, includingnon-idempotent ones that should have been sent via POST messages; see[HTTP] for details. This has caused problems because ofthe way that the (supposedly) idempotent GET interacts with caches andproxies, and because the extremely large GET requests created by encoding CMSmessages may be truncated in transit. These issues are typically not visiblewhen testing on a LAN, but crop up during deployment over WANs. If the remoteCA supports POST, the CMS-encoded SCEP messagesMUST be sent via HTTP POSTinstead of HTTP GET. This applies to any SCEP message except GetCACert,GetNextCACert, and GetCACaps and avoids the need for base64 and URL encodingthat's required for GET messaging. The client can verify that the CA supportsSCEP messages via POST by looking for the "SCEPStandard" or "POSTPKIOperation"capability (seeSection 3.5.2).

If a client or CA uses HTTP GET and encounters HTTP-related problems such asmessages being truncated, seeing errors such as HTTP 414 ("Request-URI toolong"), or simply having the message not sent/received at all when standardrequests to the server (for example, via a web browser) work, then this is asymptom of the problematic use of HTTP GET. The solution to this problem isto update the implementation to use HTTP POST instead. In addition, when usingGET, it's recommended to test the implementation from as many different networklocations as possible to determine whether the use of GET will cause problemswith communications.

When using GET messages to communicate binary data, base64 encoding asspecified inSection 4 of [RFC4648]MUST be used. The base64-encoded data is distinct from"base64url" and may contain URI reservedcharacters; thus, itMUST be escaped as specified in[RFC3986] in addition to being base64 encoded.Finally, the encoded data is inserted intothe MESSAGE portion of the HTTP GET request.

4.2.Get CA Certificate

To get the CA certificate(s), the client sends a GetCACert message to the CA.The OPERATIONMUST be set to "GetCACert". There is no request data associatedwith this message.

4.2.1.Get CA Certificate Response Message Format

The response for GetCACert is different between the case where the CA directlycommunicates with the client during the enrolment and the case where anintermediate CA exists and the client communicates with this CA during theenrolment.

4.2.1.1.CA Certificate Response Message Format

If the CA does not have any intermediate CA certificates, the responseconsists of a single X.509 CA certificate. The response will have aContent-Type of "application/x-x509-ca-cert".

"Content-Type: application/x-x509-ca-cert"<binary X.509>
4.2.1.2.CA Certificate Chain Response Message Format

If the CA has intermediate CA certificates, the response consists of adegenerate certificates-only CMS SignedData message (Section 3.4) containing the certificates, with the intermediate CAcertificate(s) as the leaf certificate(s). The response will have aContent-Type of "application/x-x509-ca-ra-cert". Note that this designationis used for historical reasons due to its use in older versions of thisspecification -- no special meaning should be attached to the label.

"Content-Type: application/x-x509-ca-ra-cert"<binary CMS>

4.3.Certificate Enrolment/Renewal

A PKCSReq/RenewalReq (Section 3.3.1) message is used to perform acertificate enrolment or renewal transaction. The OPERATIONMUST be set to"PKIOperation". Note that when used with HTTP POST, the only OPERATIONpossible is "PKIOperation", so many CAs don't check this value or even noticeits absence. When implemented using HTTP POST, the message is sent with aContent-Type of "application/x-pki-message" and might look as follows:

POST /cgi-bin/pkiclient.exe?operation=PKIOperation HTTP/1.1Content-Length: <length of data>Content-Type: application/x-pki-message<binary CMS data>

When implemented using HTTP GET, this might look as follows:

GET /cgi-bin/pkiclient.exe?operation=PKIOperation& \message=MIAGCSqGSIb3DQEHA6CAMIACAQAxgDCBzAIBADB2MG \IxETAPBgNVBAcTCE......AAAAAA== HTTP/1.1

4.3.1.Certificate Enrolment/Renewal Response Message

If the request is granted, a CertRep SUCCESS message(Section 3.3.2.1) is returned. If the request is rejected, aCertRep FAILURE message (Section 3.3.2.2) is returned. Ifthe CA is configured to manually authenticate the client, a CertRep PENDINGmessage (Section 3.3.2.3)MAY be returned. The CAMAY returna PENDING for other reasons.

The response will have a Content-Type of "application/x-pki-message".

"Content-Type: application/x-pki-message"<binary CertRep message>

4.4.Poll for Client Initial Certificate

When the client receives a CertRep message with pkiStatus set to PENDING, itwill enter the polling state by periodically sending CertPoll messages to theCA until either the request is granted and the certificate is sent back or therequest is rejected or some preconfigured time limit for polling or maximumnumber of polls is exceeded. The OPERATIONMUST be set to "PKIOperation".

CertPoll messages exchanged during the polling periodMUST carry the sametransactionID attribute as the previous PKCSReq/RenewalReq. A CA receiving aCertPoll for which it does not have a matching PKCSReq/RenewalReqMUST rejectthis request.

Since at this time the certificate has not been issued, the client can onlyuse its own subject name (which was contained in the original PKCS# 10 sentvia PKCSReq/RenewalReq) to identify the polled certificate request (but seethe note on identification during polling inSection 3.3.3). Intheory, there can be multiple outstanding requests from one client (forexample, if different keys and different key usages were used to requestmultiple certificates), so the transactionID must also be included todisambiguate between multiple requests. In practice, however, the clientSHOULD NOT have multiple requests outstanding at any one time, since this tends toconfuse some CAs.

4.4.1.Polling Response Message Format

The response messages for CertPoll are the same as inSection 4.3.1.

4.5.Certificate Access

A client can query an issued certificate from the SCEP CA, as long as theclient knows the issuer name and the issuer-assigned certificate serialnumber.

This transaction consists of one GetCert (Section 3.3.4) messagesent to the CA by a client and one CertRep (Section 3.3.2) messagesent back from the CA. The OPERATIONMUST be set to "PKIOperation".

4.5.1.Certificate Access Response Message Format

In this case, the CertRep from the CA is same as inSection 4.3.1, except that the CA will either grant therequest (SUCCESS) or reject it (FAILURE).

4.6.CRL Access

Clients can request a CRL from the SCEP CA, as described inSection 2.7. The OPERATIONMUST be set to "PKIOperation".

4.6.1.CRL Access Response Message Format

The CRL is sent back to the client in a CertRep (Section 3.3.2)message. The information portion of this message is a degeneratecertificates-only SignedData (Section 3.4) that contains onlythe most recent CRL in the crls field of the SignedData.

4.7.Get Next Certificate Authority Certificate

When a CA certificate is about to expire, clients need to retrieve the CA'snext CA certificate (i.e., the rollover certificate). This is done via theGetNextCACert message. The OPERATIONMUST be set to "GetNextCACert". Thereis no request data associated with this message.

4.7.1.Get Next CA Response Message Format

The response consists of a SignedData CMS message, signed by the current CAsigning key. ClientsMUST validate the signature on the message beforetrusting any of its contents. The response will have a Content-Type of"application/x-x509-next-ca-cert".

"Content-Type: application/x-x509-next-ca-cert"<binary CMS>

The content of the SignedData message is a degenerate certificates-onlySignedData message (Section 3.4) containing the new CAcertificate(s) to be used when the current CA certificate expires.

5.SCEP Transaction Examples

The following section gives several examples of client-to-CA transactions.Client actions are indicated in the left column, CA actions are indicated inthe right column, and the transactionID is given in parentheses. For ease ofreading, small integer values have been used; in practice, full transaction IDswould be used. The first transaction, for example, would read like this:

Client Sends PKCSReq message with transactionID 1 to the CA. The CA signsthe certificate and constructs a CertRep Message containing the signedcertificate with a transaction ID 1. The client receives the message andinstalls the certificate locally.

5.1.Successful Transactions

PKCSReq (1)             ----------> CA issues certificate                        <---------- CertRep (1) SUCCESSClient installs certificate
Figure 7:Successful Enrolment Case: Automatic Processing
PKCSReq (2)             ----------> Cert request goes into queue                        <---------- CertRep (2) PENDINGCertPoll (2)            ----------> Still pending                        <---------- CertRep (2) PENDINGCertPoll (2)            ----------> CA issues certificate                        <---------- CertRep (2) SUCCESSClient installs certificate
Figure 8:Successful Enrolment Case: Manual Authentication Required
GetNextCACert         ---------->                      <---------- New CA certificatePKCSReq*              ----------> CA issues certificate with                                  new key                      <---------- CertRep SUCCESSClient stores certificatefor installation whenexisting certificate expires.
Figure 9:CA Certificate Rollover Case

* Enveloped for the new CA certificate. The CA will use the envelope to determine which key to use to issue the client certificate.

5.2.Transactions with Errors

In the case of polled transactions that aren't completed automatically, thereare two potential options for dealing with a transaction that's interrupteddue to network or software/hardware issues. The first is for the client topreserve its transaction state and resume the CertPoll polling when normalservice is restored. The second is for the client to begin a new transactionby sending a new PKCSReq/RenewalReq, rather than continuing the previousCertPoll. Both options have their own advantages and disadvantages.

The CertPoll continuation requires that the client maintain its transactionstate for the time when it resumes polling. This is relatively simple if theproblem is a brief network outage, but less simple when the problem is aclient crash and restart. In addition, the CA may treat a lost networkconnection as the end of a transaction, so that a new connection followed by aCertPoll will be treated as an error.

The PKCSReq/RenewalReq continuation doesn't require any state to be maintained,since it's a new transaction. However, it may cause problems on the CA side ifthe certificate was successfully issued but the client never received it,since the resumed transaction attempt will appear to be a request for aduplicate certificate (seeSection 7.4 for more on whythis is a problem). In this case, the CA may refuse the transaction orrequire manual intervention to remove/revoke the previous certificate beforethe client can request another one.

Since the new-transaction resume is more robust in the presence of errors anddoesn't require special-case handling by either the client or CA, clientsSHOULD use the new-transaction option in preference to the resumed-CertPolloption to recover from errors.

Resync Case 1: Client resyncs via new PKCSReq (recommended):

PKCSReq (3)           ----------> Cert request goes into queue                      <---------- CertRep (3) PENDINGCertPoll (3)          ----------> Still pending                        X-------- CertRep(3) PENDING(Network outage)(Client reconnects)PKCSReq (4)           ---------->                      <---------- CertRep (4) PENDINGetc...
Figure 10:Resync Case 1

Resync Case 2: Client resyncs via resumed CertPoll after a network outage (not recommended; use PKCSReq to resync):

PKCSReq (5)           ----------> Cert request goes into queue                      <---------- CertRep (5) PENDINGCertPoll (5)          ----------> Still pending                        X-------- CertRep(5) PENDING(Network outage)(Client reconnects)CertPoll (5)          ----------> CA issues certificate                      <---------- CertRep (5) SUCCESSClient installs certificate
Figure 11:Resync Case 2

Resync Case 3: Special-case variation of Case 2 where the CertRep SUCCESS rather than the CertRep PENDING is lost (recommended):

PKCSReq (6)           ----------> Cert request goes into queue                      <---------- CertRep (6) PENDINGCertPoll (6)          ----------> Still pending                      <---------- CertRep (6) PENDINGCertPoll (6)          ----------> CA issues certificate                        X-------- CertRep(6) SUCCESS(Network outage)(Client reconnects)PKCSReq (7)           ----------> There is already a valid                                  certificate with this                                  Distinguished Name (DN).                      <---------- CertRep (7) FAILURE                                  Admin revokes certificatePKCSReq (8)           ----------> CA issues new certificate                      <---------- CertRep (8) SUCCESSClient installs certificate
Figure 12:Resync Case 3

Resync Case 4: Special-case variation of Case 1 where the CertRep SUCCESS rather than the CertRep PENDING is lost (not recommended; use PKCSReq to resync):

PKCSReq (9)           ----------> Cert request goes into queue                      <---------- CertRep (9) PENDINGCertPoll (9)          ----------> Still pending                      <---------- CertRep (9) PENDINGCertPoll (9)          ----------> CA issues certificate                        X-------- CertRep(9) SIGNED CERT(Network outage)(Client reconnects)CertPoll (9)          ----------> Certificate already issued                      <---------- CertRep (9) SUCCESSClient installs certificate
Figure 13:Resync Case 4

As these examples indicate, resumption from an error via a resumed CertPoll istricky due to the state that needs to be held by both the client and/or theCA. A PKCSReq/RenewalReq resume is the easiest to implement, since it'sstateless and is identical for both polled and nonpolled transactions, whereasa CertPoll resume treats the two differently. (A nonpolled transaction isresumed with a PKCSReq/RenewalReq; a polled transaction is resumed with aCertPoll.) For this reason, error recoverySHOULD be handled via a new PKCSReqrather than a resumed CertPoll.

6.IANA Considerations

An object identifier for an arc to assign SCEP Attribute Identifiers has beenassigned in the "SMI Security for PKIX" registry (1.3.6.1.5.5.7). This objectidentifer, Simple Certificate Enrollment Protocol Attributes, is denoted asid-scep:

id-scep OBJECT IDENTIFIER ::= { id-pkix 24 }

IANA created the "SMI Security for SCEP Attribute Identifiers" registry(1.3.6.1.5.5.7.24) with the following entries with references tothis document:

id-scep-failInfoText OBJECT IDENTIFIER ::= { id-scep 1 }

Entries in the registry are assigned according to the "Specification Required"policy defined in[RFC8126].

Section 3.2.1.2 describes an "SCEP Message Type" registry, andSection 3.5 describes an "SCEP CA Capabilities"registry; these registries are maintained by IANA and define a number of suchcode-point identifiers. Entries in the registry are assigned accordingto the "Specification Required" policy defined in[RFC8126].

The "SCEP Message Types" registry has "Value", "Name", "Description", and"Reference" columns. The "Value" entry is a small positive integer; value"0" is reserved.

The "SCEP CA Capabilities" registry has "Keyword", "Description", and"Reference" columns. Although implementationsSHOULD use the "SCEP CA Capabilities"registry, SCEP is often employed in situations where this isn't possible. Inthis case, private-use CA capabilities may be specified using a unique prefixsuch as an organisation identifier or domain name under the control of theentity that defines the capability. For example, the prefix would be"Example.com-", and the complete capability would be"Example.com-CapabilityName".

IANA has registered four media types as defined in this document:

Note that these are grandfathered media types registered as perAppendix A of [RFC6838]. Templatesfor registrations are specified below.

6.1.Registration of the application/x-x509-ca-cert Media Type

Type name:
application
Subtype name:
x-x509-ca-cert
Required parameters:
none
Optional parameters:
none
Encoding considerations:
binary
Security considerations:
This media type contains a certificate; see theSecurity Considerations section of[RFC5280]. There is no executable content.
Interoperability considerations:
This is a grandfathered registration of an alias to application/pkix-cert(basically a single DER-encoded Certification Authority certificate), which isonly used in SCEP.
Published specification:
RFC 8894
Applications that use this media type:
SCEP uses this media type when returning a CA certificate.
Fragment identifier considerations:
N/A
Additional information:


Deprecated alias names for this type:
N/A
Magic number(s):
none
File extension(s):
N/A
Macintosh file type code(s):
N/A
Person and email address to contact for further information:
See the Authors' Addresses section of RFC 8894.
Intended usage:
LIMITED USE
Restrictions on usage:
SCEP protocol
Author:
See the Authors' Addresses section of RFC 8894
Change controller:
IETF
Provisional registration?
No

6.2.Registration of the application/x-x509-ca-ra-cert Media Type

Type name:
application
Subtype name:
x-x509-ca-ra-cert
Required parameters:
none
Optional parameters:
none
Encoding considerations:
binary
Security considerations:
This media type consists of a degeneratecertificates-only CMS SignedData message (Section 3.4) containing the certificates, with the intermediate CAcertificate(s) as the leaf certificate(s). There is no executablecontent.
Interoperability considerations:
This is a grandfathered registration that is only used in SCEP.
Published specification:
RFC 8894
Applications that use this media type:
SCEP uses this media type when returning CA Certificate ChainResponse.
Fragment identifier considerations:
N/A
Additional information:


Deprecated alias names for this type:
N/A
Magic number(s):
none
File extension(s):
N/A
Macintosh file type code(s):
N/A
Person and email address to contact for further information:
See the Authors' Addresses section of RFC 8894.
Intended usage:
LIMITED USE
Restrictions on usage:
SCEP protocol
Author:
See the Authors' Addresses section of RFC 8894.
Change controller:
IETF
Provisional registration?
no

6.3.Registration of the application/x-x509-next-ca-cert Media Type

Type name:
application
Subtype name:
x-x509-next-ca-cert
Required parameters:
none
Optional parameters:
none
Encoding considerations:
binary
Security considerations:
This media type consists of a SignedData CMS message, signed by thecurrent CA signing key. There is no executable content.
Interoperability considerations:
This is a grandfathered registration that is only used in SCEP.
Published specification:
RFC 8894
Applications that use this media type:
SCEP uses this media type when returning a Get Next CA response.
Fragment identifier considerations:
N/A
Additional information:


Deprecated alias names for this type:
N/A
Magic number(s):
none
File extension(s):
N/A
Macintosh file type code(s):
N/A
Person and email address to contact for further information:
See the Authors' Addresses section of RFC 8894.
Intended usage:
LIMITED USE
Restrictions on usage:
SCEP protocol
Author:
See the Authors' Addresses section of RFC 8894.
Change controller:
IETF
Provisional registration?
no

6.4.Registration of the application/x-pki-message Media Type

Type name:
application
Subtype name:
x-pki-message
Required parameters:
none
Optional parameters:
none
Encoding considerations:
binary
Security considerations:
This media type consists of a degenerate certificates-only CMS SignedDatamessage. There is no executable content.
Interoperability considerations:
This is a grandfathered registration that is only used in SCEP.
Published specification:
RFC 8894
Applications that use this media type:
SCEP uses this media type when returning a Certificate Enrolment/RenewalResponse.
Fragment identifier considerations:
N/A
Additional information:


Deprecated alias names for this type:
N/A
Magic number(s):
none
File extension(s):
N/A
Macintosh file type code(s):
N/A
Person and email address to contact for further information:
See the Authors' Addresses section of RFC 8894.
Intended usage:
LIMITED USE
Restrictions on usage:
SCEP protocol
Author:
See the Authors' Addresses section of RFC 8894.
Change controller:
IETF
Provisional registration?
no

7.Security Considerations

The security goal of SCEP is that no adversary can subvert the publickey/identity binding from that intended. An adversary is any entity otherthan the client and the CA participating in the protocol.

This goal is met through the use of CMS and PKCS #10 encryption and digitalsignatures using authenticated public keys. The CA's public key isauthenticated via out-of-band means such as the checking of the CA fingerprint,and the SCEP client's public key is authenticated through manual or presharedsecret authentication.

7.1.General Security

Common key-management considerations such as keeping private keys trulyprivate and using adequate lengths for symmetric and asymmetric keys must befollowed in order to maintain the security of this protocol. This isespecially true for CA keys which, when compromised, compromise the securityof all relying parties.

7.2.Use of the CA Private Key

A CA private key is generally meant for, and usually flagged as, beingusable for certificate (and CRL) signing exclusively rather than data signingor encryption. The SCEP protocol, however, uses the CA private key to both signand optionally encrypt CMS transport messages. This is generally consideredundesirable, as it widens the possibility of an implementation weakness andprovides an additional location where the private key must be used (and henceis slightly more vulnerable to exposure) and where a side-channel attack mightbe applied.

7.3.ChallengePassword Shared Secret Value

The security measures that should be applied to the challengePassword sharedsecret depend on the manner in which SCEP is employed. In the simplest case,with SCEP used to provision devices with certificates in the manufacturingfacility, the physical security of the facility may be enough to protect thecertificate issue process with no additional measures explicitly required. Ingeneral, though, the security of the issue process depends on the securityemployed around the use of the challengePassword shared secret. While it'snot possible to enumerate every situation in which SCEP may be utilised, thefollowing security measures should be considered.

  • The challengePassword, despite its name, shouldn't be a conventional passwordbut a high-entropy shared-secret authentication string. Using the base64encoding of a keying value generated or exchanged as part of standard deviceauthentication protocols like the Extensible Authentication Protocol (EAP) orDNP3 Secure Authentication (DNP3-SA) makes for a goodchallengePassword. The use of high-entropy shared secrets is particularlyimportant when the PasswordRecipientInfo option is used to encrypt SCEPmessages; seeSection 3.1.
  • If feasible, the challengePassword should be a one-time value used toauthenticate the issue of a single certificate (subsequent certificaterequests will be authenticated by being signed with the initial certificate).If the challengePassword is single use, then the arrival of subsequent requestsusing the same challengePassword can then be used to indicate a securitybreach.
  • The lifetime of a challengePassword can be limited, so that it can be usedduring initial device provisioning but will have expired at a later date if anattacker manages to compromise the challengePassword value -- for example, bycompromising the device that it's stored in.
  • The CA should take appropriate measures to protect thechallengePassword. Examples of possible measures include: physical securitymeasures; storing it as a salted iterated hash or equivalent memory-hardfunction; storing it as a keyed MAC value if it's not being used forencryption; and storing it in encrypted form if it is being used for encryption.

7.4.Lack of Certificate Issue Confirmation

SCEP provides no confirmation that the issued certificate was successfullyreceived and processed by the client. This means that if the CertRep messageis lost or can't be processed by the client, then the CA will consider thecertificate successfully issued while the client won't. If this situation isof concern, then the correct issuance of the certificate will need to beverified by out-of-band means, for example, through the client sending amessage signed by the newly issued certificate to the CA. This also providesthe proof of possession that's not present in the case of a renewal operation;seeSection 7.6.

7.5.GetCACaps Issues

The GetCACaps response is not authenticated by the CA. This allows anattacker to perform downgrade attacks on the cryptographic capabilities of theclient/CA exchange. In particular, if the server were to support MD5 andsingle DES, then an in-path attacker could trivially roll back the encryptionto use these insecure algorithms. By taking advantage of the presence oflarge amounts of static known plaintext in the SCEP messages, as of 2017, a DESrainbow table attack can recover most encryption keys in under a minute, andMD5 chosen-prefix collisions can be calculated for a few tens of cents ofcomputing time using tools like HashClash. It is for this reason that thisspecification makes single DES and MD5 aMUST NOT feature. Note that allknown servers support at least triple DES and SHA-1 (regardless of whether"DES3" and "SHA-1" are indicated in GetCACaps), so there should never be areason to fall all the way back to single DES and MD5.

One simple countermeasure to a GetCACaps downgrade attack is for clients thatare operating in an environment where on-path attacks are possible and thatexpect the "SCEPStandard" capability to be indicated by the CA but don't seeit in the GetCACaps response to treat its absence as a security issue, andeither discontinue the exchange or continue as if "SCEPStandard" had beenreturned. This requires a certain trade-off between compatibility with oldservers and security against active attacks.

7.6.Lack of PoP in Renewal Requests

Renewal operations (but not standard certificate-issue operations) areprocessed via a previously issued certificate and its associated private key,not the key in the PKCS #10 request. This means that a client no longerdemonstrates proof of possession (PoP) of the private key corresponding to thepublic key in the PKCS #10 request. It is therefore possible for a client torecertify an existing key used by a third party, so that two or morecertificates exist for the same key. By switching out the certificate in asignature, an attacker can appear to have a piece of data signed by theircertificate rather than the original signer's certificate. This, and other,attacks are described inS/MIME ESS [RFC2634].

Avoiding these types of attacks requires situation-specific measures. Forexample, CMS/SMIME implementations may use the ESSCertID attribute fromS/MIME ESS [RFC2634] or its successor,S/MIMEESSv2 [RFC5035], to unambiguously identify the signing certificate. However, sinceother mechanisms and protocols that the certificates will be used withtypically don't defend against this problem, it's unclear whether this is anactual issue with SCEP.

7.7.Traffic Monitoring

SCEP messages are signed with certificates that may contain identifyinginformation. If these are sent over the public Internet and real identityinformation (rather than placeholder values or arbitrary device IDs) isincluded in the signing certificate data, an attacker may be able to monitorthe identities of the entities submitting the certificate requests. If thisis an issue, then[RFC7258] should be consulted for guidance.

7.8.Unnecessary Cryptography

Some of the SCEP exchanges use unnecessary signing and encryption operations.In particular, the GetCert and GetCRL exchanges are encrypted and signed inboth directions. The information requested is public, and thus encrypting therequests is of questionable value. In addition, CRLs and certificates sent inresponses are already signed by the CA and can be verified by the recipientwithout requiring additional signing and encryption. More lightweight meansof retrieving certificates and CRLs such asHTTPcertificate-store access [RFC4387] and LDAP are recommended for this reason.

7.9.Use of SHA-1

The majority of the large number of devices that use SCEP today default toSHA-1, with many supporting only that hash algorithm with no ability toupgrade to a newer one. SHA-1 is no longer regarded as secure in allsituations, but as used in SCEP, it's still safe. There are three reasons forthis. The first is that attacking SCEP would require creating a fully generalSHA-1 collision in close to real time alongside breaking AES (morespecifically, it would require creating a fully general SHA-1 collision forthe PKCS #10 request, breaking the AES encryption around the PKCS #10 request,and then creating a second SHA-1 collision for the signature on the encrypteddata), which won't be feasible for a long time.

The second reason is that the signature over the message -- in other words, theSHA-1 hash that isn't protected by encryption -- doesn't serve any criticalcryptographic purpose: The PKCS #10 data itself is authenticated through itsown signature, protected by encryption, and the overall request is authorisedby the (encrypted) shared secret. The sole exception to this will be thesmall number of implementations that support the Renewal operation, which maybe authorised purely through a signature, but presumably any implementationrecent enough to support Renewal also supports SHA-2. Any legacyimplementation that supports the historic core SCEP protocol would not beaffected.

The third reason is that SCEP uses the same key for encryption and signing, sothat even if an attacker were able to capture an outgoing renewal request thatdidn't include a shared secret (in other words, one that was only authorisedthrough a signature), break the AES encryption, forge the SHA-1 hash in realtime, and forward the forged request to the CA, they couldn't decrypt thereturned certificate, which is protected with the same key that was used togenerate the signature. WhileSection 7.8 pointsout that SCEP uses unnecessary cryptography in places, the additional level ofsecurity provided by the extra crypto makes it immune to any issues withSHA-1.

This doesn't mean that SCEP implementations should continue to use SHA-1 inperpetuity, merely that there's no need for a panicked switch to SHA-2.

7.10.Use of HTTP

SCEP is an encrypted, authenticated certificate enrollment protocol that usesHTTP as a simple transport mechanism. Since SCEP messages are alreadycryptographically secured, it does not require transport layer security. WhereHTTPS is elected, a performance hit may result from the TLS overhead,operational problems may result due to the more complex configuration, andpotential security vulnerability may result due to the addition of an entireTLS protocol stack alongside the basic SCEP protocol.

In particular, experience has shown that the issue of configuringcertificates, CAs, and trust for both TLS and SCEP often leads tointeroperability problems because different certificates and trust models areused in each. Use of HTTPS to authenticate the server does not enableomission of the ChallengePassword or similar authenticator in the SCEP messageon the assumption that using HTTPS instead of HTTP will somehow make thisinsecure usage secure again. HTTPS is not soy sauce for security and isunnecessary for SCEP, which uses cryptographically secured messages and doesnot require transport layer security.

8.References

8.1.Normative References

[AES]
Technology, U. N. I. O. S. A.,"The Advanced Encryption Standard (AES)",FIPS 197,DOI 10.6028/NIST.FIPS.197,,<https://doi.org/10.6028/NIST.FIPS.197>.
[RFC2119]
Bradner, S.,"Key words for use in RFCs to Indicate Requirement Levels",BCP 14,RFC 2119,DOI 10.17487/RFC2119,,<https://www.rfc-editor.org/info/rfc2119>.
[RFC2985]
Nystrom, M. and B. Kaliski,"PKCS #9: Selected Object Classes and Attribute Types Version 2.0",RFC 2985,DOI 10.17487/RFC2985,,<https://www.rfc-editor.org/info/rfc2985>.
[RFC2986]
Nystrom, M. and B. Kaliski,"PKCS #10: Certification Request Syntax Specification Version 1.7",RFC 2986,DOI 10.17487/RFC2986,,<https://www.rfc-editor.org/info/rfc2986>.
[RFC3986]
Berners-Lee, T., Fielding, R., and L. Masinter,"Uniform Resource Identifier (URI): Generic Syntax",STD 66,RFC 3986,DOI 10.17487/RFC3986,,<https://www.rfc-editor.org/info/rfc3986>.
[RFC4648]
Josefsson, S.,"The Base16, Base32, and Base64 Data Encodings",RFC 4648,DOI 10.17487/RFC4648,,<https://www.rfc-editor.org/info/rfc4648>.
[RFC5234]
Crocker, D., Ed. and P. Overell,"Augmented BNF for Syntax Specifications: ABNF",STD 68,RFC 5234,DOI 10.17487/RFC5234,,<https://www.rfc-editor.org/info/rfc5234>.
[RFC5280]
Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk,"Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile",RFC 5280,DOI 10.17487/RFC5280,,<https://www.rfc-editor.org/info/rfc5280>.
[RFC5652]
Housley, R.,"Cryptographic Message Syntax (CMS)",STD 70,RFC 5652,DOI 10.17487/RFC5652,,<https://www.rfc-editor.org/info/rfc5652>.
[RFC6838]
Freed, N., Klensin, J., and T. Hansen,"Media Type Specifications and Registration Procedures",BCP 13,RFC 6838,DOI 10.17487/RFC6838,,<https://www.rfc-editor.org/info/rfc6838>.
[RFC7230]
Fielding, R., Ed. and J. Reschke, Ed.,"Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing",RFC 7230,DOI 10.17487/RFC7230,,<https://www.rfc-editor.org/info/rfc7230>.
[RFC7258]
Farrell, S. and H. Tschofenig,"Pervasive Monitoring Is an Attack",BCP 188,RFC 7258,DOI 10.17487/RFC7258,,<https://www.rfc-editor.org/info/rfc7258>.
[RFC8126]
Cotton, M., Leiba, B., and T. Narten,"Guidelines for Writing an IANA Considerations Section in RFCs",BCP 26,RFC 8126,DOI 10.17487/RFC8126,,<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174]
Leiba, B.,"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words",BCP 14,RFC 8174,DOI 10.17487/RFC8174,,<https://www.rfc-editor.org/info/rfc8174>.
[SHA2]
Technology, U. N. I. O. S. A.,"Secure Hash Standard (SHS)",FIPS 180-3,.

8.2.Informative References

[HTTP]
Nottingham, M.,"Building Protocols with HTTP",Work in Progress,Internet-Draft, draft-ietf-httpbis-bcp56bis-09,,<https://tools.ietf.org/html/draft-ietf-httpbis-bcp56bis-09>.
[JSCEP]
"A Java implementation of the Simple Certificate Enrolment Protocol",commit 7410332,,<https://github.com/jscep/jscep>.
[RFC2634]
Hoffman, P., Ed.,"Enhanced Security Services for S/MIME",RFC 2634,DOI 10.17487/RFC2634,,<https://www.rfc-editor.org/info/rfc2634>.
[RFC4387]
Gutmann, P., Ed.,"Internet X.509 Public Key Infrastructure Operational Protocols: Certificate Store Access via HTTP",RFC 4387,DOI 10.17487/RFC4387,,<https://www.rfc-editor.org/info/rfc4387>.
[RFC5035]
Schaad, J.,"Enhanced Security Services (ESS) Update: Adding CertID Algorithm Agility",RFC 5035,DOI 10.17487/RFC5035,,<https://www.rfc-editor.org/info/rfc5035>.
[RFC7296]
Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. Kivinen,"Internet Key Exchange Protocol Version 2 (IKEv2)",STD 79,RFC 7296,DOI 10.17487/RFC7296,,<https://www.rfc-editor.org/info/rfc7296>.
[RFC8446]
Rescorla, E.,"The Transport Layer Security (TLS) Protocol Version 1.3",RFC 8446,DOI 10.17487/RFC8446,,<https://www.rfc-editor.org/info/rfc8446>.
[RFC8551]
Schaad, J., Ramsdell, B., and S. Turner,"Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 Message Specification",RFC 8551,DOI 10.17487/RFC8551,,<https://www.rfc-editor.org/info/rfc8551>.

Appendix A.Background Notes

This specification has spent over twenty years in the draft stage. Itsoriginal goal, provisioning IPsec routers with certificates, has long sincechanged to general device/embedded system/IoT use. To fit this role, extrafeatures were bolted on in a haphazard manner through the addition of agrowing list of appendices and by inserting additional, often conflicting,paragraphs in various locations in the body text. Since existing featureswere never updated as newer ones were added, the specification accumulatedlarge amounts of historical baggage over time. If OpenPGP was described as "amuseum of 1990s crypto", then the SCEP document was its graveyard.

About five years ago, the specification, which even at that point had seen onlysporadic reposts of the existing document, was more or less abandoned by itsoriginal sponsors. Due to its widespread use in large segments of theindustry, the specification was rebooted in 2015, cleaning up fifteen years'worth of accumulated cruft, fixing errors, clarifying ambiguities, andbringing the algorithms and standards used into the current century (prior tothe update, the de facto lowest-common-denominator algorithms used forinteroperability were the insecure forty-year-old single DES and broken MD5hash algorithms).

Note that although the text of the current specification has changedsignificantly due to the consolidation of features and appendices into themain document, the protocol that it describes is identical on the wire to theoriginal (with the unavoidable exception of the switch from single DES and MD5to AES and SHA-2). The only two changes introduced, the "SCEPStandard"indicator in GetCACaps and the failInfoText attribute, are both optionalvalues and would be ignored by older implementations that don't support them,or can be omitted from messages if they are found to cause problems.

Other changes include:

Acknowledgements

The editor would like to thank all of the previous editors, authors, andcontributors for their work maintaining thedocument over the years:Cheryl Madson,Xiaoyi Liu,David McGrew,David Cooper,Andy Nourse,Max Pritikin,Jan Vilhuber, and others. The IETF reviewers providedmuch useful feedback thathelped improve the document, and in particular spotted a number of things thatwere present in SCEP through established practice rather than by beingexplicitly described in the text. Numerous other people have contributedduring the long life cycle of the document, and all deserve thanks. In addition,several PKCS #7 / CMS libraries contributed to interoperability by doing theright thing despite what earlier SCEP documents required.

The authors of earlier draft versions of this document would like to thankPeter William of ValiCert, Inc. (formerly of VeriSign, Inc.),Alex Deacon ofVeriSign, Inc., andChristopher Welles of IRE, Inc. for their contributions toearly versions of this protocol and this document.

Author's Address

Peter Gutmann
University of Auckland
Department of Computer Science
Auckland
New Zealand
Email:pgut001@cs.auckland.ac.nz

[8]ページ先頭

©2009-2025 Movatter.jp