diff --git a/oauth2/introspector_test.go b/oauth2/introspector_test.go index 8ce426531ee..4e8238837db 100644 --- a/oauth2/introspector_test.go +++ b/oauth2/introspector_test.go @@ -49,7 +49,7 @@ func TestIntrospectorSDK(t *testing.T) { memoryStore, &compose.CommonStrategy{ CoreStrategy: compose.NewOAuth2HMACStrategy(fc, []byte("1234567890123456789012345678901234567890")), - OpenIDConnectTokenStrategy: compose.NewOpenIDConnectStrategy(pkg.MustRSAKey()), + OpenIDConnectTokenStrategy: compose.NewOpenIDConnectStrategy(pkg.MustINSECURELOWENTROPYRSAKEYFORTEST()), }, nil, compose.OAuth2AuthorizeExplicitFactory, diff --git a/oauth2/oauth2_test.go b/oauth2/oauth2_test.go index e015af1ee79..3998e9225bd 100644 --- a/oauth2/oauth2_test.go +++ b/oauth2/oauth2_test.go @@ -58,7 +58,7 @@ var handler = &Handler{ store, &compose.CommonStrategy{ CoreStrategy: compose.NewOAuth2HMACStrategy(fc, []byte("some super secret secret secret secret")), - OpenIDConnectTokenStrategy: compose.NewOpenIDConnectStrategy(pkg.MustRSAKey()), + OpenIDConnectTokenStrategy: compose.NewOpenIDConnectStrategy(pkg.MustINSECURELOWENTROPYRSAKEYFORTEST()), }, nil, compose.OAuth2AuthorizeExplicitFactory, diff --git a/oauth2/revocator_test.go b/oauth2/revocator_test.go index a8bc50276c3..08230bad79f 100644 --- a/oauth2/revocator_test.go +++ b/oauth2/revocator_test.go @@ -60,7 +60,7 @@ func TestRevoke(t *testing.T) { store, &compose.CommonStrategy{ CoreStrategy: compose.NewOAuth2HMACStrategy(fc, []byte("1234567890123456789012345678901234567890")), - OpenIDConnectTokenStrategy: compose.NewOpenIDConnectStrategy(pkg.MustRSAKey()), + OpenIDConnectTokenStrategy: compose.NewOpenIDConnectStrategy(pkg.MustINSECURELOWENTROPYRSAKEYFORTEST()), }, nil, compose.OAuth2TokenIntrospectionFactory, diff --git a/pkg/rsa.go b/pkg/rsa.go index 79f9f5c6250..7a1bcc77885 100644 --- a/pkg/rsa.go +++ b/pkg/rsa.go @@ -19,7 +19,7 @@ import ( "crypto/rsa" ) -func MustRSAKey() *rsa.PrivateKey { +func MustINSECURELOWENTROPYRSAKEYFORTEST() *rsa.PrivateKey { key, err := rsa.GenerateKey(rand.Reader, 1024) if err != nil { panic(err)