diff options
| author | Seth Skousen <seth.skousen@mx.com> | 2020-03-12 08:13:48 -0600 |
|---|---|---|
| committer | Seth Skousen <seth.skousen@mx.com> | 2020-03-12 08:13:48 -0600 |
| commit | 9b04b19701fa23a47c2379ded72ca3fc9dafb193 (patch) | |
| tree | bf51e08398f715c4b16a4064834a37a5935d5516 /lib/net/ssh | |
| parent | 5660dcc8f62773bc4fe3d380a46e1eaf5fedd22a (diff) | |
| download | net-ssh-9b04b19701fa23a47c2379ded72ca3fc9dafb193.tar.gz | |
Only limit value if on JRuby
Diffstat (limited to 'lib/net/ssh')
| -rw-r--r-- | lib/net/ssh/authentication/certificate.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/net/ssh/authentication/certificate.rb b/lib/net/ssh/authentication/certificate.rb index 246ac94..a3f09e9 100644 --- a/lib/net/ssh/authentication/certificate.rb +++ b/lib/net/ssh/authentication/certificate.rb @@ -34,7 +34,12 @@ module Net # 0x20c49ba5e353f7 = 0x7fffffffffffffff/1000, the largest value possible for JRuby # JRuby Time.at multiplies the arg by 1000, and then stores it in a signed long. # 0x20c49ba5e353f7 = 292278994-08-17 01:12:55 -0600 - cert.valid_before = Time.at([0x20c49ba5e353f7, buffer.read_int64].min) + if RUBY_PLATFORM == "java" + cert.valid_before = Time.at([0x20c49ba5e353f7, buffer.read_int64].min) + else + cert.valid_before = Time.at(buffer.read_int64) + end + cert.critical_options = read_options(buffer) cert.extensions = read_options(buffer) cert.reserved = buffer.read_string |
