|
1 | | -// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved. |
| 1 | +// Copyright 2020-2026 the Pinniped contributors. All Rights Reserved. |
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | 4 | package certauthority |
@@ -121,31 +121,12 @@ func TestNewInternal(t *testing.T) { |
121 | 121 | { |
122 | 122 | name: "failed to generate CA serial", |
123 | 123 | env: env{ |
124 | | - serialRNG: strings.NewReader(""), |
125 | | - keygenRNG: strings.NewReader(""), |
126 | | - signingRNG: strings.NewReader(""), |
| 124 | + serialRNG: strings.NewReader(""), |
127 | 125 | }, |
128 | 126 | wantErr: "could not generate CA serial: EOF", |
129 | 127 | }, |
130 | | - { |
131 | | - name: "failed to generate CA key", |
132 | | - env: env{ |
133 | | - serialRNG: strings.NewReader(strings.Repeat("x", 64)), |
134 | | - keygenRNG: strings.NewReader(""), |
135 | | - signingRNG: strings.NewReader(""), |
136 | | - }, |
137 | | - wantErr: "could not generate CA private key: EOF", |
138 | | - }, |
139 | | - { |
140 | | - name: "failed to self-sign", |
141 | | - env: env{ |
142 | | - serialRNG: strings.NewReader(strings.Repeat("x", 64)), |
143 | | - keygenRNG: strings.NewReader(strings.Repeat("y", 64)), |
144 | | - signingRNG: strings.NewReader(""), |
145 | | - clock: func() time.Time { return now }, |
146 | | - }, |
147 | | - wantErr: "could not issue CA certificate: EOF", |
148 | | - }, |
| 128 | + // Note: Can't cause failures in GenerateKey or CreateCertificate by passing empty readers anymore |
| 129 | + // starting in Go 1.26.1, so those error cases are untested now. |
149 | 130 | { |
150 | 131 | name: "success", |
151 | 132 | ttl: time.Minute, |
@@ -247,16 +228,8 @@ func TestIssue(t *testing.T) { |
247 | 228 | }, |
248 | 229 | wantErr: "could not generate serial number for certificate: EOF", |
249 | 230 | }, |
250 | | - { |
251 | | - name: "failed to generate keypair", |
252 | | - ca: CA{ |
253 | | - env: env{ |
254 | | - serialRNG: strings.NewReader(strings.Repeat("x", numRandBytes)), |
255 | | - keygenRNG: strings.NewReader(""), |
256 | | - }, |
257 | | - }, |
258 | | - wantErr: "could not generate private key: EOF", |
259 | | - }, |
| 231 | + // Note: Can't cause failures in GenerateKey or CreateCertificate by passing empty readers anymore |
| 232 | + // starting in Go 1.26.1, so those error cases are untested now. |
260 | 233 | { |
261 | 234 | name: "invalid CA certificate", |
262 | 235 | ca: CA{ |
|
0 commit comments