Skip to content

Commit 4fec2e7

Browse files
committed
make fix more precise, based on rapid7#2343
1 parent 27bd2a4 commit 4fec2e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/msf/core/payload/android.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ def sign_jar(jar)
9494
# certificate not_after times later than Jan 1st 2038, since long is 32-bit.
9595
# Set not_after to a random time 2~ years before the first bad date.
9696
#
97-
# FIXME: this will break again in 2031, hopefully all 32-bit systems will
98-
# be dead by then...
99-
cert.not_after = Time.new("2034/01/01") + rand(3600 * 24 * 365 * 2)
97+
# FIXME: this will break again randomly starting in late 2033, hopefully
98+
# all 32-bit systems will be dead by then...
99+
#
100+
# The timestamp 0x78045d81 equates to 2033-10-22 00:00:01 UTC
101+
cert.not_after = Time.at(0x78045d81 + rand(0x7fffffff - 0x78045d81))
100102

101103
# If this line is left out, signature verification fails on OSX.
102104
cert.sign(key, OpenSSL::Digest::SHA1.new)

0 commit comments

Comments
 (0)