summaryrefslogtreecommitdiff
path: root/lib/ssl/test/property_test
diff options
context:
space:
mode:
authorPéter Dimitrov <peterdmv@erlang.org>2018-09-11 10:10:05 +0200
committerPéter Dimitrov <peterdmv@erlang.org>2018-09-11 15:58:30 +0200
commit6a1254c9f89916487497ee6175fc481107c2aa85 (patch)
treeedd5e593fad57dadf78e961a0a84ea85280575fd /lib/ssl/test/property_test
parenta33920ef4e0669006b1c07ac7eda599ebd9583fb (diff)
downloaderlang-6a1254c9f89916487497ee6175fc481107c2aa85.tar.gz
ssl: Property test hello extensions
Extend test generators with ClientHello extensions: - TLS 1.2: supported_version - TLs 1.3: supported_version and signature_scheme_list Change-Id: I43356a2a921edade124eceb004f20411c7e92619
Diffstat (limited to 'lib/ssl/test/property_test')
-rw-r--r--lib/ssl/test/property_test/ssl_eqc_handshake.erl50
1 files changed, 48 insertions, 2 deletions
diff --git a/lib/ssl/test/property_test/ssl_eqc_handshake.erl b/lib/ssl/test/property_test/ssl_eqc_handshake.erl
index 5303785b17..88046f7386 100644
--- a/lib/ssl/test/property_test/ssl_eqc_handshake.erl
+++ b/lib/ssl/test/property_test/ssl_eqc_handshake.erl
@@ -136,8 +136,54 @@ compressions(_) ->
client_random(_) ->
crypto:strong_rand_bytes(32).
-client_extensions(_) ->
- #hello_extensions{}.
+client_extensions(?'TLS_v1.3' = Version) ->
+ #hello_extensions{
+ client_hello_versions =
+ #client_hello_versions{
+ versions = supported_versions(Version)
+ },
+ signature_algs_cert =
+ #signature_scheme_list{
+ signature_scheme_list = signature_scheme_list()
+ }
+ };
+client_extensions(Version) ->
+ #hello_extensions{
+ client_hello_versions =
+ #client_hello_versions{
+ versions = supported_versions(Version)
+ }
+ }.
+
+signature_scheme_list() ->
+ oneof([[rsa_pkcs1_sha256],
+ [rsa_pkcs1_sha256, ecdsa_sha1],
+ [rsa_pkcs1_sha256,
+ rsa_pkcs1_sha384,
+ rsa_pkcs1_sha512,
+ ecdsa_secp256r1_sha256,
+ ecdsa_secp384r1_sha384,
+ ecdsa_secp521r1_sha512,
+ rsa_pss_rsae_sha256,
+ rsa_pss_rsae_sha384,
+ rsa_pss_rsae_sha512,
+ rsa_pss_pss_sha256,
+ rsa_pss_pss_sha384,
+ rsa_pss_pss_sha512,
+ rsa_pkcs1_sha1,
+ ecdsa_sha1]
+ ]).
+
+supported_versions(?'TLS_v1.3') ->
+ oneof([[{3,4}],
+ [{3,3},{3,4}],
+ [{3,4},{3,3},{3,2},{3,1},{3,0}]
+ ]);
+supported_versions(_) ->
+ oneof([[{3,3}],
+ [{3,3},{3,2}],
+ [{3,3},{3,2},{3,1},{3,0}]
+ ]).
key_update() ->
#key_update{request_update = request_update()}.