Skip to content

Commit 995aea1

Browse files
committed
(PUP-11718) Remove SSLv2 handling
Previously, Puppet disabled the use of SSLv2 in OpenSSL. However, starting with OpenSSL 1.0.2g, SSLv2 was disabled by default at build-time, and the OP_NO_SSLv2 constant was deprecated in OpenSSL 1.1.0. This commit removes SSLv2 configurations from Puppet.
1 parent f253c5b commit 995aea1

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

lib/puppet/util/monkey_patches.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@ def daemonize
2929
end
3030
end
3131

32-
# (#19151) Reject all SSLv2 ciphers and handshakes
3332
require_relative '../../puppet/ssl/openssl_loader'
3433
unless Puppet::Util::Platform.jruby_fips?
3534
class OpenSSL::SSL::SSLContext
3635
if DEFAULT_PARAMS[:options]
37-
DEFAULT_PARAMS[:options] |= OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3
36+
DEFAULT_PARAMS[:options] |= OpenSSL::SSL::OP_NO_SSLv3
3837
else
39-
DEFAULT_PARAMS[:options] = OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3
40-
end
41-
if DEFAULT_PARAMS[:ciphers]
42-
DEFAULT_PARAMS[:ciphers] << ':!SSLv2'
38+
DEFAULT_PARAMS[:options] = OpenSSL::SSL::OP_NO_SSLv3
4339
end
4440

4541
alias __original_initialize initialize

spec/unit/util/monkey_patches_spec.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,10 @@
2929
end
3030

3131
describe OpenSSL::SSL::SSLContext do
32-
it 'disables SSLv2 via the SSLContext#options bitmask' do
33-
expect(subject.options & OpenSSL::SSL::OP_NO_SSLv2).to eq(OpenSSL::SSL::OP_NO_SSLv2)
34-
end
35-
3632
it 'disables SSLv3 via the SSLContext#options bitmask' do
3733
expect(subject.options & OpenSSL::SSL::OP_NO_SSLv3).to eq(OpenSSL::SSL::OP_NO_SSLv3)
3834
end
3935

40-
it 'explicitly disable SSLv2 ciphers using the ! prefix so they cannot be re-added' do
41-
cipher_str = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ciphers]
42-
if cipher_str
43-
expect(cipher_str.split(':')).to include('!SSLv2')
44-
end
45-
end
46-
4736
it 'does not exclude SSLv3 ciphers shared with TLSv1' do
4837
cipher_str = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ciphers]
4938
if cipher_str
@@ -55,13 +44,6 @@
5544
expect_any_instance_of(described_class).to receive(:set_params)
5645
subject
5746
end
58-
59-
it 'has no ciphers with version SSLv2 enabled' do
60-
ciphers = subject.ciphers.select do |name, version, bits, alg_bits|
61-
/SSLv2/.match(version)
62-
end
63-
expect(ciphers).to be_empty
64-
end
6547
end
6648

6749

0 commit comments

Comments
 (0)