Skip to content

Commit

Permalink
Merge pull request #1001 from jpds/ssl_random_seed_options
Browse files Browse the repository at this point in the history
ssl.pp: Allow setting of SSLRandomSeed option.
  • Loading branch information
igalic committed Feb 17, 2015
2 parents 7467efc + d431fce commit 8b7710c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,12 @@ Installs Apache SSL capabilities and uses the ssl.conf.erb template. These are t
ssl_cipher => 'HIGH:MEDIUM:!aNULL:!MD5',
ssl_protocol => 'all -SSLv2 -SSLv3',
ssl_pass_phrase_dialog => 'builtin',
ssl_random_seed_bytes => '512',
ssl_random_seeds => [
'startup builtin',
'startup file:/dev/urandom 512',
'connect builtin',
'connect file:/dev/urandom 512',
],
}
```

Expand Down
8 changes: 7 additions & 1 deletion manifests/mod/ssl.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
$ssl_cipher = 'HIGH:MEDIUM:!aNULL:!MD5',
$ssl_protocol = [ 'all', '-SSLv2', '-SSLv3' ],
$ssl_pass_phrase_dialog = 'builtin',
$ssl_random_seed_bytes = '512',
$ssl_random_seeds = [
'startup builtin',
'startup file:/dev/urandom 512',
'connect builtin',
'connect file:/dev/urandom 512',
],
$apache_version = $::apache::apache_version,
$package_name = undef,
) {
Expand Down Expand Up @@ -49,6 +54,7 @@
# $ssl_options
# $session_cache,
# $ssl_mutex
# $ssl_random_seeds
# $apache_version
#
file { 'ssl.conf':
Expand Down
12 changes: 8 additions & 4 deletions spec/classes/mod/ssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,17 @@
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLPassPhraseDialog exec:\/path\/to\/program$/)}
end

context 'setting ssl_random_seed_bytes' do
context 'setting ssl_random_seeds' do
let :params do
{
:ssl_random_seed_bytes => '1024',
}
:ssl_random_seeds => ['startup builtin',
'startup file:/dev/random 256',
'connect file:/dev/urandom 1024' ],
}
end
it { is_expected.to contain_file('ssl.conf').with_content(%r{^ SSLRandomSeed startup file:/dev/urandom 1024$})}
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLRandomSeed startup builtin$/)}
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLRandomSeed startup file:\/dev\/random 256$/)}
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLRandomSeed connect file:\/dev\/urandom 1024$/)}
end

end
Expand Down
9 changes: 5 additions & 4 deletions templates/mod/ssl.conf.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<IfModule mod_ssl.c>
SSLRandomSeed startup builtin
SSLRandomSeed startup file:/dev/urandom <%= @ssl_random_seed_bytes %>
SSLRandomSeed connect builtin
SSLRandomSeed connect file:/dev/urandom <%= @ssl_random_seed_bytes %>
<%- Array(@ssl_random_seeds).each do |ssl_random_seed| -%>
<%- if ssl_random_seed != '' -%>
SSLRandomSeed <%= ssl_random_seed %>
<%- end -%>
<%- end -%>

AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
Expand Down

0 comments on commit 8b7710c

Please sign in to comment.