aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-17 20:10:40 -0500
committerNick Mathewson <nickm@torproject.org>2016-11-17 20:10:40 -0500
commitb5d738e4819813569bcb768d176fc1e23a7c0a21 (patch)
tree438b5790ab3cf293e2924242b58ca8d18414ba44 /src
parenta742637f5ae033a1f05490cbf1d4444cd0529d32 (diff)
parent00bdd56b18e1441510e770b16bd869968839153b (diff)
downloadtor-b5d738e4819813569bcb768d176fc1e23a7c0a21.tar.gz
tor-b5d738e4819813569bcb768d176fc1e23a7c0a21.zip
Merge remote-tracking branch 'public/bug20558'
Diffstat (limited to 'src')
-rw-r--r--src/or/torcert.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/torcert.c b/src/or/torcert.c
index 852def9ef6..6bc880a89b 100644
--- a/src/or/torcert.c
+++ b/src/or/torcert.c
@@ -156,11 +156,12 @@ tor_cert_parse(const uint8_t *encoded, const size_t len)
cert->encoded_len = len;
memcpy(cert->signed_key.pubkey, parsed->certified_key, 32);
- const int64_t valid_until_64 = ((int64_t)parsed->exp_field) * 3600;
+ int64_t valid_until_64 = ((int64_t)parsed->exp_field) * 3600;
+#if SIZEOF_TIME_T < SIZEOF_INT64_T
if (valid_until_64 > TIME_MAX)
- cert->valid_until = TIME_MAX - 1;
- else
- cert->valid_until = (time_t) valid_until_64;
+ valid_until_64 = TIME_MAX - 1;
+#endif
+ cert->valid_until = (time_t) valid_until_64;
cert->cert_type = parsed->cert_type;
for (unsigned i = 0; i < ed25519_cert_getlen_ext(parsed); ++i) {