Skip to content

Commit f8462e1

Browse files
committed
ci: add duvet config
1 parent efb3500 commit f8462e1

File tree

361 files changed

+18977
-15781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+18977
-15781
lines changed

.duvet/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
reports/

.duvet/config.toml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"
2+
3+
[[source]]
4+
pattern = "api/**/*.[ch]"
5+
comment-style = { meta = "*=", content = "*#" }
6+
7+
[[source]]
8+
pattern = "bin/**/*.[ch]"
9+
comment-style = { meta = "*=", content = "*#" }
10+
11+
[[source]]
12+
pattern = "crypto/**/*.[ch]"
13+
comment-style = { meta = "*=", content = "*#" }
14+
15+
[[source]]
16+
pattern = "error/**/*.[ch]"
17+
comment-style = { meta = "*=", content = "*#" }
18+
19+
[[source]]
20+
pattern = "stuffer/**/*.[ch]"
21+
comment-style = { meta = "*=", content = "*#" }
22+
23+
[[source]]
24+
pattern = "tests/**/*.[ch]"
25+
comment-style = { meta = "*=", content = "*#" }
26+
27+
[[source]]
28+
pattern = "tls/**/*.[ch]"
29+
comment-style = { meta = "*=", content = "*#" }
30+
31+
[[source]]
32+
pattern = "utils/**/*.[ch]"
33+
comment-style = { meta = "*=", content = "*#" }
34+
35+
# The Transport Layer Security (TLS) Protocol Version 1.2
36+
[[specification]]
37+
source = "https://www.rfc-editor.org/rfc/rfc5246"
38+
39+
# HMAC-based Extract-and-Expand Key Derivation Function (HKDF)
40+
[[specification]]
41+
source = "https://www.rfc-editor.org/rfc/rfc5869"
42+
43+
# The Transport Layer Security (TLS) Protocol Version 1.3
44+
[[specification]]
45+
source = "https://www.rfc-editor.org/rfc/rfc8446"
46+
47+
# Example Handshake Traces for TLS 1.3
48+
[[specification]]
49+
source = "https://www.rfc-editor.org/rfc/rfc8448"
50+
51+
# Transport Layer Security (TLS) Session Hash and Extended Master Secret Extension
52+
[[specification]]
53+
source = "https://www.rfc-editor.org/rfc/rfc7627"
54+
55+
# Transport Layer Security (TLS) Renegotiation Indication Extension
56+
[[specification]]
57+
source = "https://www.rfc-editor.org/rfc/rfc5746"
58+
59+
# Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS)
60+
[[specification]]
61+
source = "https://www.rfc-editor.org/rfc/rfc4492"
62+
63+
# # Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS) Versions 1.2 and Earlier
64+
[[specification]]
65+
source = "https://www.rfc-editor.org/rfc/rfc8422"
66+
67+
[report.html]
68+
enabled = true
69+
issue-link = "https://github.com/aws/s2n-tls/issues"
70+
blob-link = "https://github.com/aws/s2n-tls/blob/${{ BLOB || GITHUB_SHA || 'main' }}"
71+
72+
# Enable snapshots to prevent requirement coverage regressions
73+
[report.snapshot]
74+
enabled = true
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
target = "https://www.rfc-editor.org/rfc/rfc4492#section-2.1"
2+
3+
# ECDH_ECDSA
4+
#
5+
# In ECDH_ECDSA, the server's certificate MUST contain an ECDH-capable
6+
# public key and be signed with ECDSA.
7+
#
8+
# A ServerKeyExchange MUST NOT be sent (the server's certificate
9+
# contains all the necessary keying information required by the client
10+
# to arrive at the premaster secret).
11+
#
12+
# The client generates an ECDH key pair on the same curve as the
13+
# server's long-term public key and sends its public key in the
14+
# ClientKeyExchange message (except when using client authentication
15+
# algorithm ECDSA_fixed_ECDH or RSA_fixed_ECDH, in which case the
16+
# modifications from Section 3.2 or Section 3.3 apply).
17+
#
18+
# Both client and server perform an ECDH operation and use the
19+
# resultant shared secret as the premaster secret. All ECDH
20+
# calculations are performed as specified in Section 5.10.
21+
22+
[[spec]]
23+
level = "MUST"
24+
quote = '''
25+
In ECDH_ECDSA, the server's certificate MUST contain an ECDH-capable
26+
public key and be signed with ECDSA.
27+
'''
28+
29+
[[spec]]
30+
level = "MUST"
31+
quote = '''
32+
A ServerKeyExchange MUST NOT be sent (the server's certificate
33+
contains all the necessary keying information required by the client
34+
to arrive at the premaster secret).
35+
'''
36+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
target = "https://www.rfc-editor.org/rfc/rfc4492#section-2.2"
2+
3+
# ECDHE_ECDSA
4+
#
5+
# In ECDHE_ECDSA, the server's certificate MUST contain an ECDSA-
6+
# capable public key and be signed with ECDSA.
7+
#
8+
# The server sends its ephemeral ECDH public key and a specification of
9+
# the corresponding curve in the ServerKeyExchange message. These
10+
# parameters MUST be signed with ECDSA using the private key
11+
# corresponding to the public key in the server's Certificate.
12+
#
13+
# The client generates an ECDH key pair on the same curve as the
14+
# server's ephemeral ECDH key and sends its public key in the
15+
# ClientKeyExchange message.
16+
#
17+
# Both client and server perform an ECDH operation (Section 5.10) and
18+
# use the resultant shared secret as the premaster secret.
19+
20+
[[spec]]
21+
level = "MUST"
22+
quote = '''
23+
In ECDHE_ECDSA, the server's certificate MUST contain an ECDSA-
24+
capable public key and be signed with ECDSA.
25+
'''
26+
27+
[[spec]]
28+
level = "MUST"
29+
quote = '''
30+
These
31+
parameters MUST be signed with ECDSA using the private key
32+
corresponding to the public key in the server's Certificate.
33+
'''
34+

compliance/specs/www.rfc-editor.org/rfc/rfc4492/section-2.3.toml .duvet/requirements/www.rfc-editor.org/rfc/rfc4492/section-2.3.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
target = "https://www.rfc-editor.org/rfc/rfc4492#section-2.3"
22

3-
# 2.3. ECDH_RSA
3+
# ECDH_RSA
44
#
5-
# This key exchange algorithm is the same as ECDH_ECDSA except that the
6-
# server's certificate MUST be signed with RSA rather than ECDSA.
5+
# This key exchange algorithm is the same as ECDH_ECDSA except that the
6+
# server's certificate MUST be signed with RSA rather than ECDSA.
77

88
[[spec]]
99
level = "MUST"

compliance/specs/www.rfc-editor.org/rfc/rfc4492/section-2.4.toml .duvet/requirements/www.rfc-editor.org/rfc/rfc4492/section-2.4.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
target = "https://www.rfc-editor.org/rfc/rfc4492#section-2.4"
22

3-
# 2.4. ECDHE_RSA
3+
# ECDHE_RSA
44
#
5-
# This key exchange algorithm is the same as ECDHE_ECDSA except that
6-
# the server's certificate MUST contain an RSA public key authorized
7-
# for signing, and that the signature in the ServerKeyExchange message
8-
# must be computed with the corresponding RSA private key. The server
9-
# certificate MUST be signed with RSA.
5+
# This key exchange algorithm is the same as ECDHE_ECDSA except that
6+
# the server's certificate MUST contain an RSA public key authorized
7+
# for signing, and that the signature in the ServerKeyExchange message
8+
# must be computed with the corresponding RSA private key. The server
9+
# certificate MUST be signed with RSA.
1010

1111
[[spec]]
1212
level = "MUST"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
target = "https://www.rfc-editor.org/rfc/rfc4492#section-2.5"
2+
3+
# ECDH_anon
4+
#
5+
# In ECDH_anon, the server's Certificate, the CertificateRequest, the
6+
# client's Certificate, and the CertificateVerify messages MUST NOT be
7+
# sent.
8+
#
9+
# The server MUST send an ephemeral ECDH public key and a specification
10+
# of the corresponding curve in the ServerKeyExchange message. These
11+
# parameters MUST NOT be signed.
12+
#
13+
# The client generates an ECDH key pair on the same curve as the
14+
# server's ephemeral ECDH key and sends its public key in the
15+
# ClientKeyExchange message.
16+
#
17+
# Both client and server perform an ECDH operation and use the
18+
# resultant shared secret as the premaster secret. All ECDH
19+
# calculations are performed as specified in Section 5.10.
20+
#
21+
# Note that while the ECDH_ECDSA, ECDHE_ECDSA, ECDH_RSA, and ECDHE_RSA
22+
# key exchange algorithms require the server's certificate to be signed
23+
# with a particular signature scheme, this specification (following the
24+
# similar cases of DH_DSS, DHE_DSS, DH_RSA, and DHE_RSA in [2] and [3])
25+
# does not impose restrictions on signature schemes used elsewhere in
26+
# the certificate chain. (Often such restrictions will be useful, and
27+
# it is expected that this will be taken into account in certification
28+
# authorities' signing practices. However, such restrictions are not
29+
# strictly required in general: Even if it is beyond the capabilities
30+
# of a client to completely validate a given chain, the client may be
31+
# able to validate the server's certificate by relying on a trusted
32+
# certification authority whose certificate appears as one of the
33+
# intermediate certificates in the chain.)
34+
35+
[[spec]]
36+
level = "MUST"
37+
quote = '''
38+
In ECDH_anon, the server's Certificate, the CertificateRequest, the
39+
client's Certificate, and the CertificateVerify messages MUST NOT be
40+
sent.
41+
'''
42+
43+
[[spec]]
44+
level = "MUST"
45+
quote = '''
46+
The server MUST send an ephemeral ECDH public key and a specification
47+
of the corresponding curve in the ServerKeyExchange message.
48+
'''
49+
50+
[[spec]]
51+
level = "MUST"
52+
quote = '''
53+
These
54+
parameters MUST NOT be signed.
55+
'''
56+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
target = "https://www.rfc-editor.org/rfc/rfc4492#section-2"
2+
3+
# Key Exchange Algorithms
4+
#
5+
# This document introduces five new ECC-based key exchange algorithms
6+
# for TLS. All of them use ECDH to compute the TLS premaster secret,
7+
# and they differ only in the lifetime of ECDH keys (long-term or
8+
# ephemeral) and the mechanism (if any) used to authenticate them. The
9+
# derivation of the TLS master secret from the premaster secret and the
10+
# subsequent generation of bulk encryption/MAC keys and initialization
11+
# vectors is independent of the key exchange algorithm and not impacted
12+
# by the introduction of ECC.
13+
#
14+
# The table below summarizes the new key exchange algorithms, which
15+
# mimic DH_DSS, DHE_DSS, DH_RSA, DHE_RSA, and DH_anon (see [2] and
16+
# [3]), respectively.
17+
#
18+
# Key
19+
# Exchange
20+
# Algorithm Description
21+
# --------- -----------
22+
#
23+
# ECDH_ECDSA Fixed ECDH with ECDSA-signed certificates.
24+
#
25+
# ECDHE_ECDSA Ephemeral ECDH with ECDSA signatures.
26+
#
27+
# ECDH_RSA Fixed ECDH with RSA-signed certificates.
28+
#
29+
# ECDHE_RSA Ephemeral ECDH with RSA signatures.
30+
#
31+
# ECDH_anon Anonymous ECDH, no signatures.
32+
#
33+
# Table 2: ECC Key Exchange Algorithms
34+
#
35+
# The ECDHE_ECDSA and ECDHE_RSA key exchange mechanisms provide forward
36+
# secrecy. With ECDHE_RSA, a server can reuse its existing RSA
37+
# certificate and easily comply with a constrained client's elliptic
38+
# curve preferences (see Section 4). However, the computational cost
39+
#
40+
# incurred by a server is higher for ECDHE_RSA than for the traditional
41+
# RSA key exchange, which does not provide forward secrecy.
42+
#
43+
# The ECDH_RSA mechanism requires a server to acquire an ECC
44+
# certificate, but the certificate issuer can still use an existing RSA
45+
# key for signing. This eliminates the need to update the keys of
46+
# trusted certification authorities accepted by TLS clients. The
47+
# ECDH_ECDSA mechanism requires ECC keys for the server as well as the
48+
# certification authority and is best suited for constrained devices
49+
# unable to support RSA.
50+
#
51+
# The anonymous key exchange algorithm does not provide authentication
52+
# of the server or the client. Like other anonymous TLS key exchanges,
53+
# it is subject to man-in-the-middle attacks. Implementations of this
54+
# algorithm SHOULD provide authentication by other means.
55+
#
56+
# Note that there is no structural difference between ECDH and ECDSA
57+
# keys. A certificate issuer may use X.509 v3 keyUsage and
58+
# extendedKeyUsage extensions to restrict the use of an ECC public key
59+
# to certain computations [15]. This document refers to an ECC key as
60+
# ECDH-capable if its use in ECDH is permitted. ECDSA-capable is
61+
# defined similarly.
62+
#
63+
# Client Server
64+
# ------ ------
65+
#
66+
# ClientHello -------->
67+
# ServerHello
68+
# Certificate*
69+
# ServerKeyExchange*
70+
# CertificateRequest*+
71+
# <-------- ServerHelloDone
72+
# Certificate*+
73+
# ClientKeyExchange
74+
# CertificateVerify*+
75+
# [ChangeCipherSpec]
76+
# Finished -------->
77+
# [ChangeCipherSpec]
78+
# <-------- Finished
79+
#
80+
# Application Data <-------> Application Data
81+
#
82+
# * message is not sent under some conditions
83+
# + message is not sent unless client authentication
84+
# is desired
85+
#
86+
# Figure 1: Message flow in a full TLS handshake
87+
#
88+
# Figure 1 shows all messages involved in the TLS key establishment
89+
# protocol (aka full handshake). The addition of ECC has direct impact
90+
# only on the ClientHello, the ServerHello, the server's Certificate
91+
# message, the ServerKeyExchange, the ClientKeyExchange, the
92+
# CertificateRequest, the client's Certificate message, and the
93+
# CertificateVerify. Next, we describe each ECC key exchange algorithm
94+
# in greater detail in terms of the content and processing of these
95+
# messages. For ease of exposition, we defer discussion of client
96+
# authentication and associated messages (identified with a + in
97+
# Figure 1) until Section 3 and of the optional ECC-specific extensions
98+
# (which impact the Hello messages) until Section 4.
99+
100+
[[spec]]
101+
level = "SHOULD"
102+
quote = '''
103+
Implementations of this
104+
algorithm SHOULD provide authentication by other means.
105+
'''
106+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
target = "https://www.rfc-editor.org/rfc/rfc4492#section-3.1"
2+
3+
# ECDSA_sign
4+
#
5+
# To use this authentication mechanism, the client MUST possess a
6+
# certificate containing an ECDSA-capable public key and signed with
7+
# ECDSA.
8+
#
9+
# The client proves possession of the private key corresponding to the
10+
# certified key by including a signature in the CertificateVerify
11+
# message as described in Section 5.8.
12+
13+
[[spec]]
14+
level = "MUST"
15+
quote = '''
16+
To use this authentication mechanism, the client MUST possess a
17+
certificate containing an ECDSA-capable public key and signed with
18+
ECDSA.
19+
'''
20+

0 commit comments

Comments
 (0)