aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2011-11-11 10:02:59 +0100
committerIngela Anderton Andin <[email protected]>2011-11-15 11:07:11 +0100
commite33d0c96674874270d879b7b2df17cff0606a94b (patch)
treede6f0bef7a63cec713ddeed5498834c1693d7922
parent45305535f3348d8ea9a637b2236fd079e147971c (diff)
downloadotp-e33d0c96674874270d879b7b2df17cff0606a94b.tar.gz
otp-e33d0c96674874270d879b7b2df17cff0606a94b.tar.bz2
otp-e33d0c96674874270d879b7b2df17cff0606a94b.zip
Fix badarith in ssl_session:validate_session/2
The time_stamp filed is now initated in the connection process init function, so that invalidations of sessions due to handshake failiures, will not cause sessions in the session table to have an uninitiated time_stamp field.
-rw-r--r--lib/ssl/src/ssl_connection.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 59b0132ff5..9c658ecfba 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -303,12 +303,13 @@ init([Role, Host, Port, Socket, {SSLOpts0, _} = Options,
User, CbInfo]) ->
State0 = initial_state(Role, Host, Port, Socket, Options, User, CbInfo),
Hashes0 = ssl_handshake:init_hashes(),
-
+ TimeStamp = calendar:datetime_to_gregorian_seconds({date(), time()}),
try ssl_init(SSLOpts0, Role) of
{ok, Ref, CertDbHandle, CacheHandle, OwnCert, Key, DHParams} ->
Session = State0#state.session,
State = State0#state{tls_handshake_hashes = Hashes0,
- session = Session#session{own_certificate = OwnCert},
+ session = Session#session{own_certificate = OwnCert,
+ time_stamp = TimeStamp},
cert_db_ref = Ref,
cert_db = CertDbHandle,
session_cache = CacheHandle,