diff --git a/handshake_client.go b/handshake_client.go index 49ff0d7..dbbccfe 100644 --- a/handshake_client.go +++ b/handshake_client.go @@ -63,12 +63,7 @@ NextCipherSuite: } } - t := uint32(c.config.time().Unix()) - hello.random[0] = byte(t >> 24) - hello.random[1] = byte(t >> 16) - hello.random[2] = byte(t >> 8) - hello.random[3] = byte(t) - _, err := io.ReadFull(c.config.rand(), hello.random[4:]) + _, err := io.ReadFull(c.config.rand(), hello.random) if err != nil { c.sendAlert(alertInternalError) return errors.New("tls: short read from Rand: " + err.Error()) diff --git a/handshake_server.go b/handshake_server.go index ceb032a..e441ccb 100644 --- a/handshake_server.go +++ b/handshake_server.go @@ -146,17 +146,12 @@ Curves: } hs.hello.vers = c.vers - t := uint32(config.time().Unix()) hs.hello.random = make([]byte, 32) - hs.hello.random[0] = byte(t >> 24) - hs.hello.random[1] = byte(t >> 16) - hs.hello.random[2] = byte(t >> 8) - hs.hello.random[3] = byte(t) - hs.hello.secureRenegotiation = hs.clientHello.secureRenegotiation - _, err = io.ReadFull(config.rand(), hs.hello.random[4:]) + _, err = io.ReadFull(config.rand(), hs.hello.random) if err != nil { return false, c.sendAlert(alertInternalError) } + hs.hello.secureRenegotiation = hs.clientHello.secureRenegotiation hs.hello.compressionMethod = compressionNone if len(hs.clientHello.serverName) > 0 { c.serverName = hs.clientHello.serverName