Skip to content

Commit

Permalink
[fix] OpenSSL::X509::Request#version default is -1
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Apr 10, 2024
1 parent ad67878 commit 864ea49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jruby/ext/openssl/X509Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public IRubyObject version() {
return getRuntime().newFixnum( certVersion.intValue() );
}
}
return version == null ? getRuntime().newFixnum(0) : version;
return version == null ? getRuntime().newFixnum(-1) : version;
}

@JRubyMethod(name="version=")
Expand Down
2 changes: 1 addition & 1 deletion src/test/ruby/x509/test_x509req.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_csr_request_ec_key

def test_version
csr = OpenSSL::X509::Request.new
assert_equal 0, csr.version
assert_equal -1, csr.version

req = OpenSSL::X509::Request.new
req.version = 1
Expand Down

0 comments on commit 864ea49

Please sign in to comment.