diff options
Diffstat (limited to 'src/lib/libssl/tls13_lib.c')
-rw-r--r-- | src/lib/libssl/tls13_lib.c | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c index bdf547c8d9..044a0c5634 100644 --- a/src/lib/libssl/tls13_lib.c +++ b/src/lib/libssl/tls13_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_lib.c,v 1.34 2020/02/15 14:40:38 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_lib.c,v 1.35 2020/04/21 16:55:17 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> |
@@ -24,12 +24,45 @@ | |||
24 | #include "tls13_internal.h" | 24 | #include "tls13_internal.h" |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * RFC 8446 section 4.1.3, magic values which must be set by the | 27 | * Downgrade sentinels - RFC 8446 section 4.1.3, magic values which must be set |
28 | * server in server random if it is willing to downgrade but supports | 28 | * by the server in server random if it is willing to downgrade but supports |
29 | * tls v1.3 | 29 | * TLSv1.3 |
30 | */ | 30 | */ |
31 | uint8_t tls13_downgrade_12[8] = {0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x01}; | 31 | const uint8_t tls13_downgrade_12[8] = { |
32 | uint8_t tls13_downgrade_11[8] = {0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x00}; | 32 | 0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x01, |
33 | }; | ||
34 | const uint8_t tls13_downgrade_11[8] = { | ||
35 | 0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x00, | ||
36 | }; | ||
37 | |||
38 | /* | ||
39 | * HelloRetryRequest hash - RFC 8446 section 4.1.3. | ||
40 | */ | ||
41 | const uint8_t tls13_hello_retry_request_hash[32] = { | ||
42 | 0xcf, 0x21, 0xad, 0x74, 0xe5, 0x9a, 0x61, 0x11, | ||
43 | 0xbe, 0x1d, 0x8c, 0x02, 0x1e, 0x65, 0xb8, 0x91, | ||
44 | 0xc2, 0xa2, 0x11, 0x16, 0x7a, 0xbb, 0x8c, 0x5e, | ||
45 | 0x07, 0x9e, 0x09, 0xe2, 0xc8, 0xa8, 0x33, 0x9c, | ||
46 | }; | ||
47 | |||
48 | /* | ||
49 | * Certificate Verify padding - RFC 8446 section 4.4.3. | ||
50 | */ | ||
51 | const uint8_t tls13_cert_verify_pad[64] = { | ||
52 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
53 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
54 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
55 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
56 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
57 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
58 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
59 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
60 | }; | ||
61 | |||
62 | const uint8_t tls13_cert_client_verify_context[] = | ||
63 | "TLS 1.3, client CertificateVerify"; | ||
64 | const uint8_t tls13_cert_server_verify_context[] = | ||
65 | "TLS 1.3, server CertificateVerify"; | ||
33 | 66 | ||
34 | const EVP_AEAD * | 67 | const EVP_AEAD * |
35 | tls13_cipher_aead(const SSL_CIPHER *cipher) | 68 | tls13_cipher_aead(const SSL_CIPHER *cipher) |
@@ -311,23 +344,6 @@ tls13_ctx_free(struct tls13_ctx *ctx) | |||
311 | freezero(ctx, sizeof(struct tls13_ctx)); | 344 | freezero(ctx, sizeof(struct tls13_ctx)); |
312 | } | 345 | } |
313 | 346 | ||
314 | /* | ||
315 | * Certificate Verify padding - RFC 8446 section 4.4.3. | ||
316 | */ | ||
317 | uint8_t tls13_cert_verify_pad[64] = { | ||
318 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
319 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
320 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
321 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
322 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
323 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
324 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
325 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | ||
326 | }; | ||
327 | |||
328 | uint8_t tls13_cert_client_verify_context[] = "TLS 1.3, client CertificateVerify"; | ||
329 | uint8_t tls13_cert_server_verify_context[] = "TLS 1.3, server CertificateVerify"; | ||
330 | |||
331 | int | 347 | int |
332 | tls13_cert_add(CBB *cbb, X509 *cert) | 348 | tls13_cert_add(CBB *cbb, X509 *cert) |
333 | { | 349 | { |