@@ -89,8 +89,8 @@ func TestSign(t *testing.T) {
89
89
90
90
nb := time .Now ()
91
91
signOpts := provisioner.Options {
92
- NotBefore : nb ,
93
- NotAfter : nb .Add (time .Minute * 5 ),
92
+ NotBefore : provisioner . NewTimeDuration ( nb ) ,
93
+ NotAfter : provisioner . NewTimeDuration ( nb .Add (time .Minute * 5 ) ),
94
94
}
95
95
96
96
// Create a token to get test extra opts.
@@ -171,8 +171,8 @@ func TestSign(t *testing.T) {
171
171
"fail provisioner duration claim" : func (t * testing.T ) * signTest {
172
172
csr := getCSR (t , priv )
173
173
_signOpts := provisioner.Options {
174
- NotBefore : nb ,
175
- NotAfter : nb .Add (time .Hour * 25 ),
174
+ NotBefore : provisioner . NewTimeDuration ( nb ) ,
175
+ NotAfter : provisioner . NewTimeDuration ( nb .Add (time .Hour * 25 ) ),
176
176
}
177
177
return & signTest {
178
178
auth : a ,
@@ -229,8 +229,8 @@ func TestSign(t *testing.T) {
229
229
}
230
230
} else {
231
231
if assert .Nil (t , tc .err ) {
232
- assert .Equals (t , leaf .NotBefore , signOpts .NotBefore .UTC ().Truncate (time .Second ))
233
- assert .Equals (t , leaf .NotAfter , signOpts .NotAfter .UTC ().Truncate (time .Second ))
232
+ assert .Equals (t , leaf .NotBefore , signOpts .NotBefore .Time ().Truncate (time .Second ))
233
+ assert .Equals (t , leaf .NotAfter , signOpts .NotAfter .Time ().Truncate (time .Second ))
234
234
tmplt := a .config .AuthorityConfig .Template
235
235
assert .Equals (t , fmt .Sprintf ("%v" , leaf .Subject ),
236
236
fmt .Sprintf ("%v" , & pkix.Name {
@@ -300,13 +300,13 @@ func TestRenew(t *testing.T) {
300
300
nb1 := now .Add (- time .Minute * 7 )
301
301
na1 := now
302
302
so := & provisioner.Options {
303
- NotBefore : nb1 ,
304
- NotAfter : na1 ,
303
+ NotBefore : provisioner . NewTimeDuration ( nb1 ) ,
304
+ NotAfter : provisioner . NewTimeDuration ( na1 ) ,
305
305
}
306
306
307
307
leaf , err := x509util .NewLeafProfile ("renew" , a .intermediateIdentity .Crt ,
308
308
a .intermediateIdentity .Key ,
309
- x509util .WithNotBeforeAfterDuration (so .NotBefore , so .NotAfter , 0 ),
309
+ x509util .WithNotBeforeAfterDuration (so .NotBefore . Time () , so .NotAfter . Time () , 0 ),
310
310
withDefaultASN1DN (a .config .AuthorityConfig .Template ),
311
311
x509util .WithPublicKey (pub ), x509util .WithHosts ("test.smallstep.com,test" ),
312
312
withProvisionerOID ("Max" , a .config .AuthorityConfig .Provisioners [0 ].(* provisioner.JWK ).Key .KeyID ))
@@ -318,7 +318,7 @@ func TestRenew(t *testing.T) {
318
318
319
319
leafNoRenew , err := x509util .NewLeafProfile ("norenew" , a .intermediateIdentity .Crt ,
320
320
a .intermediateIdentity .Key ,
321
- x509util .WithNotBeforeAfterDuration (so .NotBefore , so .NotAfter , 0 ),
321
+ x509util .WithNotBeforeAfterDuration (so .NotBefore . Time () , so .NotAfter . Time () , 0 ),
322
322
withDefaultASN1DN (a .config .AuthorityConfig .Template ),
323
323
x509util .WithPublicKey (pub ), x509util .WithHosts ("test.smallstep.com,test" ),
324
324
withProvisionerOID ("dev" , a .config .AuthorityConfig .Provisioners [2 ].(* provisioner.JWK ).Key .KeyID ),
0 commit comments