aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog137
-rw-r--r--README.md2
-rw-r--r--appveyor.yml12
-rw-r--r--crypto/CMakeLists.txt1
-rw-r--r--m4/ax_add_fortify_source.m480
-rw-r--r--m4/ax_check_compile_flag.m453
-rw-r--r--m4/check-hardening-options.m42
-rw-r--r--man/links40
-rw-r--r--patches/aeadtest.c.patch10
-rw-r--r--patches/handshake_table.c.patch8
-rw-r--r--patches/openssl.c.patch6
-rw-r--r--patches/tlsexttest.c.patch16
-rw-r--r--ssl/CMakeLists.txt1
-rw-r--r--ssl/Makefile.am1
-rw-r--r--tests/testssl.bat16
15 files changed, 355 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index cba5873..8a70b14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,9 +30,110 @@ LibreSSL Portable Release Notes:
30 30
313.2.1 - Development release 313.2.1 - Development release
32 32
33 * Enforce in the TLS 1.3 server that ClientHello messages 33 * Propagate alerts from the read half of the TLSv1.3 record layer to I/O
34 following a HelloRetryRequest must match the original ClientHello 34 functions.
35 as per RFC 8446 section 4.1.2 35
36 * Send a record overflow alert for TLSv1.3 messages having overlong
37 plaintext or inner plaintext.
38
39 * Send an illegal parameter alert if a client sends an invalid DH key
40 share.
41
42 * Document PKCS7_final(3), PKCS7_add_attribute(3).
43
44 * Collapse x509v3 directory into x509.
45
46 * Improve TLSv1.3 client certificate selection to allow EC certificates
47 instead of only RSA certificates.
48
49 * Fail on receiving an invalid NID in X509_ATTRIBUTE_create() instead
50 of constructing a broken objects that may cause NULL pointer accesses.
51
52 * Add support for additional GOST curves from RFC 7836 and
53 draft-deremin-rfc4491-bis.
54
55 * Add OIDs for HMAC using the Streebog hash function.
56
57 * Allow GOST R 34.11-2012 in PBE/PBKDF2/PKCS#5.
58
59 * Enable GOST_SIG_FORMAT_RS_LE when verifying certificate signatures.
60
61 * Handle GOST in ssl_cert_dup().
62
63 * Stop sending GOST R 34.10-94 as a CertificateType.
64
65 * Use IANA allocated GOST ClientCertificateTypes.
66
67 * Add a custom copy handler for AES keywrap to fix a use-after-free.
68
69 * Enforce in the TLSv1.3 server that that ClientHello messages after
70 a HelloRetryRequest match the original ClientHello as per RFC 8446
71 section 4.1.2
72
73 * Document more PKCS7 attribute functions.
74
75 * Document PKCS7_get_signer_info(3).
76
77 * Document PEM_ASN1_read(3) and PEM_ASN1_read_bio(3).
78
79 * Document PEM_def_callback(3).
80
81 * Document EVP_read_pw_string_min(3).
82
83 * Merge documentation of X509_get0_serialNumber from OpenSSL 1.1.1.
84
85 * Document error handling of X509_PUBKEY_get0(3) and X509_PUBKEY_get(3)
86
87 * Document X509_get0_pubkey_bitstr(3).
88
89 * Fix an off-by-one in the CBS padding removal. From BoringSSL.
90
91 * Enforce restrictions on extensions present in the ClientHello as per
92 RFC 8446, section 9.2.
93
94 * Add new CMAC_Init(3) and ChaCha(3) manual pages.
95
96 * Fix SSL_shutdown behavior to match the legacy stack. The previous
97 behavior could cause a hang.
98
99 * Add initial support for openbsd/powerpc64.
100
101 * Make the message type available in the internal TLS extensions API
102 functions.
103
104 * Enable TLSv1.3 for the generic TLS_method().
105
106 * Convert openssl(1) s_client option handling.
107
108 * Document openssl(1) certhash.
109
110 * Convert openssl(1) verify option handling.
111
112 * Fix a longstanding bug in PEM_X509_INFO_read_bio(3) that could cause
113 use-after-free and double-free issues in calling programs.
114
115 * Document PEM_X509_INFO_read(3) and PEM_X509_INFO_read_bio(3).
116
117 * Handle SSL_MODE_AUTO_RETRY being changed during a TLSv1.3 session.
118
119 * Convert openssl(1) s_server option handling.
120
121 * Add minimal info callback support for TLSv1.3.
122
123 * Refactor, clean up and simplify some SSL3/DTLS1 record writing code.
124
125 * Correctly handle server requests for an OCSP response.
126
127 * Add the P-521 curve to the list of curves supported by default
128 in the client.
129
130 * Convert openssl(1) req option handling.
131
132 * Avoid calling freezero with a negative size if a server sends a
133 malformed plaintext of all zeroes.
134
135 * Send an unexpected message alert if no valid content type is found
136 in a TLSv1.3 record.
36 137
373.2.0 - Development release 1383.2.0 - Development release
38 139
@@ -96,6 +197,36 @@ LibreSSL Portable Release Notes:
96 197
97 * Use non-expired certificates first when building a certificate chain. 198 * Use non-expired certificates first when building a certificate chain.
98 199
2003.1.4 - Interoperability and bug fixes for the TLSv1.3 client:
201
202 * Improve client certificate selection to allow EC certificates
203 instead of only RSA certificates.
204
205 * Do not error out if a TLSv1.3 server requests an OCSP response as
206 part of a certificate request.
207
208 * Fix SSL_shutdown behavior to match the legacy stack. The previous
209 behaviour could cause a hang.
210
211 * Fix a memory leak and add a missing error check in the handling of
212 the key update message.
213
214 * Fix a memory leak in tls13_record_layer_set_traffic_key.
215
216 * Avoid calling freezero with a negative size if a server sends a
217 malformed plaintext of all zeroes.
218
219 * Ensure that only PSS may be used with RSA in TLSv1.3 in order
220 to avoid using PKCS1-based signatures.
221
222 * Add the P-521 curve to the list of curves supported by default
223 in the client.
224
2253.1.3 - Bug fix
226
227 * libcrypto may fail to build a valid certificate chain due to
228 expired untrusted issuer certificates.
229
993.1.2 - Bug fix 2303.1.2 - Bug fix
100 231
101 * A TLS client with peer verification disabled may crash when 232 * A TLS client with peer verification disabled may crash when
diff --git a/README.md b/README.md
index a4341b0..f978bb4 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ the LibreSSL portable project attempts to provide working alternatives for
26other operating systems, and assists with improving OS-native implementations 26other operating systems, and assists with improving OS-native implementations
27where possible. 27where possible.
28 28
29At the time of this writing, LibreSSL is know to build and work on: 29At the time of this writing, LibreSSL is known to build and work on:
30 30
31* Linux (kernel 3.17 or later recommended) 31* Linux (kernel 3.17 or later recommended)
32* FreeBSD (tested with 9.2 and later) 32* FreeBSD (tested with 9.2 and later)
diff --git a/appveyor.yml b/appveyor.yml
index 4e0b488..df1b448 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -43,5 +43,13 @@ build_script:
43 - cmake --build . --config %CONFIG% 43 - cmake --build . --config %CONFIG%
44 44
45test_script: 45test_script:
46 # TODO: Determine how to run ssltest on AppVeyor 46 - ctest -C %CONFIG% --timeout 150 --output-on-failure
47 - ctest -C %CONFIG% --timeout 150 --output-on-failure -E ssltest 47
48on_failure:
49 - 7z a Testing.zip Testing
50 - appveyor PushArtifact Testing.zip
51
52artifacts:
53 - path: build\Testing
54 name: Testing
55 type: zip
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 4c5a143..e57e6c2 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -394,7 +394,6 @@ set(
394 cms/cms_ess.c 394 cms/cms_ess.c
395 cms/cms_io.c 395 cms/cms_io.c
396 cms/cms_kari.c 396 cms/cms_kari.c
397 cms/cms_lcl.h
398 cms/cms_lib.c 397 cms/cms_lib.c
399 cms/cms_pwri.c 398 cms/cms_pwri.c
400 cms/cms_sd.c 399 cms/cms_sd.c
diff --git a/m4/ax_add_fortify_source.m4 b/m4/ax_add_fortify_source.m4
new file mode 100644
index 0000000..7e15312
--- /dev/null
+++ b/m4/ax_add_fortify_source.m4
@@ -0,0 +1,80 @@
1# ===========================================================================
2# https://www.gnu.org/software/autoconf-archive/ax_add_fortify_source.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_ADD_FORTIFY_SOURCE
8#
9# DESCRIPTION
10#
11# Check whether -D_FORTIFY_SOURCE=2 can be added to CPPFLAGS without macro
12# redefinition warnings, other cpp warnings or linker. Some distributions
13# (such as Gentoo Linux) enable _FORTIFY_SOURCE globally in their
14# compilers, leading to unnecessary warnings in the form of
15#
16# <command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
17# <built-in>: note: this is the location of the previous definition
18#
19# which is a problem if -Werror is enabled. This macro checks whether
20# _FORTIFY_SOURCE is already defined, and if not, adds -D_FORTIFY_SOURCE=2
21# to CPPFLAGS.
22#
23# Newer mingw-w64 msys2 package comes with a bug in
24# headers-git-7.0.0.5546.d200317d-1. It broke -D_FORTIFY_SOURCE support,
25# and would need -lssp or -fstack-protector. See
26# https://github.com/msys2/MINGW-packages/issues/5803. Try to actually
27# link it.
28#
29# LICENSE
30#
31# Copyright (c) 2017 David Seifert <soap@gentoo.org>
32# Copyright (c) 2019 Reini Urban <rurban@cpan.org>
33#
34# Copying and distribution of this file, with or without modification, are
35# permitted in any medium without royalty provided the copyright notice
36# and this notice are preserved. This file is offered as-is, without any
37# warranty.
38
39#serial 4
40
41AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[
42 ac_save_cflags=$CFLAGS
43 ac_cwerror_flag=yes
44 AX_CHECK_COMPILE_FLAG([-Werror],[CFLAGS="$CFLAGS -Werror"])
45 AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS])
46 AC_LINK_IFELSE([
47 AC_LANG_PROGRAM([],
48 [[
49 #ifndef _FORTIFY_SOURCE
50 return 0;
51 #else
52 this_is_an_error;
53 #endif
54 ]]
55 )],
56 AC_LINK_IFELSE([
57 AC_LANG_SOURCE([[
58 #define _FORTIFY_SOURCE 2
59 #include <string.h>
60 int main() {
61 char *s = " ";
62 strcpy(s, "x");
63 return strlen(s)-1;
64 }
65 ]]
66 )],
67 [
68 AC_MSG_RESULT([yes])
69 CFLAGS=$ac_save_cflags
70 CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
71 ], [
72 AC_MSG_RESULT([no])
73 CFLAGS=$ac_save_cflags
74 ],
75 ),
76 [
77 AC_MSG_RESULT([no])
78 CFLAGS=$ac_save_cflags
79 ])
80])
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644
index 0000000..bd753b3
--- /dev/null
+++ b/m4/ax_check_compile_flag.m4
@@ -0,0 +1,53 @@
1# ===========================================================================
2# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
8#
9# DESCRIPTION
10#
11# Check whether the given FLAG works with the current language's compiler
12# or gives an error. (Warnings, however, are ignored)
13#
14# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
15# success/failure.
16#
17# If EXTRA-FLAGS is defined, it is added to the current language's default
18# flags (e.g. CFLAGS) when the check is done. The check is thus made with
19# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
20# force the compiler to issue an error when a bad flag is given.
21#
22# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
23#
24# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
25# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
26#
27# LICENSE
28#
29# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
30# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
31#
32# Copying and distribution of this file, with or without modification, are
33# permitted in any medium without royalty provided the copyright notice
34# and this notice are preserved. This file is offered as-is, without any
35# warranty.
36
37#serial 6
38
39AC_DEFUN([AX_CHECK_COMPILE_FLAG],
40[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
41AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
42AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
43 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
44 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
45 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
46 [AS_VAR_SET(CACHEVAR,[yes])],
47 [AS_VAR_SET(CACHEVAR,[no])])
48 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
49AS_VAR_IF(CACHEVAR,yes,
50 [m4_default([$2], :)],
51 [m4_default([$3], :)])
52AS_VAR_POPDEF([CACHEVAR])dnl
53])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/m4/check-hardening-options.m4 b/m4/check-hardening-options.m4
index 3ffdb1a..869f00b 100644
--- a/m4/check-hardening-options.m4
+++ b/m4/check-hardening-options.m4
@@ -73,7 +73,7 @@ AC_DEFUN([CHECK_C_HARDENING_OPTIONS], [
73 CHECK_CFLAG([[-fno-strict-overflow]]) 73 CHECK_CFLAG([[-fno-strict-overflow]])
74 74
75 # _FORTIFY_SOURCE replaces builtin functions with safer versions. 75 # _FORTIFY_SOURCE replaces builtin functions with safer versions.
76 CHECK_CFLAG([[-D_FORTIFY_SOURCE=2]]) 76 AX_ADD_FORTIFY_SOURCE
77 77
78 # Enable read only relocations 78 # Enable read only relocations
79 CHECK_LDFLAG([[-Wl,-z,relro]]) 79 CHECK_LDFLAG([[-Wl,-z,relro]])
diff --git a/man/links b/man/links
index 337d3d8..c01e8fa 100644
--- a/man/links
+++ b/man/links
@@ -374,6 +374,14 @@ BUF_MEM_new.3,BUF_MEM_grow.3
374BUF_MEM_new.3,BUF_MEM_grow_clean.3 374BUF_MEM_new.3,BUF_MEM_grow_clean.3
375BUF_MEM_new.3,BUF_reverse.3 375BUF_MEM_new.3,BUF_reverse.3
376BUF_MEM_new.3,BUF_strdup.3 376BUF_MEM_new.3,BUF_strdup.3
377CMAC_Init.3,CMAC_CTX_cleanup.3
378CMAC_Init.3,CMAC_CTX_copy.3
379CMAC_Init.3,CMAC_CTX_free.3
380CMAC_Init.3,CMAC_CTX_get0_cipher_ctx.3
381CMAC_Init.3,CMAC_CTX_new.3
382CMAC_Init.3,CMAC_Final.3
383CMAC_Init.3,CMAC_Update.3
384CMAC_Init.3,CMAC_resume.3
377CMS_ContentInfo_new.3,CMS_ContentInfo_free.3 385CMS_ContentInfo_new.3,CMS_ContentInfo_free.3
378CMS_ContentInfo_new.3,CMS_ContentInfo_print_ctx.3 386CMS_ContentInfo_new.3,CMS_ContentInfo_print_ctx.3
379CMS_ContentInfo_new.3,CMS_ReceiptRequest_free.3 387CMS_ContentInfo_new.3,CMS_ReceiptRequest_free.3
@@ -432,6 +440,11 @@ CRYPTO_set_ex_data.3,CRYPTO_free_ex_data.3
432CRYPTO_set_ex_data.3,CRYPTO_get_ex_data.3 440CRYPTO_set_ex_data.3,CRYPTO_get_ex_data.3
433CRYPTO_set_ex_data.3,CRYPTO_get_ex_new_index.3 441CRYPTO_set_ex_data.3,CRYPTO_get_ex_new_index.3
434CRYPTO_set_ex_data.3,CRYPTO_new_ex_data.3 442CRYPTO_set_ex_data.3,CRYPTO_new_ex_data.3
443ChaCha.3,CRYPTO_chacha_20.3
444ChaCha.3,CRYPTO_hchacha_20.3
445ChaCha.3,CRYPTO_xchacha_20.3
446ChaCha.3,ChaCha_set_iv.3
447ChaCha.3,ChaCha_set_key.3
435DES_set_key.3,DES_cbc_cksum.3 448DES_set_key.3,DES_cbc_cksum.3
436DES_set_key.3,DES_cfb64_encrypt.3 449DES_set_key.3,DES_cfb64_encrypt.3
437DES_set_key.3,DES_cfb_encrypt.3 450DES_set_key.3,DES_cfb_encrypt.3
@@ -1257,11 +1270,16 @@ OPENSSL_sk_new.3,sk_zero.3
1257OpenSSL_add_all_algorithms.3,EVP_cleanup.3 1270OpenSSL_add_all_algorithms.3,EVP_cleanup.3
1258OpenSSL_add_all_algorithms.3,OpenSSL_add_all_ciphers.3 1271OpenSSL_add_all_algorithms.3,OpenSSL_add_all_ciphers.3
1259OpenSSL_add_all_algorithms.3,OpenSSL_add_all_digests.3 1272OpenSSL_add_all_algorithms.3,OpenSSL_add_all_digests.3
1273PEM_ASN1_read.3,PEM_ASN1_read_bio.3
1274PEM_ASN1_read.3,d2i_of_void.3
1275PEM_X509_INFO_read.3,PEM_X509_INFO_read_bio.3
1276PEM_read.3,PEM_def_callback.3
1260PEM_read.3,PEM_do_header.3 1277PEM_read.3,PEM_do_header.3
1261PEM_read.3,PEM_get_EVP_CIPHER_INFO.3 1278PEM_read.3,PEM_get_EVP_CIPHER_INFO.3
1262PEM_read.3,PEM_read_bio.3 1279PEM_read.3,PEM_read_bio.3
1263PEM_read.3,PEM_write.3 1280PEM_read.3,PEM_write.3
1264PEM_read.3,PEM_write_bio.3 1281PEM_read.3,PEM_write_bio.3
1282PEM_read.3,pem_password_cb.3
1265PEM_read_SSL_SESSION.3,PEM_read_bio_SSL_SESSION.3 1283PEM_read_SSL_SESSION.3,PEM_read_bio_SSL_SESSION.3
1266PEM_read_SSL_SESSION.3,PEM_write_SSL_SESSION.3 1284PEM_read_SSL_SESSION.3,PEM_write_SSL_SESSION.3
1267PEM_read_SSL_SESSION.3,PEM_write_bio_SSL_SESSION.3 1285PEM_read_SSL_SESSION.3,PEM_write_bio_SSL_SESSION.3
@@ -1354,7 +1372,6 @@ PEM_read_bio_PrivateKey.3,PEM_write_bio_X509_AUX.3
1354PEM_read_bio_PrivateKey.3,PEM_write_bio_X509_CRL.3 1372PEM_read_bio_PrivateKey.3,PEM_write_bio_X509_CRL.3
1355PEM_read_bio_PrivateKey.3,PEM_write_bio_X509_REQ.3 1373PEM_read_bio_PrivateKey.3,PEM_write_bio_X509_REQ.3
1356PEM_read_bio_PrivateKey.3,PEM_write_bio_X509_REQ_NEW.3 1374PEM_read_bio_PrivateKey.3,PEM_write_bio_X509_REQ_NEW.3
1357PEM_read_bio_PrivateKey.3,pem_password_cb.3
1358PKCS12_SAFEBAG_new.3,PKCS12_BAGS_free.3 1375PKCS12_SAFEBAG_new.3,PKCS12_BAGS_free.3
1359PKCS12_SAFEBAG_new.3,PKCS12_BAGS_new.3 1376PKCS12_SAFEBAG_new.3,PKCS12_BAGS_new.3
1360PKCS12_SAFEBAG_new.3,PKCS12_SAFEBAG_free.3 1377PKCS12_SAFEBAG_new.3,PKCS12_SAFEBAG_free.3
@@ -1362,6 +1379,15 @@ PKCS12_new.3,PKCS12_MAC_DATA_free.3
1362PKCS12_new.3,PKCS12_MAC_DATA_new.3 1379PKCS12_new.3,PKCS12_MAC_DATA_new.3
1363PKCS12_new.3,PKCS12_free.3 1380PKCS12_new.3,PKCS12_free.3
1364PKCS5_PBKDF2_HMAC.3,PKCS5_PBKDF2_HMAC_SHA1.3 1381PKCS5_PBKDF2_HMAC.3,PKCS5_PBKDF2_HMAC_SHA1.3
1382PKCS7_add_attribute.3,PKCS7_add0_attrib_signing_time.3
1383PKCS7_add_attribute.3,PKCS7_add1_attrib_digest.3
1384PKCS7_add_attribute.3,PKCS7_add_attrib_content_type.3
1385PKCS7_add_attribute.3,PKCS7_add_attrib_smimecap.3
1386PKCS7_add_attribute.3,PKCS7_add_signed_attribute.3
1387PKCS7_add_attribute.3,PKCS7_get_attribute.3
1388PKCS7_add_attribute.3,PKCS7_get_signed_attribute.3
1389PKCS7_add_attribute.3,PKCS7_set_attributes.3
1390PKCS7_add_attribute.3,PKCS7_set_signed_attributes.3
1365PKCS7_new.3,PKCS7_DIGEST_free.3 1391PKCS7_new.3,PKCS7_DIGEST_free.3
1366PKCS7_new.3,PKCS7_DIGEST_new.3 1392PKCS7_new.3,PKCS7_DIGEST_new.3
1367PKCS7_new.3,PKCS7_ENCRYPT_free.3 1393PKCS7_new.3,PKCS7_ENCRYPT_free.3
@@ -2030,26 +2056,37 @@ X509_digest.3,X509_REQ_digest.3
2030X509_digest.3,X509_pubkey_digest.3 2056X509_digest.3,X509_pubkey_digest.3
2031X509_get0_notBefore.3,X509_CRL_get0_lastUpdate.3 2057X509_get0_notBefore.3,X509_CRL_get0_lastUpdate.3
2032X509_get0_notBefore.3,X509_CRL_get0_nextUpdate.3 2058X509_get0_notBefore.3,X509_CRL_get0_nextUpdate.3
2059X509_get0_notBefore.3,X509_CRL_get_lastUpdate.3
2060X509_get0_notBefore.3,X509_CRL_get_nextUpdate.3
2033X509_get0_notBefore.3,X509_CRL_set1_lastUpdate.3 2061X509_get0_notBefore.3,X509_CRL_set1_lastUpdate.3
2034X509_get0_notBefore.3,X509_CRL_set1_nextUpdate.3 2062X509_get0_notBefore.3,X509_CRL_set1_nextUpdate.3
2063X509_get0_notBefore.3,X509_CRL_set_lastUpdate.3
2064X509_get0_notBefore.3,X509_CRL_set_nextUpdate.3
2035X509_get0_notBefore.3,X509_get0_notAfter.3 2065X509_get0_notBefore.3,X509_get0_notAfter.3
2066X509_get0_notBefore.3,X509_get_notAfter.3
2067X509_get0_notBefore.3,X509_get_notBefore.3
2036X509_get0_notBefore.3,X509_getm_notAfter.3 2068X509_get0_notBefore.3,X509_getm_notAfter.3
2037X509_get0_notBefore.3,X509_getm_notBefore.3 2069X509_get0_notBefore.3,X509_getm_notBefore.3
2038X509_get0_notBefore.3,X509_set1_notAfter.3 2070X509_get0_notBefore.3,X509_set1_notAfter.3
2039X509_get0_notBefore.3,X509_set1_notBefore.3 2071X509_get0_notBefore.3,X509_set1_notBefore.3
2072X509_get0_notBefore.3,X509_set_notAfter.3
2073X509_get0_notBefore.3,X509_set_notBefore.3
2040X509_get0_signature.3,X509_CRL_get0_signature.3 2074X509_get0_signature.3,X509_CRL_get0_signature.3
2041X509_get0_signature.3,X509_CRL_get_signature_nid.3 2075X509_get0_signature.3,X509_CRL_get_signature_nid.3
2042X509_get0_signature.3,X509_REQ_get0_signature.3 2076X509_get0_signature.3,X509_REQ_get0_signature.3
2043X509_get0_signature.3,X509_REQ_get_signature_nid.3 2077X509_get0_signature.3,X509_REQ_get_signature_nid.3
2044X509_get0_signature.3,X509_get0_tbs_sigalg.3 2078X509_get0_signature.3,X509_get0_tbs_sigalg.3
2045X509_get0_signature.3,X509_get_signature_nid.3 2079X509_get0_signature.3,X509_get_signature_nid.3
2080X509_get0_signature.3,X509_get_signature_type.3
2046X509_get1_email.3,X509_email_free.3 2081X509_get1_email.3,X509_email_free.3
2047X509_get1_email.3,X509_get1_ocsp.3 2082X509_get1_email.3,X509_get1_ocsp.3
2048X509_get_pubkey.3,X509_REQ_get_pubkey.3 2083X509_get_pubkey.3,X509_REQ_get_pubkey.3
2049X509_get_pubkey.3,X509_REQ_set_pubkey.3 2084X509_get_pubkey.3,X509_REQ_set_pubkey.3
2050X509_get_pubkey.3,X509_get0_pubkey.3 2085X509_get_pubkey.3,X509_get0_pubkey.3
2086X509_get_pubkey.3,X509_get0_pubkey_bitstr.3
2051X509_get_pubkey.3,X509_get_X509_PUBKEY.3 2087X509_get_pubkey.3,X509_get_X509_PUBKEY.3
2052X509_get_pubkey.3,X509_set_pubkey.3 2088X509_get_pubkey.3,X509_set_pubkey.3
2089X509_get_serialNumber.3,X509_get0_serialNumber.3
2053X509_get_serialNumber.3,X509_set_serialNumber.3 2090X509_get_serialNumber.3,X509_set_serialNumber.3
2054X509_get_subject_name.3,X509_CRL_get_issuer.3 2091X509_get_subject_name.3,X509_CRL_get_issuer.3
2055X509_get_subject_name.3,X509_CRL_set_issuer_name.3 2092X509_get_subject_name.3,X509_CRL_set_issuer_name.3
@@ -2444,6 +2481,7 @@ d2i_X509_SIG.3,i2d_PKCS8_bio.3
2444d2i_X509_SIG.3,i2d_PKCS8_fp.3 2481d2i_X509_SIG.3,i2d_PKCS8_fp.3
2445d2i_X509_SIG.3,i2d_X509_SIG.3 2482d2i_X509_SIG.3,i2d_X509_SIG.3
2446des_read_pw.3,EVP_read_pw_string.3 2483des_read_pw.3,EVP_read_pw_string.3
2484des_read_pw.3,EVP_read_pw_string_min.3
2447des_read_pw.3,des_read_pw_string.3 2485des_read_pw.3,des_read_pw_string.3
2448get_rfc3526_prime_8192.3,BN_get_rfc2409_prime_1024.3 2486get_rfc3526_prime_8192.3,BN_get_rfc2409_prime_1024.3
2449get_rfc3526_prime_8192.3,BN_get_rfc2409_prime_768.3 2487get_rfc3526_prime_8192.3,BN_get_rfc2409_prime_768.3
diff --git a/patches/aeadtest.c.patch b/patches/aeadtest.c.patch
index a7b3fca..4f7319d 100644
--- a/patches/aeadtest.c.patch
+++ b/patches/aeadtest.c.patch
@@ -1,9 +1,9 @@
1--- tests/aeadtest.c.orig 2018-07-24 21:59:17.000000000 -0500 1--- tests/aeadtest.c.orig Sat Jan 26 12:39:05 2019
2+++ tests/aeadtest.c 2018-11-07 18:44:43.000000000 -0600 2+++ tests/aeadtest.c Fri Sep 4 04:04:26 2020
3@@ -76,6 +76,12 @@ 3@@ -79,6 +79,12 @@
4 4
5 #define BUF_MAX 1024 5 #define BUF_MAX 1024
6 6
7+#ifdef _MSC_VER 7+#ifdef _MSC_VER
8+#ifdef IN 8+#ifdef IN
9+#undef IN 9+#undef IN
diff --git a/patches/handshake_table.c.patch b/patches/handshake_table.c.patch
index 46f2adb..b0a9f5b 100644
--- a/patches/handshake_table.c.patch
+++ b/patches/handshake_table.c.patch
@@ -1,6 +1,6 @@
1--- tests/handshake_table.c.orig Mon May 4 23:28:43 2020 1--- tests/handshake_table.c.orig Sat Aug 22 18:51:52 2020
2+++ tests/handshake_table.c Mon May 4 23:29:50 2020 2+++ tests/handshake_table.c Fri Sep 4 04:04:26 2020
3@@ -477,6 +477,7 @@ 3@@ -479,6 +479,7 @@
4 unsigned int depth = 0; 4 unsigned int depth = 0;
5 int ch, graphviz = 0, print = 0; 5 int ch, graphviz = 0, print = 0;
6 6
@@ -8,7 +8,7 @@
8 while ((ch = getopt(argc, argv, "Cg")) != -1) { 8 while ((ch = getopt(argc, argv, "Cg")) != -1) {
9 switch (ch) { 9 switch (ch) {
10 case 'C': 10 case 'C':
11@@ -494,6 +495,7 @@ 11@@ -496,6 +497,7 @@
12 12
13 if (argc != 0) 13 if (argc != 0)
14 usage(); 14 usage();
diff --git a/patches/openssl.c.patch b/patches/openssl.c.patch
index c41f25b..2c2a3da 100644
--- a/patches/openssl.c.patch
+++ b/patches/openssl.c.patch
@@ -1,6 +1,6 @@
1--- apps/openssl/openssl.c.orig Fri Dec 14 01:44:33 2018 1--- apps/openssl/openssl.c.orig Thu Nov 7 18:19:01 2019
2+++ apps/openssl/openssl.c Sat Jan 19 22:19:23 2019 2+++ apps/openssl/openssl.c Fri Sep 4 04:04:26 2020
3@@ -350,7 +350,9 @@ 3@@ -360,7 +360,9 @@
4 static void 4 static void
5 openssl_startup(void) 5 openssl_startup(void)
6 { 6 {
diff --git a/patches/tlsexttest.c.patch b/patches/tlsexttest.c.patch
index 35092c5..70a7efb 100644
--- a/patches/tlsexttest.c.patch
+++ b/patches/tlsexttest.c.patch
@@ -1,6 +1,6 @@
1--- tests/tlsexttest.c.orig Mon Jul 6 03:17:51 2020 1--- tests/tlsexttest.c.orig Sat Aug 22 18:51:52 2020
2+++ tests/tlsexttest.c Mon Jul 6 03:45:00 2020 2+++ tests/tlsexttest.c Fri Sep 4 04:04:26 2020
3@@ -1657,7 +1657,9 @@ 3@@ -1658,7 +1658,9 @@
4 }; 4 };
5 5
6 static unsigned char tlsext_sni_server[] = { 6 static unsigned char tlsext_sni_server[] = {
@@ -10,7 +10,7 @@
10 10
11 static int 11 static int
12 test_tlsext_sni_client(void) 12 test_tlsext_sni_client(void)
13@@ -1820,9 +1822,9 @@ 13@@ -1821,9 +1823,9 @@
14 if (!CBB_finish(&cbb, &data, &dlen)) 14 if (!CBB_finish(&cbb, &data, &dlen))
15 errx(1, "failed to finish CBB"); 15 errx(1, "failed to finish CBB");
16 16
@@ -22,7 +22,7 @@
22 goto err; 22 goto err;
23 } 23 }
24 24
25@@ -1831,14 +1833,14 @@ 25@@ -1832,14 +1834,14 @@
26 fprintf(stderr, "received:\n"); 26 fprintf(stderr, "received:\n");
27 hexdump(data, dlen); 27 hexdump(data, dlen);
28 fprintf(stderr, "test data:\n"); 28 fprintf(stderr, "test data:\n");
@@ -39,8 +39,8 @@
39 if (!tlsext_sni_client_parse(ssl, SSL_TLSEXT_MSG_SH, &cbs, &alert)) { 39 if (!tlsext_sni_client_parse(ssl, SSL_TLSEXT_MSG_SH, &cbs, &alert)) {
40 FAIL("failed to parse server SNI\n"); 40 FAIL("failed to parse server SNI\n");
41 goto err; 41 goto err;
42@@ -2722,7 +2724,10 @@ 42@@ -2723,7 +2725,10 @@
43 0x02, 0x01, 0x02, 0x03, 43 0x04, 0x03, 0x02, 0x01, 0x02, 0x03,
44 }; 44 };
45 45
46-unsigned char tlsext_clienthello_disabled[] = {}; 46-unsigned char tlsext_clienthello_disabled[] = {};
@@ -51,7 +51,7 @@
51 51
52 static int 52 static int
53 test_tlsext_clienthello_build(void) 53 test_tlsext_clienthello_build(void)
54@@ -2787,18 +2792,18 @@ 54@@ -2788,18 +2793,18 @@
55 if (!CBB_finish(&cbb, &data, &dlen)) 55 if (!CBB_finish(&cbb, &data, &dlen))
56 errx(1, "failed to finish CBB"); 56 errx(1, "failed to finish CBB");
57 57
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt
index 39f8192..015cb62 100644
--- a/ssl/CMakeLists.txt
+++ b/ssl/CMakeLists.txt
@@ -38,6 +38,7 @@ set(
38 ssl_versions.c 38 ssl_versions.c
39 t1_enc.c 39 t1_enc.c
40 t1_lib.c 40 t1_lib.c
41 tls12_record_layer.c
41 tls13_buffer.c 42 tls13_buffer.c
42 tls13_client.c 43 tls13_client.c
43 tls13_error.c 44 tls13_error.c
diff --git a/ssl/Makefile.am b/ssl/Makefile.am
index a7bb8a3..dded59f 100644
--- a/ssl/Makefile.am
+++ b/ssl/Makefile.am
@@ -47,6 +47,7 @@ libssl_la_SOURCES += ssl_txt.c
47libssl_la_SOURCES += ssl_versions.c 47libssl_la_SOURCES += ssl_versions.c
48libssl_la_SOURCES += t1_enc.c 48libssl_la_SOURCES += t1_enc.c
49libssl_la_SOURCES += t1_lib.c 49libssl_la_SOURCES += t1_lib.c
50libssl_la_SOURCES += tls12_record_layer.c
50libssl_la_SOURCES += tls13_buffer.c 51libssl_la_SOURCES += tls13_buffer.c
51libssl_la_SOURCES += tls13_client.c 52libssl_la_SOURCES += tls13_client.c
52libssl_la_SOURCES += tls13_error.c 53libssl_la_SOURCES += tls13_error.c
diff --git a/tests/testssl.bat b/tests/testssl.bat
index 1a55f76..4c3ca1b 100644
--- a/tests/testssl.bat
+++ b/tests/testssl.bat
@@ -11,7 +11,10 @@ set extra=%6
11 11
12%openssl% version & if !errorlevel! neq 0 exit /b 1 12%openssl% version & if !errorlevel! neq 0 exit /b 1
13 13
14for /f "usebackq" %%s in (`%openssl% x509 -in %cert% -text -noout ^| find /c "DSA Public Key"`) do set lines=%%s 14set lines=0
15for /f "usebackq" %%s in (`%openssl% x509 -in %cert% -text -noout ^| find "DSA Public Key"`) do (
16 set /a lines=%lines%+1
17)
15if %lines% gtr 0 ( 18if %lines% gtr 0 (
16 set dsa_cert=YES 19 set dsa_cert=YES
17) else ( 20) else (
@@ -60,6 +63,17 @@ for %%p in ( SSLv3,TLSv1.2 ) do (
60 echo "Testing ciphersuites for %%p" 63 echo "Testing ciphersuites for %%p"
61 for /f "usebackq" %%c in (`%openssl% ciphers -v "%%p+aRSA" ^| find "%%p"`) do ( 64 for /f "usebackq" %%c in (`%openssl% ciphers -v "%%p+aRSA" ^| find "%%p"`) do (
62 echo "Testing %%c" 65 echo "Testing %%c"
66 %ssltest% -cipher %%c -tls1_2
67 if !errorlevel! neq 0 (
68 echo "Failed %%c"
69 exit /b 1
70 )
71 )
72)
73for %%p in ( TLSv1.3 ) do (
74 echo "Testing ciphersuites for %%p"
75 for /f "usebackq" %%c in (`%openssl% ciphers -v "%%p" ^| find "%%p"`) do (
76 echo "Testing %%c"
63 %ssltest% -cipher %%c 77 %ssltest% -cipher %%c
64 if !errorlevel! neq 0 ( 78 if !errorlevel! neq 0 (
65 echo "Failed %%c" 79 echo "Failed %%c"