ioerror/tlsdate — pull request #53 by elly (2012-12-17 19:53:13+00:00)
Title: [tlsdate] fix certificate time compensation

Fix the code that compensates for certificates whose time is in the future, to
prevent a situation where it's impossible to fetch a new time because our
current time is too old. There are two bugs:

1. We try to use the server's time too late, after we've already done cert
validation; we need to do it earlier (during the server hello).

2. We set the time on the wrong context - we need to set the time on the cert
store instead of just the context object, since when OpenSSL is setting up to
verify the cert, it copies the cert store's params instead of the SSL context's
params.

BUG=chromium-os:36738
TEST=adhoc
date -s '2012-01-01 00:00:00' && tlsdate -l -v -H clients3.google.com -p 443

Change-Id: Ie1b11a2e0ecdc2196b729f6d5483b53c54a1933d
Signed-off-by: Elly Fong-Jones
(cherry picked from commit 87ee9c2c23eff1816adc069c3b41f84933779643)