summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Skousen <seth.skousen@mx.com>2020-03-12 08:21:36 -0600
committerSeth Skousen <seth.skousen@mx.com>2020-03-12 08:21:36 -0600
commitf54f71937caaab7afa330c228154e0013496c030 (patch)
tree5e6a7b3bc86a128611f7da05b29371d6e10e7f40
parent9b04b19701fa23a47c2379ded72ca3fc9dafb193 (diff)
downloadnet-ssh-f54f71937caaab7afa330c228154e0013496c030.tar.gz
Only limit valid_before if on JRuby
-rw-r--r--lib/net/ssh/authentication/certificate.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/ssh/authentication/certificate.rb b/lib/net/ssh/authentication/certificate.rb
index a3f09e9..63e77ec 100644
--- a/lib/net/ssh/authentication/certificate.rb
+++ b/lib/net/ssh/authentication/certificate.rb
@@ -34,11 +34,11 @@ 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
- 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.valid_before = if RUBY_PLATFORM == "java"
+ Time.at([0x20c49ba5e353f7, buffer.read_int64].min)
+ else
+ Time.at(buffer.read_int64)
+ end
cert.critical_options = read_options(buffer)
cert.extensions = read_options(buffer)