File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
modules/exploits/multi/browser Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def sign_jar(jar)
78
78
cert . public_key = key . public_key
79
79
80
80
# Some time within the last 3 years
81
- cert . not_before = Time . now - rand ( 3600 * 24 * 365 * 3 )
81
+ cert . not_before = Time . now - rand ( 3600 * 24 * 365 * 3 )
82
82
83
83
# From http://developer.android.com/tools/publishing/app-signing.html
84
84
# """
@@ -89,7 +89,16 @@ def sign_jar(jar)
89
89
# requirement. You cannot upload an application if it is signed
90
90
# with a key whose validity expires before that date.
91
91
# """
92
- cert . not_after = cert . not_before + 3600 *24 *365 *20 # 20 years
92
+ #
93
+ # 32-bit Ruby (and 64-bit Ruby on Windows) cannot deal with
94
+ # certificate not_after times later than Jan 1st 2038, since long is 32-bit.
95
+ # Set not_after to a random time 2~ years before the first bad date.
96
+ #
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 ) )
93
102
94
103
# If this line is left out, signature verification fails on OSX.
95
104
cert . sign ( key , OpenSSL ::Digest ::SHA1 . new )
Original file line number Diff line number Diff line change @@ -216,7 +216,8 @@ def load_cert
216
216
@cert . issuer = x509_name
217
217
@cert . public_key = @key . public_key
218
218
@cert . not_before = Time . now
219
- @cert . not_after = @cert . not_before + 3600 *24 *365 *3 # 3 years
219
+ # FIXME: this will break in the year 2037 on 32-bit systems
220
+ @cert . not_after = @cert . not_before + 3600 * 24 * 365 # 1 year
220
221
end
221
222
end
222
223
You can’t perform that action at this time.
0 commit comments