Puppet: System Administration Automated

Support

Ticket #1271: 0001-catch-problems-of-OpenSSL-PKey-RSA.new.patch

File 0001-catch-problems-of-OpenSSL-PKey-RSA.new.patch, 1.3 kB (added by unki, 7 months ago)
  • a/lib/puppet/sslcertificates/ca.rb

    old new  
    379379    def sign_with_key(signable, digest = OpenSSL::Digest::SHA1.new) 
    380380        cakey = nil 
    381381        if @config[:password] 
    382             cakey = OpenSSL::PKey::RSA.new( 
    383                 File.read(@config[:cakey]), @config[:password] 
    384             ) 
     382            begin 
     383                cakey = OpenSSL::PKey::RSA.new( 
     384                    File.read(@config[:cakey]), @config[:password] 
     385                ) 
     386            rescue 
     387                raise Puppet::Error, 
     388                    "Decrypt of CA private key with password stored in @config[:capass] not possible" 
     389            end 
    385390        else 
    386391            cakey = OpenSSL::PKey::RSA.new( 
    387392                File.read(@config[:cakey])