@@ -222,8 +222,9 @@ func RunClientTestSuite(t *testing.T, conf Config) {
222222 }
223223 },
224224 },
225- Vouchers : conf .State ,
226- OwnerKeys : conf .State ,
225+ Vouchers : conf .State ,
226+ OwnerKeys : conf .State ,
227+ VouchersForExtension : conf .State ,
227228 RvInfo : func (context.Context , fdo.Voucher ) ([][]protocol.RvInstruction , error ) {
228229 return [][]protocol.RvInstruction {}, nil
229230 },
@@ -453,10 +454,24 @@ func RunClientTestSuite(t *testing.T, conf Config) {
453454 if cred == nil {
454455 t .Fatal ("cred not set due to previous failure" )
455456 }
457+ rsaBits := 3072
458+ if conf .UnsupportedRSA3072 {
459+ rsaBits = 2048
460+ }
461+ nextOwner , _ , err := to2Responder .OwnerKeys .OwnerKey (t .Context (), table .keyType , rsaBits )
462+ if err != nil {
463+ t .Fatalf ("could not get owner key for voucher extension: %v" , err )
464+ }
465+ ov , err := to2Responder .Resell (t .Context (), cred .GUID , nextOwner .Public (), nil )
466+ if err != nil {
467+ t .Fatalf ("could not extend voucher from previous onboarding: %v" , err )
468+ }
469+ if err := to2Responder .Vouchers .AddVoucher (t .Context (), ov ); err != nil {
470+ t .Fatalf ("could not add voucher for TO2: %v" , err )
471+ }
456472
457473 ctx , cancel := context .WithTimeout (context .Background (), timeout )
458474 defer cancel ()
459- var err error
460475 cred , err = fdo .TO2 (ctx , transport , nil , fdo.TO2Config {
461476 Cred : * cred ,
462477 HmacSha256 : hmacSha256 ,
@@ -485,6 +500,21 @@ func RunClientTestSuite(t *testing.T, conf Config) {
485500 if cred == nil {
486501 t .Fatal ("cred not set due to previous failure" )
487502 }
503+ rsaBits := 3072
504+ if conf .UnsupportedRSA3072 {
505+ rsaBits = 2048
506+ }
507+ nextOwner , _ , err := to2Responder .OwnerKeys .OwnerKey (t .Context (), table .keyType , rsaBits )
508+ if err != nil {
509+ t .Fatalf ("could not get owner key for voucher extension: %v" , err )
510+ }
511+ ov , err := to2Responder .Resell (t .Context (), cred .GUID , nextOwner .Public (), nil )
512+ if err != nil {
513+ t .Fatalf ("could not extend voucher from previous onboarding: %v" , err )
514+ }
515+ if err := to2Responder .Vouchers .AddVoucher (t .Context (), ov ); err != nil {
516+ t .Fatalf ("could not add voucher for TO2: %v" , err )
517+ }
488518
489519 ctx , cancel := context .WithTimeout (context .Background (), timeout )
490520 defer cancel ()
@@ -526,8 +556,11 @@ func RunClientTestSuite(t *testing.T, conf Config) {
526556// relying on CleanupModules to be called to clear the state before the next
527557// usage.
528558type to2ModuleStateMachine struct {
529- Session fdo.TO2SessionState
530- Vouchers fdo.OwnerVoucherPersistentState
559+ Session fdo.TO2SessionState
560+ Vouchers interface {
561+ fdo.VoucherPersistentState
562+ fdo.OwnerVoucherPersistentState
563+ }
531564 OwnerModules func (ctx context.Context , guid protocol.GUID , info string , chain []* x509.Certificate , devmod serviceinfo.Devmod , modules []string ) iter.Seq2 [string , serviceinfo.OwnerModule ]
532565
533566 module * moduleStateMachineState
0 commit comments