forked from certnanny/sscep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
draft-gutmann-scep-05.txt
2184 lines (1505 loc) · 89.2 KB
/
draft-gutmann-scep-05.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Network Working Group P. Gutmann
Internet-Draft University of Auckland
Intended status: Standards Track November 24, 2016
Expires: May 28, 2017
Simple Certificate Enrolment Protocol
draft-gutmann-scep-05
Abstract
This document specifies the Simple Certificate Enrolment Protocol
(SCEP), a PKI protocol that leverages existing technology by using
CMS (formerly known as PKCS #7) and PKCS #10 over HTTP. SCEP is the
evolution of the enrolment protocol sponsored by Cisco Systems, which
enjoys wide support in both client and server implementations, as
well as being relied upon by numerous other industry standards that
work with certificates.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 28, 2017.
Copyright Notice
Copyright (c) 2016 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
(http://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
Gutmann Expires May 28, 2017 [Page 1]
Internet-Draft SCEP November 2016
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Conventions Used in This Document . . . . . . . . . . . . 4
2. SCEP Overview . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1. SCEP Entities . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1. Client . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.2. Certificate Authority . . . . . . . . . . . . . . . . 5
2.1.3. CA Certificate Distribution . . . . . . . . . . . . . 5
2.2. Client authentication . . . . . . . . . . . . . . . . . . 6
2.3. Enrolment authorization . . . . . . . . . . . . . . . . . 7
2.4. Certificate Enrolment/Renewal/Update . . . . . . . . . . 7
2.4.1. Client State Transitions . . . . . . . . . . . . . . 8
2.5. Certificate Access . . . . . . . . . . . . . . . . . . . 10
2.6. CRL Access . . . . . . . . . . . . . . . . . . . . . . . 10
2.7. Certificate Revocation . . . . . . . . . . . . . . . . . 11
2.8. Mandatory-to-Implement Functionality . . . . . . . . . . 11
3. SCEP Secure Message Objects . . . . . . . . . . . . . . . . . 11
3.1. SCEP Message Object Processing . . . . . . . . . . . . . 13
3.2. SCEP pkiMessage . . . . . . . . . . . . . . . . . . . . . 13
3.2.1. Signed Transaction Attributes . . . . . . . . . . . . 13
3.2.1.1. transactionID . . . . . . . . . . . . . . . . . . 15
3.2.1.2. messageType . . . . . . . . . . . . . . . . . . . 15
3.2.1.3. pkiStatus . . . . . . . . . . . . . . . . . . . . 16
3.2.1.4. failInfo . . . . . . . . . . . . . . . . . . . . 16
3.2.1.5. senderNonce and recipientNonce . . . . . . . . . 17
3.2.2. SCEP pkcsPKIEnvelope . . . . . . . . . . . . . . . . 17
3.3. SCEP pkiMessage types . . . . . . . . . . . . . . . . . . 17
3.3.1. PKCSReq/RenewalReq/UpdateReq . . . . . . . . . . . . 17
3.3.2. CertRep . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.2.1. CertRep SUCCESS . . . . . . . . . . . . . . . . . 18
3.3.2.2. CertRep FAILURE . . . . . . . . . . . . . . . . . 19
3.3.2.3. CertRep PENDING . . . . . . . . . . . . . . . . . 19
3.3.3. CertPoll (GetCertInitial) . . . . . . . . . . . . . . 19
3.3.4. GetCert . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.5. GetCRL . . . . . . . . . . . . . . . . . . . . . . . 21
3.4. Degenerate certificates-only CMS Signed-Data . . . . . . 21
3.5. CA Capabilities . . . . . . . . . . . . . . . . . . . . . 21
3.5.1. GetCACaps HTTP Message Format . . . . . . . . . . . . 21
3.5.2. CA Capabilities Response Format . . . . . . . . . . . 22
4. SCEP Transactions . . . . . . . . . . . . . . . . . . . . . . 24
4.1. HTTP POST and GET Message Formats . . . . . . . . . . . . 24
4.2. Get CA Certificate . . . . . . . . . . . . . . . . . . . 25
4.2.1. Get CA Certificate Response Message Format . . . . . 25
4.2.1.1. CA Certificate Response Message Format . . . . . 25
Gutmann Expires May 28, 2017 [Page 2]
Internet-Draft SCEP November 2016
4.2.1.2. CA Certificate Chain Response Message Format . . 25
4.3. Certificate Enrolment/Renewal/Update . . . . . . . . . . 26
4.3.1. Certificate Enrolment/Renewal/Update Response Message 26
4.4. Poll for Client Initial Certificate . . . . . . . . . . . 27
4.4.1. Polling Response Message Format . . . . . . . . . . . 27
4.5. Certificate Access . . . . . . . . . . . . . . . . . . . 27
4.5.1. Certificate Access Response Message Format . . . . . 28
4.6. CRL Access . . . . . . . . . . . . . . . . . . . . . . . 28
4.6.1. CRL Access Response Message Format . . . . . . . . . 28
4.7. Get Next Certificate Authority Certificate . . . . . . . 28
4.7.1. Get Next CA Response Message Format . . . . . . . . . 28
5. SCEP State Transitions . . . . . . . . . . . . . . . . . . . 29
5.1. Successful Transactions . . . . . . . . . . . . . . . . . 29
5.2. Transactions with Errors . . . . . . . . . . . . . . . . 30
6. Contributors/Acknowledgements . . . . . . . . . . . . . . . . 33
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33
8. Security Considerations . . . . . . . . . . . . . . . . . . . 33
8.1. General Security . . . . . . . . . . . . . . . . . . . . 33
8.2. Use of the CA keypair . . . . . . . . . . . . . . . . . . 33
8.3. Challenge Password . . . . . . . . . . . . . . . . . . . 34
8.4. Lack of Certificate Issue Confirmation . . . . . . . . . 34
8.5. GetCACaps Issues . . . . . . . . . . . . . . . . . . . . 34
8.6. Lack of PoP in Renewal and Update Requests . . . . . . . 34
8.7. Unnecessary cryptography . . . . . . . . . . . . . . . . 35
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.1. Normative References . . . . . . . . . . . . . . . . . . 35
9.2. Informative References . . . . . . . . . . . . . . . . . 36
Appendix A. Background Notes . . . . . . . . . . . . . . . . . . 36
Appendix B. Sample SCEP Messages . . . . . . . . . . . . . . . . 39
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 39
1. Introduction
X.509 certificates serve as the basis for several standards-based
security protocols such as TLS [16], S/MIME [13], and IKE/IPsec [12].
When an X.509 certificate is issued there typically is a need for a
certificate management protocol to enable a PKI client to request a
certificate, certificate renewal, or certificate update from a
Certificate Authority (CA).
This specification defines a protocol, Simple Certificate Enrolment
Protocol (SCEP), for certificate management and certificate and CRL
queries. While widely deployed, this protocol omits some certificate
management features, e.g. certificate revocation transactions, which
may enhance the security achieved in a PKI. The IETF protocol suite
currently includes two further certificate management protocols with
more comprehensive functionality, Certificate Management Protocol
(CMP) [10] and Certificate Management over CMS (CMC) [9].
Gutmann Expires May 28, 2017 [Page 3]
Internet-Draft SCEP November 2016
Environments that do not require interoperability with SCEP
implementations MAY consider using the above-mentioned certificate
management protocols, however anyone considering this step should be
aware that the high level of complexity of these two protocols has
resulted in serious interoperability problems and corresponding lack
of industry support. SCEP's simplicity, while being a drawback in
terms of its slightly restricted functionality, also makes deployment
relatively straightforward, so that it enjoys widespread support and
ready interoperability across a range of platforms. While
implementers are encouraged to investigate one of the more
comprehensive alternative certificate management protocols in
addition to the protocol defined in this specification, anyone
wishing to deploy them should proceed with caution, and consider
support and interoperability issues before committing to their use.
The SCEP protocol supports the following general operations:
o CA public key distribution.
o Certificate enrolment and issue.
o Certificate renewal/update.
o Certificate query.
o CRL query.
SCEP makes extensive use of CMS [3] and PKCS #10 [6].
1.1. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [1].
2. SCEP Overview
This section provides a high level overview of the functionality of
SCEP.
2.1. SCEP Entities
The entity types defined in SCEP are a client requesting a
certificate and a Certificate Authority (CA) that issues the
certificate. These are described in the following sections.
2.1.1. Client
A client MUST have the following information locally configured:
1. The CA fully qualified domain name or IP address.
Gutmann Expires May 28, 2017 [Page 4]
Internet-Draft SCEP November 2016
2. The CA HTTP CGI script path (this usually has a default value,
see Section 4.1).
3. The identifying information that is used for authentication of
the CA in Section 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
enforce any arbitrary policies and apply them to certificate
requests, and MAY reject any request.
Since the client is expected to perform signature verification and
optionally encryption using the CA certificate, the keyUsage
extension in the CA certificate MUST indicate that it is valid for
digitalSignature and keyEncipherment (if required) alongside the
usual CA usages of keyCertSign and/or cRLSign.
2.1.3. CA Certificate Distribution
If the CA certificate(s) have not previously been acquired by the
client through some other means, the client MUST retrieve the them
before any PKI operation (Section 3) can be started. Since no public
key has yet been exchanged between the client and the CA, the
messages cannot be secured using CMS, and the data is instead
transferred in the clear.
If an intermediate CA is in use, a certificates-only CMS Signed-Data
message with a certificate chain consisting of all CA certificates is
returned. Otherwise the CA certificate itself is returned. The
transport protocol (Section 4) MUST indicate which one is returned.
The CA certificate MAY be provided out-of-band to the client.
Alternatively, the CA certificate fingerprint MAY be used to
authenticate a CA Certificate distributed by the GetCACert response
(Section 4.2) or via HTTP certificate-store access [11]. The
fingerprint is created by calculating a SHA-256 hash over the whole
CA certificate (for legacy reasons, a SHA-1 hash may be used by some
implementations).
After the client gets the CA certificate, it SHOULD authenticate the
certificate by comparing its fingerprint with the locally configured,
out-of-band distributed, identifying information. Intermediate CA
certificates, if any, are signed by a higher-level CA so there is no
need to authenticate them against the out-of-band data. Clients
SHOULD verify intermediate-level CA certificate signatures using the
issuing CA's certificate before use during protocol exchanges.
Gutmann Expires May 28, 2017 [Page 5]
Internet-Draft SCEP November 2016
Because a long time can pass between queries from a client to a CA
and because intermediate CA certificates can change over time, it is
recommended that a client not store intermediate CA certificates.
Instead, the client SHOULD retrieve them before each operation.
2.2. Client authentication
As with every protocol that uses public-key cryptography, the
association between the public keys used in the protocol and the
identities with which they are associated must be authenticated in a
cryptographically secure manner. The communications between the
client and the CA are secured using SCEP Secure Message Objects as
explained in Section 3, which specifies how CMS is used to encrypt
and sign the data. In order to perform the 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 certificate MUST be used.
The keyUsage extension in the certificate MUST indicate that it
is valid for digitalSignature and keyEncipherment (if required).
The self-signed certificate SHOULD use the same subject name as
in the PKCS #10 request. In this case the messageType is
PKCS10Req (see Section 3.2.1.2).
2. If the requesting system already has a certificate issued by the
SCEP CA, and the CA supports renewal (see Section 2.4), that
certificate SHOULD be used. In this case the messageType is
RenewalReq (see Section 3.2.1.2).
3. If the requesting system has no certificate issued by the new CA,
but has credentials from an alternate CA the certificate issued
by the alternate CA MAY be used. Policy settings on the new CA
will determine if the request can be accepted or not. This is
useful when enrolling with a new administrative domain using a
certificate from the old domain as credentials. In this case the
messageType is UpdateReq (see Section 3.2.1.2).
Note that although the above text describes three different types of
operations, in practice most implementations always apply the first
one even if an existing certificate already exists. For this reason
support for the first case is mandatory while support for the latter
two are optional (see Section 2.8).
During the certificate enrolment process, the client MUST use the
selected certificate's key when signing the CMS envelope (see
Section 3). This certificate will be either the self-signed one
matching the PKCS #10 request or the CA-issued one used to authorise
a renewal or update. If the key being certified allows encryption
then the CA's CertResp will use the same certificate's public key
when encrypting the response.
Gutmann Expires May 28, 2017 [Page 6]
Internet-Draft SCEP November 2016
Note that this means that, in the case of renewal and update
operations, the request is signed with, and the returned response may
be encrypted with, the key in the previously-issued certificate used
to authenticate the request, not the key in the PKCS #10 request.
This has security implications, see Section 8.6.
2.3. Enrolment authorization
PKCS #10 [6] specifies a PKCS #9 [5] challengePassword attribute to
be sent as part of the enrolment request. When utilizing the
challengePassword, the CA distributes a shared secret to the client
which will uniquely associate the enrolment request with the client.
Inclusion of the challengePassword by the SCEP client is OPTIONAL and
allows for unauthenticated authorization of enrolment requests
(which, however, requires manual approval of each certificate issue,
see below), or for renewal or update requests that are authenticated
by being signed with an existing certificate. The CMS envelope
protects the privacy of the challengePassword.
A client that is performing certificate renewal or update as per
Section 2.4 SHOULD omit the challengePassword but MAY send the
originally distributed password in the challengePassword attribute.
In the former case the SCEP CA MUST authenticate the request based on
the certificate used to sign the renewal or update request. In the
latter case the SCEP CA MAY use either the challengePassword or the
previously issued certificate (or both), depending on CA policy, to
authenticate the request. The SCEP CA MUST NOT attempt to
authenticate a client based on a self-signed certificate unless it
has been verified through out-of-band means such as a certificate
fingerprint.
To perform the authorization in manual mode the client's request is
placed in the PENDING state until the CA operator authorizes or
rejects it. Manual authorization is used when the client has only a
self-signed certificate that hasn't been previously authenticated by
the CA and/or a challengePassword is not available. The SCEP CA MAY
either reject unauthorized requests or mark them for manual
authorization according to CA policy.
2.4. Certificate Enrolment/Renewal/Update
A client starts an enrolment transaction (Section 3.3.1) by creating
a certificate request using PKCS #10 and sends it to the CA enveloped
using CMS (Section 3).
If the CA supports certificate renewal or update and if the CA policy
permits then a new certificate with new validity dates can be issued
Gutmann Expires May 28, 2017 [Page 7]
Internet-Draft SCEP November 2016
even though the old one is still valid. The CA MAY automatically
revoke the old client certificate. To renew or update an existing
certificate, the client uses the RenewalReq or UpdateReq message (see
Section 3.3) and signs it with the existing client certificate. The
client SHOULD use a new keypair when requesting a new certificate,
but MAY request a new certificate using the old keypair.
If the CA returns a CertRep message (Section 3.3.2) with status set
to PENDING, the client enters into polling mode by periodically
sending a CertPoll message (Section 3.3.3) to the CA until the CA
operator completes the manual authentication (approving or denying
the request).
If polling mode is being used then the client will send a single
PKCSReq/RenewalReq/UpdateReq message (Section 3.3.1), followed by 0
or more CertPoll messages (Section 3.3.3). The CA will in return
send 0 or more CertRep messages (Section 3.3.2) with status set to
PENDING in response to CertPolls, followed by a single CertRep
message (Section 3.3.2) with status set to either SUCCESS or FAILURE.
2.4.1. Client State Transitions
The client state transitions during the SCEP process are indicated in
Figure 1.
CertPoll
+-----<----+
| |
| | CertRep(PENDING)
| |
[CERT-NONEXISTENT] ------> [CERT-REQ-PENDING] ---------> [CERT-ISSUED]
^ PKCSReq | CertRep(SUCCESS)
| RenewalReq |
| UpdateReq |
| |
+-----------------------+
CertRep(FAILURE) or
Max-time/max-polls exceeded
Figure 1: State Transition Diagram
The certificate issue process starts at the state CERT-NONEXISTENT.
Sending a PKCSReq/RenewalReq/UpdateReq message changes the state to
CERT-REQ-PENDING.
Gutmann Expires May 28, 2017 [Page 8]
Internet-Draft SCEP November 2016
If the CA returns a CertRep message with pkiStatus set to SUCCESS
then the state changes to CERT-ISSUED.
If the CA returns a CertRep message with pkiStatus set to FAILURE or
there is no response then the state reverts back to CERT-NONEXISTENT.
If the CA returns a CertRep message with pkiStatus set to PENDING
then the client will keep polling by sending a CertPoll message until
either a CertRep message with status set to SUCCESS or FAILURE is
received or a timeout occurs or the maximum number of polls has been
exceeded.
A successful transaction in automatic mode:
CLIENT CA SERVER
PKCSReq: PKI cert. enrolment message
--------------------------------> CertRep: pkiStatus = SUCCESS
Certificate attached
<------------------------------
Receive issued certificate.
A successful transaction in manual mode:
CLIENT CA SERVER
PKCSReq: 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.
Gutmann Expires May 28, 2017 [Page 9]
Internet-Draft SCEP November 2016
2.5. Certificate Access
A certificate query message is defined for clients to retrieve a copy
of their own certificate from the CA. It allows clients that do not
store their certificates locally to obtain a copy when needed. This
functionality is not intended to provide a general purpose
certificate access service, which may be achieved via HTTP
certificate-store access [11] or LDAP.
To query a certificate from the CA, a client sends a request
consisting of the certificate's issuer name and serial number. This
assumes that the client has saved the issuer name and the serial
number of the issued certificate from the previous enrolment
transaction. The transaction to query a certificate consists of one
GetCert (Section 3.3.4) message and one CertRep (Section 3.3.2)
message, as shown below.
CLIENT CA SERVER
GetCert: PKI certificate query message
-------------------------------> CertRep: pkiStatus = SUCCESS
Certificate attached
<-----------------------------
Receive the certificate.
2.6. CRL Access
SCEP clients MAY request a CRL via one of three methods:
1. If the CA supports CRL Distribution Points (CRLDPs) [7], then the
CRL MAY be retrieved via the mechanism specified in the CRDLP.
2. If the CA supports HTTP certificate-store access [11], then the
CRL MAY be retrieved via the AuthorityInfoAcces [7] location
specified in the certificate.
3. Only if the CA does not support CRDLPs 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 CA SHOULD NOT support the GetCRL method because it does not scale
well due to the unnecessary cryptography (see Section 8.7) and it
requires the CA to be a high-availability service.
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 one CertRep PKI message, which contains only the CRL
Gutmann Expires May 28, 2017 [Page 10]
Internet-Draft SCEP November 2016
(no certificates) in a degenerate certificates-only CMS Signed-Data
message (Section 3.4), as shown below.
CLIENT CA SERVER
GetCRL: PKI CRL query message
---------------------------------->
CertRep: CRL attached
<-----------------------------
Receive the CRL
2.7. Certificate Revocation
SCEP does not specify a method to request certificate revocation. In
order to revoke a certificate, the client must contact the CA using a
non-SCEP defined mechanism.
2.8. Mandatory-to-Implement Functionality
At a minimum, all SCEP implementations compliant with this
specification MUST support GetCACaps (Section 3.5.1), GetCACert
(Section 4.2), PKCSReq (Section 3.3.1) (and its associated response
messages), communication of binary data via HTTP POST (Section 4.1),
and the AES and SHA-256 algorithms to secure pkiMessages
(Section 3.2).
For historical reasons implementations MAY support communications of
binary data via HTTP GET (Section 4.1), and the triple DES and SHA-1
algorithms to secure pkiMessages (Section 3.2). Implementations
SHOULD NOT support the obsolete and/or insecure single DES and MD5
algorithms used in earlier versions of this specification.
3. SCEP Secure Message Objects
CMS is a general enveloping mechanism that enables both signed and
encrypted transmission of arbitrary data. SCEP messages that require
confidentiality use two layers of CMS, as shown in Figure 2. By
applying both enveloping and signing transformations, the SCEP
message is protected both for the integrity of its end-to-end
transaction information and the confidentiality of its information
portion. Some messages do not require enveloping, in which case the
EnvelopedData in Figure 2 is omitted.
Gutmann Expires May 28, 2017 [Page 11]
Internet-Draft SCEP November 2016
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 2: CMS Layering
When a particular SCEP message carries data, this data is carried in
the messageData. CertRep messages will lack any signed content and
consist only of a pkcsPKIEnvelope (Section 3.2.2).
The remainder of this document will refer only to 'messageData', but
it is understood to always be encapsulated in the pkcsPKIEnvelope
(Section 3.2.2). The format of the data in the messageData is
defined by the messageType attribute (see Section 3.2) of the Signed-
Data. If there is no messageData to be transmitted, the entire
pkcsPKIEnvelope MUST be omitted.
Gutmann Expires May 28, 2017 [Page 12]
Internet-Draft SCEP November 2016
3.1. SCEP Message Object Processing
Creating a SCEP message consists of several stages. The content to
be conveyed (in other words the messageData) is first encrypted, and
the encrypted content is then signed.
The form of encryption to be applied depends on the capabilities of
the recipient's public key. If the key is encryption-capable (for
example RSA) then the messageData is encrypted using the recipient's
public key with the CMS KeyTransRecipientInfo mechanism. If the key
is not encryption-capable (for example ECDSA) then the messageData is
encrypted using the challengePassword with the CMS
PasswordRecipientInfo mechanism.
Once the messageData has been encrypted, it is signed with the
sender's public key. This completes the SCEP message that is then
sent to the recipient.
Note that some earlier implementations of this specification dealt
with non-encryption-capable keys by omitting the encryption stage,
based on the text in Section 3 that indicated that "the EnvelopedData
is omitted". This alternative processing mechanism SHOULD NOT be
used since it exposes the challengePassword used to authorise the
certificate issue.
3.2. SCEP pkiMessage
The basic building block of all secured SCEP messages is the SCEP
pkiMessage. It consists of a CMS Signed-Data content type. The
following restrictions apply:
o The eContentType in encapsulatedContentInfo MUST be data ({pkcs-7
1}).
o The signed content, if present (FAILURE and PENDING CertRep
messages will lack any signed content), MUST be a pkcsPKIEnvelope
(Section 3.2.2), and MUST match the messageType attribute.
o The SignerInfo MUST contain a set of authenticatedAttributes
(Section 3.2.1).
3.2.1. Signed Transaction Attributes
At a minimum, all messages MUST contain the following
authenticatedAttributes:
o A transactionID attribute (see Section 3.2.1.1).
o A messageType attribute (see Section 3.2.1.2).
o A fresh senderNonce attribute (see Section 3.2.1.5).
o Any attributes required by CMS.
Gutmann Expires May 28, 2017 [Page 13]
Internet-Draft SCEP November 2016
If the message is a CertRep, it MUST also include the following
authenticatedAttributes:
o A pkiStatus attribute (see Section 3.2.1.3).
o A failInfo attribute (see Section 3.2.1.4) if pkiStatus = FAILURE.
o A recipientNonce attribute (see Section 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
attributes, and are carried in the SignerInfo for this Signed-Data.
+----------------+-----------------+--------------------------------+
| Attribute | Encoding | Comment |
+----------------+-----------------+--------------------------------+
| transactionID | PrintableString | Unique ID for this transaction |
| | | as a text string |
| | | |
| messageType | PrintableString | Decimal value as a numeric |
| | | text string |
| | | |
| pkiStatus | PrintableString | Decimal value as a numeric |
| | | text string |
| | | |
| failInfo | PrintableString | Decimal value as a numeric |
| | | text string |
| | | |
| senderNonce | OCTET STRING | Random nonce as a 16-byte |
| | | binary data string |
| | | |
| recipientNonce | OCTET STRING | Random nonce as a 16-byte |
| | | binary data string |
+----------------+-----------------+--------------------------------+
Gutmann Expires May 28, 2017 [Page 14]
Internet-Draft SCEP November 2016
The OIDs used for these attributes are as follows:
+-------------------+-----------------------------------------------+
| Name | ASN.1 Definition |
+-------------------+-----------------------------------------------+
| id-VeriSign | OBJECT_IDENTIFIER ::= {2 16 US(840) 1 |
| | VeriSign(113733)} |
| | |
| id-pki | OBJECT_IDENTIFIER ::= {id-VeriSign pki(1)} |
| | |
| id-attributes | OBJECT_IDENTIFIER ::= {id-pki attributes(9)} |
| | |
| id-transactionID | OBJECT_IDENTIFIER ::= {id-attributes |
| | transactionID(7)} |
| | |
| id-messageType | OBJECT_IDENTIFIER ::= {id-attributes |
| | messageType(2)} |
| | |
| id-pkiStatus | OBJECT_IDENTIFIER ::= {id-attributes |
| | pkiStatus(3)} |
| | |
| id-failInfo | OBJECT_IDENTIFIER ::= {id-attributes |
| | failInfo(4)} |
| | |
| id-senderNonce | OBJECT_IDENTIFIER ::= {id-attributes |
| | senderNonce(5)} |
| | |
| id-recipientNonce | OBJECT_IDENTIFIER ::= {id-attributes |
| | recipientNonce(6)} |
+-------------------+-----------------------------------------------+
The attributes are detailed in the following sections.
3.2.1.1. transactionID
A PKI operation is a transaction consisting of the messages exchanged
between a client and the CA. The transactionID is a text string
generated by the client when starting a transaction. The client MUST
generate a unique string as the transaction identifier, encoded as a
PrintableString, which MUST be used for all PKI messages exchanged
for a given operation such as a certificate issue.
3.2.1.2. messageType
The messageType attribute specifies the type of operation performed
by the transaction. This attribute MUST be included in all PKI
messages. The following message types are defined:
Gutmann Expires May 28, 2017 [Page 15]
Internet-Draft SCEP November 2016
o CertRep ("3") -- Response to certificate or CRL request.
o RenewalReq ("17") -- PKCS #10 certificate request for renewal of
an existing certificate.
o UpdateReq ("18") -- PKCS #10 certificate request for update of a
certificate issued by a different CA.
o PKCSReq ("19") -- PKCS #10 certificate request.
o CertPoll ("20") -- Certificate polling in manual enrolment.
o GetCert ("21") -- Retrieve a certificate.
o GetCRL ("22") -- Retrieve a CRL.
Undefined message types MUST BE treated as an error.
3.2.1.3. pkiStatus
All response messages MUST include transaction status information,
which is defined as a pkiStatus attribute:
o SUCCESS ("0") -- Request granted.
o FAILURE ("2") -- Request rejected. In this case the failInfo
attribute, as defined in Section 3.2.1.4, MUST also be present.
o PENDING ("3") -- Request pending for manual approval.
Undefined pkiStatus attributes MUST be treated as an error.
3.2.1.4. failInfo
The failInfo attribute MUST contain one of the following failure
reasons:
o badAlg ("0") -- Unrecognized or unsupported algorithm.
o badMessageCheck ("1") -- Integrity check (meaning signature
verification of the CMS message) failed.
o badRequest ("2") -- Transaction not permitted or supported.
o badTime ("3") -- The signingTime attribute from the CMS
authenticatedAttributes was not sufficiently close to the system
time (this failure code is present for legacy reasons and is
unlikely to be encountered in practice).
o badCertId ("4") -- No certificate could be identified matching the
provided criteria.
[Question: Is there any demand for a free-form UTF8String
attribute to explain what really went wrong? Trying to sort
out an error when all you ever get back is the near-universal
badRequest is almost impossible, adding a failInfoText
attribute to address this could be quite useful since it
would allow expressing information such as a failure to meet
CA policy, or indeed anything more complex than "no go away"].
Gutmann Expires May 28, 2017 [Page 16]
Internet-Draft SCEP November 2016
Undefined failInfo attributes are treated as an error.
3.2.1.5. senderNonce and recipientNonce
The senderNonce and recipientNonce attributes are a 16 byte random
number generated for each transaction. These are intended to prevent
replay attacks.
When a sender sends a PKI message to a recipient, a fresh senderNonce
MUST be included in the message. The recipient MUST copy the
senderNonce into the recipientNonce of the reply as a proof of
liveliness. The original sender MUST verify that the recipientNonce
of the reply matches the senderNonce it sent in the request. If the
nonce does not match, the message MUST be rejected.
Note that since SCEP exchanges consist of a single request followed
by a single 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 the same nonce in its reply. In effect there's just a
single nonce, identified as senderNonce 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
EnvelopedData content type, as defined in CMS, with the following
restrictions:
o contentType in encryptedContentInfo MUST be data ({pkcs-7 1}).
o encryptedContent MUST be the SCEP message being transported (see
Section 4), and must 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 message MUST be specified in the 'messageType'
authenticated Attribute. Each section defines a valid message type,
the corresponding messageData formats, and mandatory authenticated
attributes for that type.
3.3.1. PKCSReq/RenewalReq/UpdateReq
The messageData for this type consists of a PKCS #10 Certificate
Request. The certificate request MUST contain at least the following
items:
o The subject Distinguished Name.
Gutmann Expires May 28, 2017 [Page 17]
Internet-Draft SCEP November 2016
o The subject public key.
o For a PKCSReq and if authorisation based on a password is being
used, a challengePassword attribute.
In addition to the authenticatedAttributes required for a valid CMS
message, the pkiMessage MUST include the following attributes:
o A transactionID attribute (Section 3.2.1.1).
o A messageType attribute (Section 3.2.1.2) set to PKCSReq,
RenewalReq, or UpdateReq as appropriate.
o A fresh senderNonce attribute (Section 3.2.1.5).
3.3.2. CertRep
The messageData for this type consists of a degenerate certificates-
only CMS Signed-Data message (Section 3.4). The exact content
required for the reply depends on the type of request that this
message is a response to. The request types are detailed in
Section 3.3.2.1 and in Section 4.
In addition to the authenticatedAttributes required for a valid CMS
message, this pkiMessage MUST include the following attributes:
o The transactionID attribute (Section 3.2.1.1) copied from the
request that this is a response to.
o A messageType attribute (Section 3.2.1.2) set to CertRep.
o A recipientNonce attribute (Section 3.2.1.5) copied from the
senderNonce in the request that this is a response to.
o A pkiStatus attribute (Section 3.2.1.3) set to the status of the
reply.
Earlier versions of this specification required that this message
include a senderNonce alongside the recipientNonce, which was to be
used to chain to subsequent polling operations. However if a single
message was lost during the potentially extended interval over which
polling could take place (see Section 5 for an example of this) then
if the implementation were to enforce this requirement the overall
transaction would fail even though nothing had actually gone wrong.
Because of this issue, implementations mostly ignored the requirement
to carry this nonce over to subsequent polling messages or to verify
its presence. Current versions of the specification no longer
require the chaining of nonces across polling operations.
3.3.2.1. CertRep SUCCESS