@@ -456,39 +456,39 @@ func (s *ClientSuite) TestUpdateRoots(c *C) {
456456 var tests = []struct {
457457 fixturePath string
458458 expectedError error
459- expectedVersions map [string ]int
459+ expectedVersions map [string ]int64
460460 }{
461461 // Succeeds when there is no root update.
462- {"testdata/Published1Time" , nil , map [string ]int {"root" : 1 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
462+ {"testdata/Published1Time" , nil , map [string ]int64 {"root" : 1 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
463463 // Succeeds when client only has root.json
464- {"testdata/Published1Time_client_root_only" , nil , map [string ]int {"root" : 1 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
464+ {"testdata/Published1Time_client_root_only" , nil , map [string ]int64 {"root" : 1 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
465465 // Succeeds updating root from version 1 to version 2.
466- {"testdata/Published2Times_keyrotated" , nil , map [string ]int {"root" : 2 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
466+ {"testdata/Published2Times_keyrotated" , nil , map [string ]int64 {"root" : 2 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
467467 // Succeeds updating root from version 1 to version 2 when the client's initial root version is expired.
468- {"testdata/Published2Times_keyrotated_initialrootexpired" , nil , map [string ]int {"root" : 2 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
468+ {"testdata/Published2Times_keyrotated_initialrootexpired" , nil , map [string ]int64 {"root" : 2 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
469469 // Succeeds updating root from version 1 to version 3 when versions 1 and 2 are expired.
470- {"testdata/Published3Times_keyrotated_initialrootsexpired" , nil , map [string ]int {"root" : 3 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
470+ {"testdata/Published3Times_keyrotated_initialrootsexpired" , nil , map [string ]int64 {"root" : 3 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
471471 // Succeeds updating root from version 2 to version 3.
472- {"testdata/Published3Times_keyrotated_initialrootsexpired_clientversionis2" , nil , map [string ]int {"root" : 3 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
472+ {"testdata/Published3Times_keyrotated_initialrootsexpired_clientversionis2" , nil , map [string ]int64 {"root" : 3 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
473473 // Fails updating root from version 1 to version 3 when versions 1 and 3 are expired but version 2 is not expired.
474- {"testdata/Published3Times_keyrotated_latestrootexpired" , ErrDecodeFailed {File : "root.json" , Err : verify.ErrExpired {}}, map [string ]int {"root" : 2 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
474+ {"testdata/Published3Times_keyrotated_latestrootexpired" , ErrDecodeFailed {File : "root.json" , Err : verify.ErrExpired {}}, map [string ]int64 {"root" : 2 , "timestamp" : 1 , "snapshot" : 1 , "targets" : 1 }},
475475 // Fails updating root from version 1 to version 2 when old root 1 did not sign off on it (nth root didn't sign off n+1).
476- {"testdata/Published2Times_keyrotated_invalidOldRootSignature" , errors .New ("tuf: signature verification failed" ), map [string ]int {}},
476+ {"testdata/Published2Times_keyrotated_invalidOldRootSignature" , errors .New ("tuf: signature verification failed" ), map [string ]int64 {}},
477477 // Fails updating root from version 1 to version 2 when the new root 2 did not sign itself (n+1th root didn't sign off n+1)
478- {"testdata/Published2Times_keyrotated_invalidNewRootSignature" , errors .New ("tuf: signature verification failed" ), map [string ]int {}},
478+ {"testdata/Published2Times_keyrotated_invalidNewRootSignature" , errors .New ("tuf: signature verification failed" ), map [string ]int64 {}},
479479 // Fails updating root to 2.root.json when the value of the version field inside it is 1 (rollback attack prevention).
480- {"testdata/Published1Time_backwardRootVersion" , verify .ErrWrongVersion (verify.ErrWrongVersion {Given : 1 , Expected : 2 }), map [string ]int {}},
480+ {"testdata/Published1Time_backwardRootVersion" , verify .ErrWrongVersion (verify.ErrWrongVersion {Given : 1 , Expected : 2 }), map [string ]int64 {}},
481481 // Fails updating root to 2.root.json when the value of the version field inside it is 3 (rollforward attack prevention).
482- {"testdata/Published3Times_keyrotated_forwardRootVersion" , verify .ErrWrongVersion (verify.ErrWrongVersion {Given : 3 , Expected : 2 }), map [string ]int {}},
482+ {"testdata/Published3Times_keyrotated_forwardRootVersion" , verify .ErrWrongVersion (verify.ErrWrongVersion {Given : 3 , Expected : 2 }), map [string ]int64 {}},
483483 // Fails updating when there is no local trusted root.
484- {"testdata/Published1Time_client_no_root" , errors .New ("tuf: no root keys found in local meta store" ), map [string ]int {}},
484+ {"testdata/Published1Time_client_no_root" , errors .New ("tuf: no root keys found in local meta store" ), map [string ]int64 {}},
485485
486486 // snapshot role key rotation increase the snapshot and timestamp.
487- {"testdata/Published2Times_snapshot_keyrotated" , nil , map [string ]int {"root" : 2 , "timestamp" : 2 , "snapshot" : 2 , "targets" : 1 }},
487+ {"testdata/Published2Times_snapshot_keyrotated" , nil , map [string ]int64 {"root" : 2 , "timestamp" : 2 , "snapshot" : 2 , "targets" : 1 }},
488488 // targets role key rotation increase the snapshot, timestamp, and targets.
489- {"testdata/Published2Times_targets_keyrotated" , nil , map [string ]int {"root" : 2 , "timestamp" : 2 , "snapshot" : 2 , "targets" : 2 }},
489+ {"testdata/Published2Times_targets_keyrotated" , nil , map [string ]int64 {"root" : 2 , "timestamp" : 2 , "snapshot" : 2 , "targets" : 2 }},
490490 // timestamp role key rotation increase the timestamp.
491- {"testdata/Published2Times_timestamp_keyrotated" , nil , map [string ]int {"root" : 2 , "timestamp" : 2 , "snapshot" : 1 , "targets" : 1 }},
491+ {"testdata/Published2Times_timestamp_keyrotated" , nil , map [string ]int64 {"root" : 2 , "timestamp" : 2 , "snapshot" : 1 , "targets" : 1 }},
492492 }
493493
494494 for _ , test := range tests {
@@ -498,7 +498,7 @@ func (s *ClientSuite) TestUpdateRoots(c *C) {
498498 c .Assert (err , IsNil )
499499 // Check if the root.json is being saved in non-volatile storage.
500500 tufClient .getLocalMeta ()
501- versionMethods := map [string ]int {"root" : tufClient .rootVer ,
501+ versionMethods := map [string ]int64 {"root" : tufClient .rootVer ,
502502 "timestamp" : tufClient .timestampVer ,
503503 "snapshot" : tufClient .snapshotVer ,
504504 "targets" : tufClient .targetsVer }
@@ -800,7 +800,7 @@ func (s *ClientSuite) TestUpdateLocalRootExpired(c *C) {
800800 c .Assert (s .repo .Commit (), IsNil )
801801 s .syncRemote (c )
802802
803- const expectedRootVersion = 3
803+ const expectedRootVersion = int64 ( 3 )
804804
805805 // check the update downloads the non expired remote root.json and
806806 // restarts itself, thus successfully updating
0 commit comments