From 930a7030b5a0080128b2fe3e2b9506717c54a6a5 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 9 Feb 2016 19:04:39 +0100 Subject: Implement proper verification of certificate's public_key against the private_key --- app/validators/certificate_key_validator.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/validators/certificate_key_validator.rb') diff --git a/app/validators/certificate_key_validator.rb b/app/validators/certificate_key_validator.rb index 3b5bd30db1a..7039bd5a621 100644 --- a/app/validators/certificate_key_validator.rb +++ b/app/validators/certificate_key_validator.rb @@ -16,6 +16,7 @@ class CertificateKeyValidator < ActiveModel::EachValidator private def valid_private_key_pem?(value) + return unless value pkey = OpenSSL::PKey::RSA.new(value) pkey.private? rescue OpenSSL::PKey::PKeyError -- cgit v1.2.1