Skip to content

Commit

Permalink
Merge pull request #747 from botovq/csr-version
Browse files Browse the repository at this point in the history
Only CSR version 1 (encoded as 0) is allowed by PKIX standards
  • Loading branch information
rhenium committed Apr 26, 2024
2 parents 44fd820 + c06fdeb commit 362a69a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions test/openssl/test_x509req.rb
Expand Up @@ -39,11 +39,6 @@ def test_version
assert_equal(0, req.version)
req = OpenSSL::X509::Request.new(req.to_der)
assert_equal(0, req.version)

req = issue_csr(1, @dn, @rsa1024, OpenSSL::Digest.new('SHA256'))
assert_equal(1, req.version)
req = OpenSSL::X509::Request.new(req.to_der)
assert_equal(1, req.version)
end

def test_subject
Expand Down Expand Up @@ -106,7 +101,7 @@ def test_sign_and_verify_rsa_sha1
assert_equal(false, req.verify(@rsa2048))
assert_equal(false, request_error_returns_false { req.verify(@dsa256) })
assert_equal(false, request_error_returns_false { req.verify(@dsa512) })
req.version = 1
req.subject = OpenSSL::X509::Name.parse("/C=JP/CN=FooBarFooBar")
assert_equal(false, req.verify(@rsa1024))
rescue OpenSSL::X509::RequestError # RHEL 9 disables SHA1
end
Expand Down

0 comments on commit 362a69a

Please sign in to comment.