forked from quic-go/quic-go
save the STK expiry time as a time.Duration
This commit is contained in:
@@ -281,7 +281,7 @@ func (h *cryptoSetupServer) verifySTK(stk []byte) bool {
|
||||
utils.Debugf("STK invalid: %s", err.Error())
|
||||
return false
|
||||
}
|
||||
if time.Now().After(stkTime.Add(protocol.STKExpiryTimeSec * time.Second)) {
|
||||
if time.Now().After(stkTime.Add(protocol.STKExpiryTime)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -441,7 +441,7 @@ var _ = Describe("Server Crypto Setup", func() {
|
||||
})
|
||||
|
||||
It("REJ messages that have an expired STK", func() {
|
||||
cs.scfg.stkSource.(*mockStkSource).stkTime = time.Now().Add(-protocol.STKExpiryTimeSec * time.Second).Add(-time.Second)
|
||||
cs.scfg.stkSource.(*mockStkSource).stkTime = time.Now().Add(-protocol.STKExpiryTime).Add(-time.Second)
|
||||
Expect(cs.isInchoateCHLO(fullCHLO, cert)).To(BeTrue())
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user