diff --git a/MANIFEST.in b/MANIFEST.in index 7ff0a4d0c..900a7ab80 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,7 +6,7 @@ include letsencrypt/EULA recursive-include letsencrypt/tests/testdata * recursive-include acme/schemata *.json -recursive-include acme/jose/testdata * +recursive-include acme/testdata * recursive-include letsencrypt_apache/tests/testdata * include letsencrypt_apache/options-ssl-apache.conf diff --git a/acme/challenges_test.py b/acme/challenges_test.py index 94c04388d..40a2455d5 100644 --- a/acme/challenges_test.py +++ b/acme/challenges_test.py @@ -16,10 +16,10 @@ from acme import other CERT = jose.ComparableX509(OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, pkg_resources.resource_string( - 'letsencrypt.tests', os.path.join('testdata', 'cert.pem')))) + 'acme', os.path.join('testdata', 'cert.pem')))) KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa512_key.pem')), + 'acme', os.path.join('testdata', 'rsa512_key.pem')), password=None, backend=default_backend()) diff --git a/acme/client_test.py b/acme/client_test.py index 7e433c91b..abd5e7172 100644 --- a/acme/client_test.py +++ b/acme/client_test.py @@ -18,11 +18,11 @@ from acme import messages_test CERT_DER = pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'cert.der')) + 'acme', os.path.join('testdata', 'cert.der')) KEY = jose.JWKRSA.load(pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa512_key.pem'))) + 'acme', os.path.join('testdata', 'rsa512_key.pem'))) KEY2 = jose.JWKRSA.load(pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa256_key.pem'))) + 'acme', os.path.join('testdata', 'rsa256_key.pem'))) class ClientTest(unittest.TestCase): diff --git a/acme/jose/json_util_test.py b/acme/jose/json_util_test.py index 9e493e80c..458d3b87c 100644 --- a/acme/jose/json_util_test.py +++ b/acme/jose/json_util_test.py @@ -14,10 +14,10 @@ from acme.jose import util CERT = util.ComparableX509(OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, pkg_resources.resource_string( - 'letsencrypt.tests', os.path.join('testdata', 'cert.pem')))) + 'acme', os.path.join('testdata', 'cert.pem')))) CSR = util.ComparableX509(OpenSSL.crypto.load_certificate_request( OpenSSL.crypto.FILETYPE_PEM, pkg_resources.resource_string( - 'letsencrypt.tests', os.path.join('testdata', 'csr.pem')))) + 'acme', os.path.join('testdata', 'csr.pem')))) class FieldTest(unittest.TestCase): diff --git a/acme/jose/jwa_test.py b/acme/jose/jwa_test.py index 147038788..898773716 100644 --- a/acme/jose/jwa_test.py +++ b/acme/jose/jwa_test.py @@ -12,7 +12,7 @@ from acme.jose import jwk_test RSA1024_KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - __name__, os.path.join('testdata', 'rsa1024_key.pem')), + 'acme', os.path.join('testdata', 'rsa1024_key.pem')), password=None, backend=default_backend()) diff --git a/acme/jose/jwk_test.py b/acme/jose/jwk_test.py index 5be28ba17..2e317d3cc 100644 --- a/acme/jose/jwk_test.py +++ b/acme/jose/jwk_test.py @@ -11,14 +11,14 @@ from acme.jose import util DSA_PEM = pkg_resources.resource_string( - 'letsencrypt.tests', os.path.join('testdata', 'dsa512_key.pem')) + 'acme', os.path.join('testdata', 'dsa512_key.pem')) RSA256_KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - __name__, os.path.join('testdata', 'rsa256_key.pem')), + 'acme', os.path.join('testdata', 'rsa256_key.pem')), password=None, backend=default_backend()) RSA512_KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - __name__, os.path.join('testdata', 'rsa512_key.pem')), + 'acme', os.path.join('testdata', 'rsa512_key.pem')), password=None, backend=default_backend()) @@ -112,7 +112,7 @@ class JWKRSATest(unittest.TestCase): from acme.jose.jwk import JWKRSA self.assertEqual( self.private, JWKRSA.load(pkg_resources.resource_string( - __name__, os.path.join('testdata', 'rsa256_key.pem')))) + 'acme', os.path.join('testdata', 'rsa256_key.pem')))) def test_public_key(self): self.assertEqual(self.jwk256, self.private.public_key()) diff --git a/acme/jose/jws_test.py b/acme/jose/jws_test.py index 72b8b7b22..ecfb11be7 100644 --- a/acme/jose/jws_test.py +++ b/acme/jose/jws_test.py @@ -18,10 +18,10 @@ from acme.jose import util CERT = util.ComparableX509(OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, pkg_resources.resource_string( - 'letsencrypt.tests', 'testdata/cert.pem'))) + 'acme', 'testdata/cert.pem'))) RSA512_KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - __name__, os.path.join('testdata', 'rsa512_key.pem')), + 'acme', os.path.join('testdata', 'rsa512_key.pem')), password=None, backend=default_backend()) @@ -210,7 +210,7 @@ class CLITest(unittest.TestCase): def setUp(self): self.key_path = pkg_resources.resource_filename( - __name__, os.path.join('testdata', 'rsa512_key.pem')) + 'acme', os.path.join('testdata', 'rsa512_key.pem')) def test_unverified(self): from acme.jose.jws import CLI diff --git a/acme/jose/util_test.py b/acme/jose/util_test.py index f29b0792f..8d36de09b 100644 --- a/acme/jose/util_test.py +++ b/acme/jose/util_test.py @@ -17,7 +17,7 @@ class ComparableX509Test(unittest.TestCase): def _load(method, filename): # pylint: disable=missing-docstring return ComparableX509(method( OpenSSL.crypto.FILETYPE_PEM, pkg_resources.resource_string( - 'letsencrypt.tests', os.path.join('testdata', filename)))) + 'acme', os.path.join('testdata', filename)))) self.req1 = _load(OpenSSL.crypto.load_certificate_request, 'csr.pem') self.req2 = _load(OpenSSL.crypto.load_certificate_request, 'csr.pem') @@ -61,13 +61,13 @@ class ComparableRSAKeyTest(unittest.TestCase): def load_key(): # pylint: disable=missing-docstring return ComparableRSAKey(serialization.load_pem_private_key( pkg_resources.resource_string( - __name__, os.path.join('testdata', 'rsa256_key.pem')), + 'acme', os.path.join('testdata', 'rsa256_key.pem')), password=None, backend=backend)) self.key = load_key() self.key_same = load_key() self.key2 = ComparableRSAKey(serialization.load_pem_private_key( pkg_resources.resource_string( - __name__, os.path.join('testdata', 'rsa512_key.pem')), + 'acme', os.path.join('testdata', 'rsa512_key.pem')), password=None, backend=backend)) def test_getattr_proxy(self): diff --git a/acme/jws_test.py b/acme/jws_test.py index e65a3bd46..989a6697a 100644 --- a/acme/jws_test.py +++ b/acme/jws_test.py @@ -12,7 +12,7 @@ from acme import jose RSA512_KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa512_key.pem')), + 'acme', os.path.join('testdata', 'rsa512_key.pem')), password=None, backend=default_backend()) diff --git a/acme/messages_test.py b/acme/messages_test.py index d028a59c5..71bf25963 100644 --- a/acme/messages_test.py +++ b/acme/messages_test.py @@ -14,17 +14,17 @@ from acme import jose CERT = jose.ComparableX509(OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_ASN1, pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'cert.der')))) + 'acme', os.path.join('testdata', 'cert.der')))) CSR = jose.ComparableX509(OpenSSL.crypto.load_certificate_request( OpenSSL.crypto.FILETYPE_ASN1, pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'csr.der')))) + 'acme', os.path.join('testdata', 'csr.der')))) KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa512_key.pem')), + 'acme', os.path.join('testdata', 'rsa512_key.pem')), password=None, backend=default_backend()) CERT = jose.ComparableX509(OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_ASN1, pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'cert.der')))) + 'acme', os.path.join('testdata', 'cert.der')))) class ErrorTest(unittest.TestCase): diff --git a/acme/other_test.py b/acme/other_test.py index 64699038e..25b07bcde 100644 --- a/acme/other_test.py +++ b/acme/other_test.py @@ -11,7 +11,7 @@ from acme import jose KEY = serialization.load_pem_private_key( pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa512_key.pem')), + 'acme', os.path.join('testdata', 'rsa512_key.pem')), password=None, backend=default_backend()) diff --git a/acme/jose/testdata/README b/acme/testdata/README similarity index 100% rename from acme/jose/testdata/README rename to acme/testdata/README diff --git a/acme/testdata/cert-san.pem b/acme/testdata/cert-san.pem new file mode 100644 index 000000000..dcb835994 --- /dev/null +++ b/acme/testdata/cert-san.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICFjCCAcCgAwIBAgICBTkwDQYJKoZIhvcNAQELBQAwdzELMAkGA1UEBhMCVVMx +ETAPBgNVBAgMCE1pY2hpZ2FuMRIwEAYDVQQHDAlBbm4gQXJib3IxKzApBgNVBAoM +IlVuaXZlcnNpdHkgb2YgTWljaGlnYW4gYW5kIHRoZSBFRkYxFDASBgNVBAMMC2V4 +YW1wbGUuY29tMB4XDTE0MTIxMTIyMzQ0NVoXDTE0MTIxODIyMzQ0NVowdzELMAkG +A1UEBhMCVVMxETAPBgNVBAgMCE1pY2hpZ2FuMRIwEAYDVQQHDAlBbm4gQXJib3Ix +KzApBgNVBAoMIlVuaXZlcnNpdHkgb2YgTWljaGlnYW4gYW5kIHRoZSBFRkYxFDAS +BgNVBAMMC2V4YW1wbGUuY29tMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKx1c7RR +7R/drnBSQ/zfx1vQLHUbFLh1AQQQ5R8DZUXd36efNK79vukFhN9HFoHZiUvOjm0c ++pVE6K+EdE/twuUCAwEAAaM2MDQwCQYDVR0TBAIwADAnBgNVHREEIDAeggtleGFt +cGxlLmNvbYIPd3d3LmV4YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA0EASuvNKFTF +nTJsvnSXn52f4BMZJJ2id/kW7+r+FJRm+L20gKQ1aqq8d3e/lzRUrv5SMf1TAOe7 +RDjyGMKy5ZgM2w== +-----END CERTIFICATE----- diff --git a/acme/jose/testdata/cert.der b/acme/testdata/cert.der similarity index 100% rename from acme/jose/testdata/cert.der rename to acme/testdata/cert.der diff --git a/acme/testdata/cert.pem b/acme/testdata/cert.pem new file mode 100644 index 000000000..96c55cbf4 --- /dev/null +++ b/acme/testdata/cert.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB3jCCAYigAwIBAgICBTkwDQYJKoZIhvcNAQELBQAwdzELMAkGA1UEBhMCVVMx +ETAPBgNVBAgMCE1pY2hpZ2FuMRIwEAYDVQQHDAlBbm4gQXJib3IxKzApBgNVBAoM +IlVuaXZlcnNpdHkgb2YgTWljaGlnYW4gYW5kIHRoZSBFRkYxFDASBgNVBAMMC2V4 +YW1wbGUuY29tMB4XDTE0MTIxMTIyMzQ0NVoXDTE0MTIxODIyMzQ0NVowdzELMAkG +A1UEBhMCVVMxETAPBgNVBAgMCE1pY2hpZ2FuMRIwEAYDVQQHDAlBbm4gQXJib3Ix +KzApBgNVBAoMIlVuaXZlcnNpdHkgb2YgTWljaGlnYW4gYW5kIHRoZSBFRkYxFDAS +BgNVBAMMC2V4YW1wbGUuY29tMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKx1c7RR +7R/drnBSQ/zfx1vQLHUbFLh1AQQQ5R8DZUXd36efNK79vukFhN9HFoHZiUvOjm0c ++pVE6K+EdE/twuUCAwEAATANBgkqhkiG9w0BAQsFAANBAC24z0IdwIVKSlntksll +vr6zJepBH5fMndfk3XJp10jT6VE+14KNtjh02a56GoraAvJAT5/H67E8GvJ/ocNn +B/o= +-----END CERTIFICATE----- diff --git a/acme/testdata/csr-san.pem b/acme/testdata/csr-san.pem new file mode 100644 index 000000000..a7128e35c --- /dev/null +++ b/acme/testdata/csr-san.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBbjCCARgCAQAweTELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE1pY2hpZ2FuMRIw +EAYDVQQHDAlBbm4gQXJib3IxDDAKBgNVBAoMA0VGRjEfMB0GA1UECwwWVW5pdmVy +c2l0eSBvZiBNaWNoaWdhbjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wXDANBgkqhkiG +9w0BAQEFAANLADBIAkEArHVztFHtH92ucFJD/N/HW9AsdRsUuHUBBBDlHwNlRd3f +p580rv2+6QWE30cWgdmJS86ObRz6lUTor4R0T+3C5QIDAQABoDowOAYJKoZIhvcN +AQkOMSswKTAnBgNVHREEIDAeggtleGFtcGxlLmNvbYIPd3d3LmV4YW1wbGUuY29t +MA0GCSqGSIb3DQEBCwUAA0EAZGBM8J1rRs7onFgtc76mOeoT1c3v0ZsEmxQfb2Wy +tmReY6X1N4cs38D9VSow+VMRu2LWkKvzS7RUFSaTaeQz1A== +-----END CERTIFICATE REQUEST----- diff --git a/acme/jose/testdata/csr.der b/acme/testdata/csr.der similarity index 100% rename from acme/jose/testdata/csr.der rename to acme/testdata/csr.der diff --git a/acme/testdata/csr.pem b/acme/testdata/csr.pem new file mode 100644 index 000000000..b6818e39d --- /dev/null +++ b/acme/testdata/csr.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBXTCCAQcCAQAweTELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE1pY2hpZ2FuMRIw +EAYDVQQHDAlBbm4gQXJib3IxDDAKBgNVBAoMA0VGRjEfMB0GA1UECwwWVW5pdmVy +c2l0eSBvZiBNaWNoaWdhbjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wXDANBgkqhkiG +9w0BAQEFAANLADBIAkEArHVztFHtH92ucFJD/N/HW9AsdRsUuHUBBBDlHwNlRd3f +p580rv2+6QWE30cWgdmJS86ObRz6lUTor4R0T+3C5QIDAQABoCkwJwYJKoZIhvcN +AQkOMRowGDAWBgNVHREEDzANggtleGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAANB +AHJH/O6BtC9aGzEVCMGOZ7z9iIRHWSzr9x/bOzn7hLwsbXPAgO1QxEwL+X+4g20G +n9XBE1N9W6HCIEut2d8wACg= +-----END CERTIFICATE REQUEST----- diff --git a/acme/testdata/dsa512_key.pem b/acme/testdata/dsa512_key.pem new file mode 100644 index 000000000..78e164712 --- /dev/null +++ b/acme/testdata/dsa512_key.pem @@ -0,0 +1,14 @@ +-----BEGIN DSA PARAMETERS----- +MIGdAkEAwebEoGBfokKQeALHHnAZMQwYU35ILEBdV8oUmzv7qpSVUoHihyqfn6GC +OixAKSP8EJYcTilIqPbFbfFyOPlbLwIVANoFHEDiQgknAvKrG78pHzAJdQSPAkEA +qfka5Bnl+CeEMpzVZGrOVqZE/LFdZK9eT6YtWjzqtIkf3hwXUVxJsTnBG4xmrfvl +41pgNJpgu99YOYqPpS0g7A== +-----END DSA PARAMETERS----- +-----BEGIN DSA PRIVATE KEY----- +MIH5AgEAAkEAwebEoGBfokKQeALHHnAZMQwYU35ILEBdV8oUmzv7qpSVUoHihyqf +n6GCOixAKSP8EJYcTilIqPbFbfFyOPlbLwIVANoFHEDiQgknAvKrG78pHzAJdQSP +AkEAqfka5Bnl+CeEMpzVZGrOVqZE/LFdZK9eT6YtWjzqtIkf3hwXUVxJsTnBG4xm +rfvl41pgNJpgu99YOYqPpS0g7AJATQ2LUzjGQSM6UljcPY5I2OD9THkUR9kH2tth +zZd70UoI9btrVaTizgqYShuok94glSQNK0H92JgUk3scJPaAkAIVAMDn61h6vrCE +mNv063So6E+eYaIN +-----END DSA PRIVATE KEY----- diff --git a/acme/jose/testdata/rsa1024_key.pem b/acme/testdata/rsa1024_key.pem similarity index 100% rename from acme/jose/testdata/rsa1024_key.pem rename to acme/testdata/rsa1024_key.pem diff --git a/acme/jose/testdata/rsa256_key.pem b/acme/testdata/rsa256_key.pem similarity index 100% rename from acme/jose/testdata/rsa256_key.pem rename to acme/testdata/rsa256_key.pem diff --git a/acme/jose/testdata/rsa512_key.pem b/acme/testdata/rsa512_key.pem similarity index 100% rename from acme/jose/testdata/rsa512_key.pem rename to acme/testdata/rsa512_key.pem diff --git a/letsencrypt/plugins/common_test.py b/letsencrypt/plugins/common_test.py index 8688c36b1..b68ab8369 100644 --- a/letsencrypt/plugins/common_test.py +++ b/letsencrypt/plugins/common_test.py @@ -1,4 +1,5 @@ """Tests for letsencrypt.plugins.common.""" +import os import pkg_resources import unittest @@ -111,9 +112,9 @@ class DvsniTest(unittest.TestCase): """Tests for letsencrypt.plugins.common.DvsniTest.""" rsa256_file = pkg_resources.resource_filename( - "acme.jose", "testdata/rsa256_key.pem") + "letsencrypt.tests", os.path.join("testdata", "rsa256_key.pem")) rsa256_pem = pkg_resources.resource_string( - "acme.jose", "testdata/rsa256_key.pem") + "letsencrypt.tests", os.path.join("testdata", "rsa256_key.pem")) auth_key = le_util.Key(rsa256_file, rsa256_pem) achalls = [ diff --git a/letsencrypt/plugins/standalone/tests/authenticator_test.py b/letsencrypt/plugins/standalone/tests/authenticator_test.py index 422dc0549..45c485b5d 100644 --- a/letsencrypt/plugins/standalone/tests/authenticator_test.py +++ b/letsencrypt/plugins/standalone/tests/authenticator_test.py @@ -20,9 +20,9 @@ from letsencrypt.tests import acme_util KEY_PATH = pkg_resources.resource_filename( - "acme.jose", os.path.join("testdata", "rsa512_key.pem")) + "letsencrypt.tests", os.path.join("testdata", "rsa512_key.pem")) KEY_DATA = pkg_resources.resource_string( - "acme.jose", os.path.join("testdata", "rsa512_key.pem")) + "letsencrypt.tests", os.path.join("testdata", "rsa512_key.pem")) KEY = jose.JWKRSA(key=jose.ComparableRSAKey(serialization.load_pem_private_key( KEY_DATA, password=None, backend=default_backend()))) PRIVATE_KEY = OpenSSL.crypto.load_privatekey( diff --git a/letsencrypt/tests/account_test.py b/letsencrypt/tests/account_test.py index 93da225af..9a129dbe6 100644 --- a/letsencrypt/tests/account_test.py +++ b/letsencrypt/tests/account_test.py @@ -17,7 +17,7 @@ from letsencrypt import errors KEY = jose.JWKRSA.load(pkg_resources.resource_string( - __name__, os.path.join("testdata", "rsa512_key.pem"))) + "letsencrypt.tests", os.path.join("testdata", "rsa512_key_2.pem"))) class AccountTest(unittest.TestCase): diff --git a/letsencrypt/tests/achallenges_test.py b/letsencrypt/tests/achallenges_test.py index e6c154aae..4faa34d12 100644 --- a/letsencrypt/tests/achallenges_test.py +++ b/letsencrypt/tests/achallenges_test.py @@ -24,7 +24,8 @@ class DVSNITest(unittest.TestCase): key = jose.JWKRSA(key=jose.ComparableRSAKey( serialization.load_pem_private_key( pkg_resources.resource_string( - "acme.jose", os.path.join("testdata", "rsa512_key.pem")), + "letsencrypt.tests", os.path.join( + "testdata", "rsa512_key.pem")), password=None, backend=default_backend()))) from letsencrypt.achallenges import DVSNI diff --git a/letsencrypt/tests/crypto_util_test.py b/letsencrypt/tests/crypto_util_test.py index 06bdc4cd8..2e1e62797 100644 --- a/letsencrypt/tests/crypto_util_test.py +++ b/letsencrypt/tests/crypto_util_test.py @@ -11,9 +11,9 @@ import mock RSA256_KEY = pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa256_key.pem')) + 'letsencrypt.tests', os.path.join('testdata', 'rsa256_key.pem')) RSA512_KEY = pkg_resources.resource_string( - 'acme.jose', os.path.join('testdata', 'rsa512_key.pem')) + 'letsencrypt.tests', os.path.join('testdata', 'rsa512_key.pem')) CERT = pkg_resources.resource_string( 'letsencrypt.tests', os.path.join('testdata', 'cert.pem')) SAN_CERT = pkg_resources.resource_string( diff --git a/letsencrypt/tests/proof_of_possession_test.py b/letsencrypt/tests/proof_of_possession_test.py index d91b8bdb6..ef0ffc21e 100644 --- a/letsencrypt/tests/proof_of_possession_test.py +++ b/letsencrypt/tests/proof_of_possession_test.py @@ -19,7 +19,7 @@ from letsencrypt.display import util as display_util BASE_PACKAGE = "letsencrypt.tests" CERT0_PATH = pkg_resources.resource_filename( - "acme.jose", os.path.join("testdata", "cert.der")) + BASE_PACKAGE, os.path.join("testdata", "cert.der")) CERT2_PATH = pkg_resources.resource_filename( BASE_PACKAGE, os.path.join("testdata", "dsa_cert.pem")) CERT2_KEY_PATH = pkg_resources.resource_filename( @@ -27,7 +27,7 @@ CERT2_KEY_PATH = pkg_resources.resource_filename( CERT3_PATH = pkg_resources.resource_filename( BASE_PACKAGE, os.path.join("testdata", "matching_cert.pem")) CERT3_KEY_PATH = pkg_resources.resource_filename( - BASE_PACKAGE, os.path.join("testdata", "rsa512_key.pem")) + BASE_PACKAGE, os.path.join("testdata", "rsa512_key_2.pem")) with open(CERT3_KEY_PATH) as cert3_file: CERT3_KEY = serialization.load_pem_private_key( cert3_file.read(), password=None, diff --git a/letsencrypt/tests/renewer_test.py b/letsencrypt/tests/renewer_test.py index 3596201b3..4ee7cc0e8 100644 --- a/letsencrypt/tests/renewer_test.py +++ b/letsencrypt/tests/renewer_test.py @@ -296,7 +296,7 @@ class RenewableCertTests(unittest.TestCase): def _test_notafterbefore(self, function, timestamp): test_cert = pkg_resources.resource_string( - "letsencrypt.tests", "testdata/cert.pem") + "letsencrypt.tests", os.path.join("testdata", "cert.pem")) os.symlink(os.path.join("..", "..", "archive", "example.org", "cert12.pem"), self.test_rc.cert) with open(self.test_rc.cert, "w") as f: @@ -320,7 +320,7 @@ class RenewableCertTests(unittest.TestCase): """Test should_autodeploy() and should_autorenew() on the basis of expiry time windows.""" test_cert = pkg_resources.resource_string( - "letsencrypt.tests", "testdata/cert.pem") + "letsencrypt.tests", os.path.join("testdata", "cert.pem")) for kind in ALL_FOUR: where = getattr(self.test_rc, kind) os.symlink(os.path.join("..", "..", "archive", "example.org", @@ -562,7 +562,7 @@ class RenewableCertTests(unittest.TestCase): from letsencrypt import renewer test_cert = pkg_resources.resource_string( - "letsencrypt.tests", "testdata/cert-san.pem") + "letsencrypt.tests", os.path.join("testdata", "cert-san.pem")) for kind in ALL_FOUR: os.symlink(os.path.join("..", "..", "archive", "example.org", kind + "1.pem"), diff --git a/letsencrypt/tests/revoker_test.py b/letsencrypt/tests/revoker_test.py index f90da2168..92eeaf92d 100644 --- a/letsencrypt/tests/revoker_test.py +++ b/letsencrypt/tests/revoker_test.py @@ -99,7 +99,7 @@ class RevokerTest(RevokerBase): mock_display().confirm_revocation.return_value = True key_path = pkg_resources.resource_filename( - "acme.jose", os.path.join("testdata", "rsa256_key.pem")) + "letsencrypt.tests", os.path.join("testdata", "rsa256_key.pem")) wrong_key = le_util.Key(key_path, open(key_path).read()) self.revoker.revoke_from_key(wrong_key) diff --git a/letsencrypt/tests/testdata/cert.der b/letsencrypt/tests/testdata/cert.der new file mode 100644 index 000000000..5f1018505 Binary files /dev/null and b/letsencrypt/tests/testdata/cert.der differ diff --git a/letsencrypt/tests/testdata/rsa256_key.pem b/letsencrypt/tests/testdata/rsa256_key.pem new file mode 100644 index 000000000..659274d1d --- /dev/null +++ b/letsencrypt/tests/testdata/rsa256_key.pem @@ -0,0 +1,6 @@ +-----BEGIN RSA PRIVATE KEY----- +MIGrAgEAAiEAm2Fylv+Uz7trgTW8EBHP3FQSMeZs2GNQ6VRo1sIVJEkCAwEAAQIh +AJT0BA/xD01dFCAXzSNyj9nfSZa3NpqzJZZn/eOm7vghAhEAzUVNZn4lLLBD1R6N +E8TKNQIRAMHHyn3O5JeY36lwKwkUlEUCEAliRauN0L0+QZuYjfJ9aJECEGx4dru3 +rTPCyighdqWNlHUCEQCiLjlwSRtWgmMBudCkVjzt +-----END RSA PRIVATE KEY----- diff --git a/letsencrypt/tests/testdata/rsa512_key.pem b/letsencrypt/tests/testdata/rsa512_key.pem index 709b6d8e3..610c8d315 100644 --- a/letsencrypt/tests/testdata/rsa512_key.pem +++ b/letsencrypt/tests/testdata/rsa512_key.pem @@ -1,9 +1,9 @@ -----BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAPS2EXFRNza/qpXnnBHF/CcFQ543htV+7nLAmrLrmTNHtPXJmLlM -8SJDIzv/ceAFXL110VzxFfi81lpH5E5c0TMCAwEAAQJBALmppYQ/JVARjWBcsEm/ -1/bXBJ127YLv4gQIY5baL4r6IdEE33OXMTTmD9wf+ajuq1eaH0htHkwhOvREu0sz -bskCIQD/Cg+xhEVLcwK3pFp3afPIhj1IPFiL3Uy/nqyMZ6O/RQIhAPWiDBofp7Cp -J4dGZs+hkRySq/IOeeRJlNK1Pq64nToXAiBZ7+te1100YSd5KT051SRB94zO13EG -SZESFduVW8rz3QIgK+tLiqg6TYYRQUi/PUTAM4GuKNuZw828RGiPyqHLywUCIQCd -pkZrNphL/y0D7HSbPIfZzD90M2V8tUjlK0BTqk1bHA== +MIIBOgIBAAJBAKx1c7RR7R/drnBSQ/zfx1vQLHUbFLh1AQQQ5R8DZUXd36efNK79 +vukFhN9HFoHZiUvOjm0c+pVE6K+EdE/twuUCAwEAAQJAMbrEnJCrQe8YqAbw1/Bn +elAzIamndfE3U8bTavf9sgFpS4HL83rhd6PDbvx81ucaJAT/5x048fM/nFl4fzAc +mQIhAOF/a9o3EIsDKEmUl+Z1OaOiUxDF3kqWSmALEsmvDhwXAiEAw8ljV5RO/rUp +Zu2YMDFq3MKpyyMgBIJ8CxmGRc6gCmMCIGRQzkcmhfqBrhOFwkmozrqIBRIKJIjj +8TRm2LXWZZ2DAiAqVO7PztdNpynugUy4jtbGKKjBrTSNBRGA7OHlUgm0dQIhALQq +6oGU29Vxlvt3k0vmiRKU4AVfLyNXIGtcWcNG46h/ -----END RSA PRIVATE KEY----- diff --git a/letsencrypt/tests/testdata/rsa512_key_2.pem b/letsencrypt/tests/testdata/rsa512_key_2.pem new file mode 100644 index 000000000..709b6d8e3 --- /dev/null +++ b/letsencrypt/tests/testdata/rsa512_key_2.pem @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBOwIBAAJBAPS2EXFRNza/qpXnnBHF/CcFQ543htV+7nLAmrLrmTNHtPXJmLlM +8SJDIzv/ceAFXL110VzxFfi81lpH5E5c0TMCAwEAAQJBALmppYQ/JVARjWBcsEm/ +1/bXBJ127YLv4gQIY5baL4r6IdEE33OXMTTmD9wf+ajuq1eaH0htHkwhOvREu0sz +bskCIQD/Cg+xhEVLcwK3pFp3afPIhj1IPFiL3Uy/nqyMZ6O/RQIhAPWiDBofp7Cp +J4dGZs+hkRySq/IOeeRJlNK1Pq64nToXAiBZ7+te1100YSd5KT051SRB94zO13EG +SZESFduVW8rz3QIgK+tLiqg6TYYRQUi/PUTAM4GuKNuZw828RGiPyqHLywUCIQCd +pkZrNphL/y0D7HSbPIfZzD90M2V8tUjlK0BTqk1bHA== +-----END RSA PRIVATE KEY----- diff --git a/letsencrypt_apache/tests/util.py b/letsencrypt_apache/tests/util.py index 0769f6050..b7048035a 100644 --- a/letsencrypt_apache/tests/util.py +++ b/letsencrypt_apache/tests/util.py @@ -29,9 +29,9 @@ class ApacheTest(unittest.TestCase): # pylint: disable=too-few-public-methods self.temp_dir, "debian_apache_2_4/two_vhost_80/apache2") self.rsa256_file = pkg_resources.resource_filename( - "acme.jose", "testdata/rsa256_key.pem") + "letsencrypt.tests", os.path.join("testdata", "rsa256_key.pem")) self.rsa256_pem = pkg_resources.resource_string( - "acme.jose", "testdata/rsa256_key.pem") + "letsencrypt.tests", os.path.join("testdata", "rsa256_key.pem")) def get_apache_configurator( diff --git a/letsencrypt_nginx/tests/util.py b/letsencrypt_nginx/tests/util.py index 414a2f315..a7db398c6 100644 --- a/letsencrypt_nginx/tests/util.py +++ b/letsencrypt_nginx/tests/util.py @@ -26,9 +26,9 @@ class NginxTest(unittest.TestCase): # pylint: disable=too-few-public-methods self.config_path = os.path.join(self.temp_dir, "etc_nginx") self.rsa256_file = pkg_resources.resource_filename( - "acme.jose", "testdata/rsa256_key.pem") + "letsencrypt.tests", os.path.join("testdata", "rsa256_key.pem")) self.rsa256_pem = pkg_resources.resource_string( - "acme.jose", "testdata/rsa256_key.pem") + "letsencrypt.tests", os.path.join("testdata", "rsa256_key.pem")) def get_data_filename(filename): diff --git a/setup.py b/setup.py index 49ac5a6c0..b2bd0e652 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,6 @@ acme_install_requires = [ # load_pem_private/public_key (>=0.6) # rsa_recover_prime_factors (>=0.8) 'cryptography>=0.8', - #'letsencrypt' # TODO: uses testdata vectors 'mock<1.1.0', # py26 'pyrfc3339', 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304)