-
Notifications
You must be signed in to change notification settings - Fork 727
test: Adds SSLv3 integ test #4372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4ea0db1
b67852e
a7ffcbd
99dc800
4b5275d
1e9e0d0
ad709e6
2a6d708
80b56c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
Protocols.TLS12, | ||
Protocols.TLS11, | ||
Protocols.TLS10, | ||
Protocols.SSLv3, | ||
] | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,11 @@ def supports_protocol(cls, protocol, with_cert=None): | |
# e.g. "openssl-1.0" in "openssl-1.0.2-fips" | ||
if unsupported_lc in current_libcrypto: | ||
return False | ||
|
||
# s2n-tls will not negotiate SSLv3 if in fips mode | ||
if protocol == Protocols.SSLv3 and get_flag(S2N_FIPS_MODE): | ||
return False | ||
|
||
return True | ||
|
||
@classmethod | ||
|
@@ -468,6 +473,9 @@ def get_version(cls): | |
|
||
@classmethod | ||
def supports_protocol(cls, protocol, with_cert=None): | ||
if protocol is Protocols.SSLv3: | ||
return False | ||
|
||
return True | ||
|
||
@classmethod | ||
|
@@ -507,6 +515,8 @@ def setup_client(self): | |
cmd_line.append('-tls1_1') | ||
elif self.options.protocol == Protocols.TLS10: | ||
cmd_line.append('-tls1') | ||
elif self.options.protocol == Protocols.SSLv3: | ||
cmd_line.append('-ssl3') | ||
|
||
if self.options.cipher is not None: | ||
cmd_line.extend(self._cipher_to_cmdline(self.options.cipher)) | ||
|
@@ -582,6 +592,8 @@ def setup_server(self): | |
cmd_line.append('-tls1_1') | ||
elif self.options.protocol == Protocols.TLS10: | ||
cmd_line.append('-tls1') | ||
elif self.options.protocol == Protocols.SSLv3: | ||
cmd_line.append('-ssl3') | ||
|
||
if self.options.cipher is not None: | ||
cmd_line.extend(self._cipher_to_cmdline(self.options.cipher)) | ||
|
@@ -607,6 +619,26 @@ def setup_server(self): | |
return cmd_line | ||
|
||
|
||
class SSLv3Provider(OpenSSL): | ||
|
||
def __init__(self, options: ProviderOptions): | ||
OpenSSL.__init__(self, options) | ||
self._override_libssl(options) | ||
|
||
def _override_libssl(self, options: ProviderOptions): | ||
install_dir = os.environ["OPENSSL_1_0_2_INSTALL_DIR"] | ||
|
||
override_env_vars = dict() | ||
override_env_vars["PATH"] = install_dir + "/bin" | ||
override_env_vars["LD_LIBRARY_PATH"] = install_dir + "/lib" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normally over-writing this is fraught with peril, but it looks like the framework gets away with it, so long as the process/ManagedProcess code only runs one binary and doesn't mess with the top level environment. |
||
options.env_overrides = override_env_vars | ||
|
||
@classmethod | ||
def supports_protocol(cls, protocol, with_cert=None): | ||
if protocol is Protocols.SSLv3: | ||
return True | ||
return False | ||
|
||
|
||
class JavaSSL(Provider): | ||
""" | ||
NOTE: Only a Java SSL client has been set up. The server has not been | ||
|
@@ -623,7 +655,7 @@ def get_send_marker(cls): | |
@classmethod | ||
def supports_protocol(cls, protocol, with_cert=None): | ||
# https://aws.amazon.com/blogs/opensource/tls-1-0-1-1-changes-in-openjdk-and-amazon-corretto/ | ||
if protocol is Protocols.TLS10 or protocol is Protocols.TLS11: | ||
if protocol is Protocols.SSLv3 or protocol is Protocols.TLS10 or protocol is Protocols.TLS11: | ||
return False | ||
|
||
return True | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ skipsdist = True | |
[testenv] | ||
# install pytest in the virtualenv where commands will be executed | ||
setenv = S2N_INTEG_TEST = 1 | ||
passenv = DYLD_LIBRARY_PATH, LD_LIBRARY_PATH, OQS_OPENSSL_1_1_1_INSTALL_DIR, HOME, TOX_TEST_NAME | ||
passenv = DYLD_LIBRARY_PATH, LD_LIBRARY_PATH, OQS_OPENSSL_1_1_1_INSTALL_DIR, OPENSSL_1_0_2_INSTALL_DIR, HOME, TOX_TEST_NAME | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The equivalent in nix will be an addition to the shellHook stanza, but let's do this as a future change. |
||
ignore_errors=False | ||
deps = | ||
pytest==7 | ||
|
Uh oh!
There was an error while loading. Please reload this page.