diff --git a/auth/keys_test.go b/auth/keys_test.go index c4a42e483..f45354708 100644 --- a/auth/keys_test.go +++ b/auth/keys_test.go @@ -104,8 +104,8 @@ func TestKeySetFromURL(t *testing.T) { wantKeys: PublicKeySet{ Expiry: testTime.Add(1 * time.Second), Keys: map[string]*rsa.PublicKey{ - "728f4016652079b9ed99861bb09bafc5a45baa86": &rsa.PublicKey{N: testGoogle1, E: 65537}, - "8289d54280b76712de41cd2ef95972b123be9ac0": &rsa.PublicKey{N: testGoogle2, E: 65537}, + "728f4016652079b9ed99861bb09bafc5a45baa86": {N: testGoogle1, E: 65537}, + "8289d54280b76712de41cd2ef95972b123be9ac0": {N: testGoogle2, E: 65537}, }, }, }, @@ -117,8 +117,8 @@ func TestKeySetFromURL(t *testing.T) { wantKeys: PublicKeySet{ Expiry: testTime.Add(5 * time.Second), Keys: map[string]*rsa.PublicKey{ - "728f4016652079b9ed99861bb09bafc5a45baa86": &rsa.PublicKey{N: testGoogle1, E: 65537}, - "8289d54280b76712de41cd2ef95972b123be9ac0": &rsa.PublicKey{N: testGoogle2, E: 65537}, + "728f4016652079b9ed99861bb09bafc5a45baa86": {N: testGoogle1, E: 65537}, + "8289d54280b76712de41cd2ef95972b123be9ac0": {N: testGoogle2, E: 65537}, }, }, }, @@ -145,8 +145,8 @@ func TestKeySetFromURL(t *testing.T) { wantKeys: PublicKeySet{ Expiry: testTime.Add(5 * time.Second), Keys: map[string]*rsa.PublicKey{ - "728f4016652079b9ed99861bb09bafc5a45baa86": &rsa.PublicKey{N: testGoogle1, E: 65537}, - "8289d54280b76712de41cd2ef95972b123be9ac0": &rsa.PublicKey{N: testGoogle2, E: 65537}, + "728f4016652079b9ed99861bb09bafc5a45baa86": {N: testGoogle1, E: 65537}, + "8289d54280b76712de41cd2ef95972b123be9ac0": {N: testGoogle2, E: 65537}, }, }, }, @@ -181,17 +181,21 @@ func TestKeySetFromURL(t *testing.T) { } var ( - testGoogleKey1 = "18112684417237113466774220553948287658642275536612278117358654328223325254239855900914880208928002193971790755769647369251185307648390933383803629253833792935549104394492595490970480288704258432536877269087694080352968836583401030682357884420432445619092471675752640354212779048186101852385524325549753366939320751885000360016238872619721767196169731422128756698973826778639560486979276112061913581353475855995717107174242233057925781337843224898645582603363390951368105740797845693907662079988391116580563176804122832211438500322243675724500523751141979116987975024595515232643410130766424608026731615327022863391377" - testGoogleKey2 = "22433090823316839640339489484457787676134304275873755218133861343920545237994470293495919014803004482856016084553850209153845425382613518932089311310596313310600424737736088033780907099977873221447195709312051528384355479077579673777886481089832045696620374920724411025483234264634539593436130076854768802102666090698524255278976644754677212286402099970599598264338136458077064875129043902522602870213617296706363155049264877048351659848686562003749244021217935734825983116131356048732262346697829165992404416525006735905763408678841171079087251498194471555953631250995421460080193870950448459655537601409828979901677" + testGoogleKey1 = "22433090823316839640339489484457787676134304275873755218133861343920545237994470293495919014803004482856016084553850209153845425382613518932089311310596313310600424737736088033780907099977873221447195709312051528384355479077579673777886481089832045696620374920724411025483234264634539593436130076854768802102666090698524255278976644754677212286402099970599598264338136458077064875129043902522602870213617296706363155049264877048351659848686562003749244021217935734825983116131356048732262346697829165992404416525006735905763408678841171079087251498194471555953631250995421460080193870950448459655537601409828979901677" + testGoogleKey2 = "18112684417237113466774220553948287658642275536612278117358654328223325254239855900914880208928002193971790755769647369251185307648390933383803629253833792935549104394492595490970480288704258432536877269087694080352968836583401030682357884420432445619092471675752640354212779048186101852385524325549753366939320751885000360016238872619721767196169731422128756698973826778639560486979276112061913581353475855995717107174242233057925781337843224898645582603363390951368105740797845693907662079988391116580563176804122832211438500322243675724500523751141979116987975024595515232643410130766424608026731615327022863391377" testGoogle1 = func() *big.Int { - b := big.NewInt(0) - b.SetBytes([]byte(testGoogleKey1)) - return b + i, ok := new(big.Int).SetString(testGoogleKey1, 10) + if !ok { + panic("bad number: " + testGoogleKey1) + } + return i }() testGoogle2 = func() *big.Int { - b := big.NewInt(0) - b.SetBytes([]byte(testGoogleKey2)) - return b + i, ok := new(big.Int).SetString(testGoogleKey2, 10) + if !ok { + panic("bad number: " + testGoogleKey2) + } + return i }() )