8f36c51f98
This is in preparation for upcoming experiments which will require supporting multiple experimental versions of TLS 1.3 with, on the server, the ability to enable multiple variants at once. This means the version <-> wire bijection no longer exists, even when limiting to a single SSL*. Thus version_to_wire is removed and instead we treat the wire version as the canonical version value. There is a mapping from valid wire versions to protocol versions which describe the high-level handshake protocol in use. This mapping is not injective, so uses of version_from_wire are rewritten differently. All the version-munging logic is moved to ssl_versions.c with a master preference list of all TLS and DTLS versions. The legacy version negotiation is converted to the new scheme. The version lists and negotiation are driven by the preference lists and a ssl_supports_version API. To simplify the mess around SSL_SESSION and versions, version_from_wire is now DTLS/TLS-agnostic, with any filtering being done by ssl_supports_version. This is screwy but allows parsing SSL_SESSIONs to sanity-check it and reject all bogus versions in SSL_SESSION. This reduces a mess of error cases. As part of this, the weird logic where ssl->version is set early when sending the ClientHello is removed. The one place where we were relying on this behavior is tweaked to query hs->max_version instead. Change-Id: Ic91b348481ceba94d9ae06d6781187c11adc15b0 Reviewed-on: https://boringssl-review.googlesource.com/17524 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
60 lines
875 B
CMake
60 lines
875 B
CMake
include_directories(../include)
|
|
|
|
add_library(
|
|
ssl
|
|
|
|
bio_ssl.c
|
|
custom_extensions.c
|
|
d1_both.c
|
|
d1_lib.c
|
|
d1_pkt.c
|
|
d1_srtp.c
|
|
dtls_method.c
|
|
dtls_record.c
|
|
handshake_client.c
|
|
handshake_server.c
|
|
s3_both.c
|
|
s3_lib.c
|
|
s3_pkt.c
|
|
ssl_aead_ctx.c
|
|
ssl_asn1.c
|
|
ssl_buffer.c
|
|
ssl_cert.c
|
|
ssl_cipher.c
|
|
ssl_ecdh.c
|
|
ssl_file.c
|
|
ssl_lib.c
|
|
ssl_privkey.c
|
|
ssl_privkey_cc.cc
|
|
ssl_session.c
|
|
ssl_stat.c
|
|
ssl_transcript.c
|
|
ssl_versions.c
|
|
ssl_x509.c
|
|
t1_enc.c
|
|
t1_lib.c
|
|
tls_method.c
|
|
tls_record.c
|
|
tls13_both.c
|
|
tls13_client.c
|
|
tls13_enc.c
|
|
tls13_server.c
|
|
)
|
|
|
|
target_link_libraries(ssl crypto)
|
|
|
|
add_executable(
|
|
ssl_test
|
|
|
|
ssl_test.cc
|
|
|
|
$<TARGET_OBJECTS:gtest_main>
|
|
$<TARGET_OBJECTS:test_support>
|
|
)
|
|
|
|
target_link_libraries(ssl_test ssl crypto gtest)
|
|
if (WIN32)
|
|
target_link_libraries(ssl_test ws2_32)
|
|
endif()
|
|
add_dependencies(all_tests ssl_test)
|