tests: remove RSA-256 key. (#10208)

This is ludicrously short and was only used by some key-mismatch tests.
We have plenty of other mismatched keys.
This commit is contained in:
Jacob Hoffman-Andrews 2025-02-25 18:03:16 -08:00 committed by GitHub
parent d3d0b76f9f
commit 487dd53103
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 13 deletions

View file

@ -20,15 +20,16 @@ from certbot.compat import filesystem
from certbot.compat import os
import certbot.tests.util as test_util
RSA256_KEY = test_util.load_vector('rsa256_key.pem')
RSA256_KEY_PATH = test_util.vector_path('rsa256_key.pem')
RSA512_KEY = test_util.load_vector('rsa512_key.pem')
RSA512_KEY_PATH = test_util.vector_path('rsa512_key.pem')
RSA2048_KEY = test_util.load_vector('rsa2048_key.pem')
RSA2048_KEY_PATH = test_util.vector_path('rsa2048_key.pem')
CERT_PATH = test_util.vector_path('cert_512.pem')
CERT = test_util.load_vector('cert_512.pem')
SS_CERT_PATH = test_util.vector_path('cert_2048.pem')
SS_CERT = test_util.load_vector('cert_2048.pem')
P256_KEY = test_util.load_vector('nistp256_key.pem')
P256_KEY_PATH = test_util.vector_path('nistp256_key.pem')
P256_CERT_PATH = test_util.vector_path('cert-nosans_nistp256.pem')
P256_CERT = test_util.load_vector('cert-nosans_nistp256.pem')
# CERT_LEAF is signed by CERT_ISSUER. CERT_ALT_ISSUER is a cross-sign of CERT_ISSUER.
@ -126,7 +127,7 @@ class CSRMatchesPubkeyTest(unittest.TestCase):
def test_invalid_false(self):
assert not self._call(
test_util.load_vector('csr_512.pem'), RSA256_KEY)
test_util.load_vector('csr_512.pem'), P256_KEY)
class ImportCSRFileTest(unittest.TestCase):
@ -305,7 +306,7 @@ class VerifyCertMatchesPrivKeyTest(VerifyCertSetup):
assert self._call(self.renewable_cert) is None
def test_cert_priv_key_mismatch(self):
self.bad_renewable_cert.privkey = RSA256_KEY_PATH
self.bad_renewable_cert.privkey = P256_KEY_PATH
self.bad_renewable_cert.cert = SS_CERT_PATH
with pytest.raises(errors.Error):

View file

@ -43,9 +43,9 @@ import certbot.tests.util as test_util
CERT_PATH = test_util.vector_path('cert_512.pem')
CERT = test_util.vector_path('cert_512.pem')
CSR = test_util.vector_path('csr_512.der')
KEY = test_util.vector_path('rsa256_key.pem')
JWK = jose.JWKRSA.load(test_util.load_vector('rsa512_key.pem'))
RSA2048_KEY_PATH = test_util.vector_path('rsa2048_key.pem')
P256_KEY_PATH = test_util.vector_path('p256_key.pem')
SS_CERT_PATH = test_util.vector_path('cert_2048.pem')
@ -1824,7 +1824,7 @@ class MainTest(test_util.ConfigTestCase):
def test_revoke_with_key_mismatch(self):
server = 'foo.bar'
with pytest.raises(errors.Error):
self._call_no_clientmock(['--cert-path', CERT, '--key-path', KEY,
self._call_no_clientmock(['--cert-path', CERT, '--key-path', P256_KEY_PATH,
'--server', server, 'revoke'])
@mock.patch('certbot._internal.main._delete_if_appropriate')

View file

@ -1,6 +1,6 @@
The following command has been used to generate test keys:
for x in 256 512 2048; do openssl genrsa -out rsa${k}_key.pem $k; done
for x in 512 2048; do openssl genrsa -out rsa${k}_key.pem $k; done
For the elliptic curve private keys, this command was used:

View file

@ -1,6 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIGrAgEAAiEAm2Fylv+Uz7trgTW8EBHP3FQSMeZs2GNQ6VRo1sIVJEkCAwEAAQIh
AJT0BA/xD01dFCAXzSNyj9nfSZa3NpqzJZZn/eOm7vghAhEAzUVNZn4lLLBD1R6N
E8TKNQIRAMHHyn3O5JeY36lwKwkUlEUCEAliRauN0L0+QZuYjfJ9aJECEGx4dru3
rTPCyighdqWNlHUCEQCiLjlwSRtWgmMBudCkVjzt
-----END RSA PRIVATE KEY-----