lib/certmeister/policy/key_bits.rb in certmeister-2.3.1 vs lib/certmeister/policy/key_bits.rb in certmeister-2.3.2

- old
+ new

@@ -15,23 +15,23 @@ validate_min_key_bits(min_key_bits) @min_key_bits = min_key_bits end def authenticate(request) - if not request[:pem] - Certmeister::Policy::Response.new(false, "missing pem") + if not request[:csr] + Certmeister::Policy::Response.new(false, "missing csr") else - cert = OpenSSL::X509::Request.new(request[:pem]) + cert = OpenSSL::X509::Request.new(request[:csr]) pkey = cert.public_key kbits = pkey.n.num_bytes * 8 if kbits < @min_key_bits Certmeister::Policy::Response.new(false, "weak key") else Certmeister::Policy::Response.new(true, nil) end end rescue OpenSSL::X509::RequestError => e - Certmeister::Policy::Response.new(false, "invalid pem (#{e.message})") + Certmeister::Policy::Response.new(false, "invalid csr (#{e.message})") end private def validate_min_key_bits(min_key_bits)