-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 30 May 2008, James Turnbull wrote: > Signed-off-by: James Turnbull <[EMAIL PROTECTED]> > --- > lib/puppet/sslcertificates/ca.rb | 11 ++++++++--- > 1 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/lib/puppet/sslcertificates/ca.rb > b/lib/puppet/sslcertificates/ca.rb index 7386318..2237849 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
Wouldn't that rescue also catch "file not found" exeptions? In that case the error message would be quite misleading. > else > cakey = OpenSSL::PKey::RSA.new( > File.read(@config[:cakey]) Regards, DavidS - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIP50V/Pp1N6Uzh0URAo3AAKCJeERn01+bJJLvpIRbOQGSfgNjbACfRjai TZ0Op1l1ZjL4waxyKcxhhTE= =BK3U -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
