summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-05-30 14:37:38 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-05-30 14:37:38 +1000
commitcf3b98e14ce015b60338d963ba62d28af4e4755e (patch)
treee220936bf7cb9eb3607927f8f4fe71bb199e28a4 /lib/puppet
parent9943da6740189090ba26bb185e566e2fcf9b7184 (diff)
downloadpuppet-cf3b98e14ce015b60338d963ba62d28af4e4755e.tar.gz
puppet-cf3b98e14ce015b60338d963ba62d28af4e4755e.tar.xz
puppet-cf3b98e14ce015b60338d963ba62d28af4e4755e.zip
Applied patch for ticket #1271
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/sslcertificates/ca.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/puppet/sslcertificates/ca.rb b/lib/puppet/sslcertificates/ca.rb
index 7386318f4..2237849f6 100644
--- a/lib/puppet/sslcertificates/ca.rb
+++ b/lib/puppet/sslcertificates/ca.rb
@@ -379,9 +379,14 @@ class Puppet::SSLCertificates::CA
def sign_with_key(signable, digest = OpenSSL::Digest::SHA1.new)
cakey = nil
if @config[:password]
- cakey = OpenSSL::PKey::RSA.new(
- File.read(@config[:cakey]), @config[:password]
- )
+ begin
+ cakey = OpenSSL::PKey::RSA.new(
+ File.read(@config[:cakey]), @config[:password]
+ )
+ rescue
+ raise Puppet::Error,
+ "Decrypt of CA private key with password stored in @config[:capass] not possible"
+ end
else
cakey = OpenSSL::PKey::RSA.new(
File.read(@config[:cakey])