@@ -171,6 +171,7 @@ final class OCSPVerifierPolicyTests: XCTestCase {
171
171
}
172
172
173
173
func testSingleCertWithOCSP( ) async {
174
+ let now = self . now
174
175
await self . assertChainMeetsPolicy (
175
176
chain: Self . chainWithSingleCertWithOCSP,
176
177
requester: . noThrow { request, uri -> OCSPResponse in
@@ -182,14 +183,15 @@ final class OCSPVerifierPolicyTests: XCTestCase {
182
183
return . successful( . signed( responses: [ OCSPSingleResponse (
183
184
certID: singleRequest. certID,
184
185
certStatus: . good,
185
- thisUpdate: try . init( self . now - . days( 1 ) ) ,
186
- nextUpdate: try . init( self . now + . days( 1 ) )
186
+ thisUpdate: try . init( now - . days( 1 ) ) ,
187
+ nextUpdate: try . init( now + . days( 1 ) )
187
188
) ] , responseExtensions: { nonce } ) )
188
189
}
189
190
)
190
191
}
191
192
192
193
func testWrongNonce( ) async {
194
+ let now = self . now
193
195
await self . assertChainFailsToMeetPolicy (
194
196
chain: Self . chainWithSingleCertWithOCSP,
195
197
requester: . noThrow { request, uri -> OCSPResponse in
@@ -201,14 +203,15 @@ final class OCSPVerifierPolicyTests: XCTestCase {
201
203
return . successful( . signed( responses: [ OCSPSingleResponse (
202
204
certID: singleRequest. certID,
203
205
certStatus: . good,
204
- thisUpdate: try . init( self . now - . days( 1 ) ) ,
205
- nextUpdate: try . init( self . now + . days( 1 ) )
206
+ thisUpdate: try . init( now - . days( 1 ) ) ,
207
+ nextUpdate: try . init( now + . days( 1 ) )
206
208
) ] , responseExtensions: { OCSPNonce ( ) } ) )
207
209
}
208
210
)
209
211
}
210
212
211
213
func testRevokedCert( ) async {
214
+ let now = self . now
212
215
await self . assertChainFailsToMeetPolicy (
213
216
chain: Self . chainWithSingleCertWithOCSP,
214
217
requester: . noThrow { request, uri -> OCSPResponse in
@@ -220,17 +223,18 @@ final class OCSPVerifierPolicyTests: XCTestCase {
220
223
return . successful( . signed( responses: [ OCSPSingleResponse (
221
224
certID: singleRequest. certID,
222
225
certStatus: . revoked( . init(
223
- revocationTime: try . init( self . now) ,
226
+ revocationTime: try . init( now) ,
224
227
revocationReason: . unspecified
225
228
) ) ,
226
- thisUpdate: try . init( self . now - . days( 1 ) ) ,
227
- nextUpdate: try . init( self . now + . days( 1 ) )
229
+ thisUpdate: try . init( now - . days( 1 ) ) ,
230
+ nextUpdate: try . init( now + . days( 1 ) )
228
231
) ] , responseExtensions: { nonce } ) )
229
232
}
230
233
)
231
234
}
232
235
233
236
func testResponseDoesNotIncludeResponseForRequestedCert( ) async {
237
+ let now = self . now
234
238
await self . assertChainFailsToMeetPolicy (
235
239
chain: Self . chainWithSingleCertWithOCSP,
236
240
requester: . noThrow { request, uri -> OCSPResponse in
@@ -246,8 +250,8 @@ final class OCSPVerifierPolicyTests: XCTestCase {
246
250
serialNumber: . init( )
247
251
) ,
248
252
certStatus: . good,
249
- thisUpdate: try . init( self . now - . days( 1 ) ) ,
250
- nextUpdate: try . init( self . now + . days( 1 ) )
253
+ thisUpdate: try . init( now - . days( 1 ) ) ,
254
+ nextUpdate: try . init( now + . days( 1 ) )
251
255
) ] , responseExtensions: { nonce } ) )
252
256
}
253
257
)
0 commit comments