@@ -48,20 +48,20 @@ func TestGenerateCRLTimeBounds(t *testing.T) {
4848// we need to wrap it as we pass a purposefully broken io.Reader to Sign in order
4949// to verify that go isn't using it as a source of randomness (we expect this
5050// randomness to come from the HSM). If we directly call Sign on the crypto.Signer
51- // it would fail, so we wrap it so that we can use a shim rand.Reader in the Sign
51+ // it would fail, so we wrap it so that we can use a shim nil in the Sign
5252// call.
5353type wrappedSigner struct { k crypto.Signer }
5454
5555func (p wrappedSigner ) Sign (_ io.Reader , digest []byte , opts crypto.SignerOpts ) ([]byte , error ) {
56- return p .k .Sign (rand . Reader , digest , opts )
56+ return p .k .Sign (nil , digest , opts )
5757}
5858
5959func (p wrappedSigner ) Public () crypto.PublicKey {
6060 return p .k .Public ()
6161}
6262
6363func TestGenerateCRLLints (t * testing.T ) {
64- k , err := ecdsa .GenerateKey (elliptic .P256 (), rand . Reader )
64+ k , err := ecdsa .GenerateKey (elliptic .P256 (), nil )
6565 test .AssertNotError (t , err , "failed to generate test key" )
6666
6767 cert := & x509.Certificate {
@@ -74,7 +74,7 @@ func TestGenerateCRLLints(t *testing.T) {
7474 SubjectKeyId : []byte {1 , 2 , 3 },
7575 }
7676
77- certBytes , err := x509 .CreateCertificate (rand . Reader , cert , cert , k .Public (), k )
77+ certBytes , err := x509 .CreateCertificate (nil , cert , cert , k .Public (), k )
7878 test .AssertNotError (t , err , "failed to generate test cert" )
7979 cert , err = x509 .ParseCertificate (certBytes )
8080 test .AssertNotError (t , err , "failed to parse test cert" )
@@ -102,7 +102,7 @@ func TestGenerateCRLLints(t *testing.T) {
102102}
103103
104104func TestGenerateCRL (t * testing.T ) {
105- k , err := ecdsa .GenerateKey (elliptic .P256 (), rand . Reader )
105+ k , err := ecdsa .GenerateKey (elliptic .P256 (), nil )
106106 test .AssertNotError (t , err , "failed to generate test key" )
107107
108108 template := & x509.Certificate {
@@ -116,7 +116,7 @@ func TestGenerateCRL(t *testing.T) {
116116 SubjectKeyId : []byte {1 , 2 , 3 },
117117 }
118118
119- certBytes , err := x509 .CreateCertificate (rand . Reader , template , template , k .Public (), k )
119+ certBytes , err := x509 .CreateCertificate (nil , template , template , k .Public (), k )
120120 test .AssertNotError (t , err , "failed to generate test cert" )
121121 cert , err := x509 .ParseCertificate (certBytes )
122122 test .AssertNotError (t , err , "failed to parse test cert" )
0 commit comments