summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_crypto.py592
-rw-r--r--tests/test_ssl.py41
2 files changed, 392 insertions, 241 deletions
diff --git a/tests/test_crypto.py b/tests/test_crypto.py
index 99280c1..3802d9a 100644
--- a/tests/test_crypto.py
+++ b/tests/test_crypto.py
@@ -80,216 +80,395 @@ w/njVbKMXrvc83qmTdGl3TAM0fxQIpqgcglFLveEBgzn
"""
root_cert_pem = b"""-----BEGIN CERTIFICATE-----
-MIIC6TCCAlKgAwIBAgIIPQzE4MbeufQwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UE
+MIIE7jCCA1agAwIBAgIIPQzE4MbeufQwDQYJKoZIhvcNAQELBQAwWDELMAkGA1UE
BhMCVVMxCzAJBgNVBAgTAklMMRAwDgYDVQQHEwdDaGljYWdvMRAwDgYDVQQKEwdU
-ZXN0aW5nMRgwFgYDVQQDEw9UZXN0aW5nIFJvb3QgQ0EwHhcNMTcwNjExMjIzMjU5
-WhcNMzcwNjA2MjIzMjU5WjBYMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSUwxEDAO
+ZXN0aW5nMRgwFgYDVQQDEw9UZXN0aW5nIFJvb3QgQ0EwHhcNMjAwODAyMTcxMTE5
+WhcNNDcxMjIwMTcxMTE5WjBYMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSUwxEDAO
BgNVBAcTB0NoaWNhZ28xEDAOBgNVBAoTB1Rlc3RpbmcxGDAWBgNVBAMTD1Rlc3Rp
-bmcgUm9vdCBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA+ZpC6Yu6ukTn
-bu5IQd0vWmpwNGZbO773xjpgfNP8nspYRqbIwI1np9FbUkJHvzZRDxrTt/LbFewr
-LhZ0prHIbwJxq3CZe+m9FDjh1IA0yKEcQukA1N3JWnoMLKwQPrCRAW6seUXV2yER
-onDxv/KkOGZtUijoKLXG8ImqK9ssWdsCAwEAAaOB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5u1SKte0NdQ4RhBeqK
+nRADMSS9oKZkSUxkwaDJH2GkUVTyBsF/kmh+dyECgcEA6jy3yRQPxcFwOAAZ8vOo
+PAP2I8WGgNQHOCYVce8nA/6jwocdq2YH6rpST3E4HOFMRFB3MAas2pvh6UyehDOm
++xGHmmv9KLgoxcJN9rvwbC0i8uVfqRYc+dUAcYTaiprVOKP2dYilzAB8ayly5R2K
+NZ5DVCbuZ1Ql9ZMW1gFVH9odY7kvROmHUjyF3jZaN0PcNM12v9HXD72gGudwJs0i
+uMBa7LmeLql7TbtjLvewhcSaA7bx0PS1g33ACapAZ6j3AoHAN2PsGz3wPtjvDTjF
+Df6e730rXrm7cMy1HYMW/ZQrnYGYsx5/PsjBfd0jn6aGdgbx9AkuF6/K3tgUgc3p
+/Fkrv9hN0yr/bO/K5L3bIHegQuoLk/PIBIi69daOe/rVBp8rtKGA3PmMnljdj+as
+6OTG0VsU5V6T/snZzozTHnVfUaduyt7nybbJJGMtZlkj/s31O2r3oKnuy+a/te4l
+mSWovf80QMe6hqLRKOxTJecU4lXwj4oIkNHXCJf74epuk5MBAoHBALyvg90KzMFX
+ZEjdPIXULR6/3rub8yD7LVYbNhhYWGo8GybzsBUC0kczRpRXFnmbq1GDIXQf5A+2
+3ZaGsWzAxLjvL3KwH1LUaXVWwFMOM2n6zTk18XEXrNvp+E5QtPwpO5c4VlPr0cAC
+tTPAmbu6kVPlQ6mKiqlPAsfh0BD2mRVo2cTjZgDotKshb5uCHD8/PnCfOjCXFxOf
+DWjBuR73/r5Bj+ktRoD4V2SFdO6loJwH6B8rsBjD0NbAGs9otKvy+Q==
-----END RSA PRIVATE KEY-----
"""
)
@@ -859,7 +1038,7 @@ class TestPKey(object):
"""
PKey.to_cryptography_key creates a proper cryptography private key.
"""
- pkey = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ pkey = load_privatekey(FILETYPE_PEM, root_key_pem)
key = pkey.to_cryptography_key()
assert isinstance(key, rsa.RSAPrivateKey)
@@ -1460,7 +1639,7 @@ class TestX509Req(_PKeyInteractionTestsMixin):
key which signed the request.
"""
request = X509Req()
- pkey = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ pkey = load_privatekey(FILETYPE_PEM, root_key_pem)
request.sign(pkey, GOOD_DIGEST)
another_pkey = load_privatekey(FILETYPE_PEM, client_key_pem)
with pytest.raises(Error):
@@ -1472,7 +1651,7 @@ class TestX509Req(_PKeyInteractionTestsMixin):
which represents the public part of the key which signed the request.
"""
request = X509Req()
- pkey = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ pkey = load_privatekey(FILETYPE_PEM, root_key_pem)
request.sign(pkey, GOOD_DIGEST)
assert request.verify(pkey)
@@ -1500,28 +1679,7 @@ class TestX509(_PKeyInteractionTestsMixin):
Tests for `OpenSSL.crypto.X509`.
"""
- pemData = cleartextCertificatePEM + cleartextPrivateKeyPEM
-
- extpem = """
------BEGIN CERTIFICATE-----
-MIIC3jCCAkegAwIBAgIJAJHFjlcCgnQzMA0GCSqGSIb3DQEBBQUAMEcxCzAJBgNV
-BAYTAlNFMRUwEwYDVQQIEwxXZXN0ZXJib3R0b20xEjAQBgNVBAoTCUNhdGFsb2dp
-eDENMAsGA1UEAxMEUm9vdDAeFw0wODA0MjIxNDQ1MzhaFw0wOTA0MjIxNDQ1Mzha
-MFQxCzAJBgNVBAYTAlNFMQswCQYDVQQIEwJXQjEUMBIGA1UEChMLT3Blbk1ldGFk
-aXIxIjAgBgNVBAMTGW5vZGUxLm9tMi5vcGVubWV0YWRpci5vcmcwgZ8wDQYJKoZI
-hvcNAQEBBQADgY0AMIGJAoGBAPIcQMrwbk2nESF/0JKibj9i1x95XYAOwP+LarwT
-Op4EQbdlI9SY+uqYqlERhF19w7CS+S6oyqx0DRZSk4Y9dZ9j9/xgm2u/f136YS1u
-zgYFPvfUs6PqYLPSM8Bw+SjJ+7+2+TN+Tkiof9WP1cMjodQwOmdsiRbR0/J7+b1B
-hec1AgMBAAGjgcQwgcEwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNT
-TCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFIdHsBcMVVMbAO7j6NCj
-03HgLnHaMB8GA1UdIwQYMBaAFL2h9Bf9Mre4vTdOiHTGAt7BRY/8MEYGA1UdEQQ/
-MD2CDSouZXhhbXBsZS5vcmeCESoub20yLmV4bWFwbGUuY29thwSC7wgKgRNvbTJA
-b3Blbm1ldGFkaXIub3JnMA0GCSqGSIb3DQEBBQUAA4GBALd7WdXkp2KvZ7/PuWZA
-MPlIxyjS+Ly11+BNE0xGQRp9Wz+2lABtpgNqssvU156+HkKd02rGheb2tj7MX9hG
-uZzbwDAZzJPjzDQDD7d3cWsrVcfIdqVU7epHqIadnOF+X0ghJ39pAm6VVadnSXCt
-WpOdIpB8KksUTCzV591Nr1wd
------END CERTIFICATE-----
- """
+ pemData = root_cert_pem + root_key_pem
def signable(self):
"""
@@ -1968,7 +2126,7 @@ WpOdIpB8KksUTCzV591Nr1wd
the algorithm used to sign the certificate.
"""
cert = load_certificate(FILETYPE_PEM, self.pemData)
- assert b"sha1WithRSAEncryption" == cert.get_signature_algorithm()
+ assert b"sha256WithRSAEncryption" == cert.get_signature_algorithm()
def test_get_undefined_signature_algorithm(self):
"""
@@ -2046,7 +2204,7 @@ class TestX509Store(object):
"""
`X509Store.add_cert` adds a `X509` instance to the certificate store.
"""
- cert = load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ cert = load_certificate(FILETYPE_PEM, root_cert_pem)
store = X509Store()
store.add_cert(cert)
@@ -2065,7 +2223,7 @@ class TestX509Store(object):
`X509Store.add_cert` doesn't raise `OpenSSL.crypto.Error` if an attempt
is made to add the same certificate to the store more than once.
"""
- cert = load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ cert = load_certificate(FILETYPE_PEM, root_cert_pem)
store = X509Store()
store.add_cert(cert)
store.add_cert(cert)
@@ -2076,8 +2234,6 @@ class TestPKCS12(object):
Test for `OpenSSL.crypto.PKCS12` and `OpenSSL.crypto.load_pkcs12`.
"""
- pemData = cleartextCertificatePEM + cleartextPrivateKeyPEM
-
def test_type(self):
"""
`PKCS12` is a type object.
@@ -2122,7 +2278,7 @@ class TestPKCS12(object):
"""
passwd = b"blah"
p12 = PKCS12()
- pkey = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ pkey = load_privatekey(FILETYPE_PEM, root_key_pem)
p12.set_privatekey(pkey)
assert None is p12.get_certificate()
assert pkey == p12.get_privatekey()
@@ -2148,7 +2304,7 @@ class TestPKCS12(object):
"""
passwd = b"blah"
p12 = PKCS12()
- cert = load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ cert = load_certificate(FILETYPE_PEM, root_cert_pem)
p12.set_certificate(cert)
assert cert == p12.get_certificate()
assert None is p12.get_privatekey()
@@ -2171,7 +2327,7 @@ class TestPKCS12(object):
# it to. At some point, hopefully this will change so that
# p12.get_certificate() is actually what returns the loaded
# certificate.
- assert cleartextCertificatePEM == dump_certificate(
+ assert root_cert_pem == dump_certificate(
FILETYPE_PEM, p12.get_ca_certificates()[0]
)
@@ -2626,7 +2782,7 @@ class TestFunction(object):
with a private key encoded in a format, that doesn't support
encryption.
"""
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
blob = dump_privatekey(FILETYPE_ASN1, key)
with pytest.raises(ValueError):
load_privatekey(FILETYPE_ASN1, blob, "secret")
@@ -2769,7 +2925,7 @@ class TestFunction(object):
`dump_privatekey` writes an encrypted PEM when given a passphrase.
"""
passphrase = b"foo"
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
pem = dump_privatekey(FILETYPE_PEM, key, GOOD_CIPHER, passphrase)
assert isinstance(pem, bytes)
loadedKey = load_privatekey(FILETYPE_PEM, pem, passphrase)
@@ -2783,7 +2939,7 @@ class TestFunction(object):
with a private key encoded in a format, that doesn't support
encryption.
"""
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
with pytest.raises(ValueError):
dump_privatekey(FILETYPE_ASN1, key, GOOD_CIPHER, "secret")
@@ -2791,16 +2947,16 @@ class TestFunction(object):
"""
`dump_certificate` writes PEM, DER, and text.
"""
- pemData = cleartextCertificatePEM + cleartextPrivateKeyPEM
+ pemData = root_cert_pem + root_key_pem
cert = load_certificate(FILETYPE_PEM, pemData)
dumped_pem = dump_certificate(FILETYPE_PEM, cert)
- assert dumped_pem == cleartextCertificatePEM
+ assert dumped_pem == root_cert_pem
dumped_der = dump_certificate(FILETYPE_ASN1, cert)
good_der = _runopenssl(dumped_pem, b"x509", b"-outform", b"DER")
assert dumped_der == good_der
cert2 = load_certificate(FILETYPE_ASN1, dumped_der)
dumped_pem2 = dump_certificate(FILETYPE_PEM, cert2)
- assert dumped_pem2 == cleartextCertificatePEM
+ assert dumped_pem2 == root_cert_pem
dumped_text = dump_certificate(FILETYPE_TEXT, cert)
assert len(dumped_text) > 500
@@ -2809,7 +2965,7 @@ class TestFunction(object):
`dump_certificate` raises a `ValueError` if it's called with
a bad type.
"""
- cert = load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ cert = load_certificate(FILETYPE_PEM, root_cert_pem)
with pytest.raises(ValueError):
dump_certificate(object(), cert)
@@ -2817,31 +2973,33 @@ class TestFunction(object):
"""
`dump_privatekey` writes a PEM
"""
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
assert key.check()
dumped_pem = dump_privatekey(FILETYPE_PEM, key)
- assert dumped_pem == cleartextPrivateKeyPEM
+ assert dumped_pem == normalized_root_key_pem
def test_dump_privatekey_asn1(self):
"""
`dump_privatekey` writes a DER
"""
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
- dumped_pem = dump_privatekey(FILETYPE_PEM, key)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
dumped_der = dump_privatekey(FILETYPE_ASN1, key)
- # XXX This OpenSSL call writes "writing RSA key" to standard out. Sad.
- good_der = _runopenssl(dumped_pem, b"rsa", b"-outform", b"DER")
- assert dumped_der == good_der
- key2 = load_privatekey(FILETYPE_ASN1, dumped_der)
- dumped_pem2 = dump_privatekey(FILETYPE_PEM, key2)
- assert dumped_pem2 == cleartextPrivateKeyPEM
+ assert dumped_der == root_key_der
+
+ def test_load_privatekey_asn1(self):
+ """
+ `dump_privatekey` writes a DER
+ """
+ key = load_privatekey(FILETYPE_ASN1, root_key_der)
+ assert key.bits() == 3072
+ assert key.type() == TYPE_RSA
def test_dump_privatekey_text(self):
"""
`dump_privatekey` writes a text
"""
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
dumped_text = dump_privatekey(FILETYPE_TEXT, key)
assert len(dumped_text) > 500
@@ -2904,7 +3062,7 @@ class TestFunction(object):
called.append(writing)
return passphrase
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
pem = dump_privatekey(FILETYPE_PEM, key, GOOD_CIPHER, cb)
assert isinstance(pem, bytes)
assert called == [True]
@@ -2922,7 +3080,7 @@ class TestFunction(object):
def cb(ignored):
raise ArithmeticError
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
with pytest.raises(ArithmeticError):
dump_privatekey(FILETYPE_PEM, key, GOOD_CIPHER, cb)
@@ -2935,7 +3093,7 @@ class TestFunction(object):
def cb(ignored):
return "a" * 1025
- key = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ key = load_privatekey(FILETYPE_PEM, root_key_pem)
with pytest.raises(ValueError):
dump_privatekey(FILETYPE_PEM, key, GOOD_CIPHER, cb)
@@ -3206,8 +3364,8 @@ class TestCRL(object):
Tests for `OpenSSL.crypto.CRL`.
"""
- cert = load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
- pkey = load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ cert = load_certificate(FILETYPE_PEM, root_cert_pem)
+ pkey = load_privatekey(FILETYPE_PEM, root_key_pem)
root_cert = load_certificate(FILETYPE_PEM, root_cert_pem)
root_key = load_privatekey(FILETYPE_PEM, root_key_pem)
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index dffd3b2..5900ad1 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -130,13 +130,12 @@ except ImportError:
from .util import WARNING_TYPE_EXPECTED, NON_ASCII, is_consistent_type
from .test_crypto import (
- cleartextCertificatePEM,
- cleartextPrivateKeyPEM,
client_cert_pem,
client_key_pem,
server_cert_pem,
server_key_pem,
root_cert_pem,
+ root_key_pem,
)
@@ -684,9 +683,7 @@ class TestContext(object):
# OpenSSL if the cert and key agree using check_privatekey. Then as
# long as check_privatekey works right we're good...
ctx = Context(TLSv1_METHOD)
- ctx.use_certificate(
- load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
- )
+ ctx.use_certificate(load_certificate(FILETYPE_PEM, root_cert_pem))
def test_use_certificate_file_wrong_args(self):
"""
@@ -720,7 +717,7 @@ class TestContext(object):
# OpenSSL if the cert and key agree using check_privatekey. Then as
# long as check_privatekey works right we're good...
with open(certificate_file, "wb") as pem_file:
- pem_file.write(cleartextCertificatePEM)
+ pem_file.write(root_cert_pem)
ctx = Context(TLSv1_METHOD)
ctx.use_certificate_file(certificate_file)
@@ -975,12 +972,8 @@ class TestContext(object):
context = Context(TLSv1_METHOD)
context.set_info_callback(info)
- context.use_certificate(
- load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
- )
- context.use_privatekey(
- load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
- )
+ context.use_certificate(load_certificate(FILETYPE_PEM, root_cert_pem))
+ context.use_privatekey(load_privatekey(FILETYPE_PEM, root_key_pem))
serverSSL = Connection(context, server)
serverSSL.set_accept_state()
@@ -1018,10 +1011,10 @@ class TestContext(object):
server_context = Context(TLSv1_METHOD)
server_context.set_keylog_callback(keylog)
server_context.use_certificate(
- load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ load_certificate(FILETYPE_PEM, root_cert_pem)
)
server_context.use_privatekey(
- load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ load_privatekey(FILETYPE_PEM, root_key_pem)
)
client_context = Context(TLSv1_METHOD)
@@ -1054,10 +1047,10 @@ class TestContext(object):
serverContext = Context(TLSv1_METHOD)
serverContext.use_certificate(
- load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ load_certificate(FILETYPE_PEM, root_cert_pem)
)
serverContext.use_privatekey(
- load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ load_privatekey(FILETYPE_PEM, root_key_pem)
)
serverSSL = Connection(serverContext, server)
@@ -1080,7 +1073,7 @@ class TestContext(object):
connections created using that `Context`.
"""
with open(cafile, "w") as fObj:
- fObj.write(cleartextCertificatePEM.decode("ascii"))
+ fObj.write(root_cert_pem.decode("ascii"))
self._load_verify_locations_test(cafile)
@@ -1124,7 +1117,7 @@ class TestContext(object):
for name in [b"c7adac82.0", b"c3705638.0"]:
cafile = join_bytes_or_unicode(capath, name)
with open(cafile, "w") as fObj:
- fObj.write(cleartextCertificatePEM.decode("ascii"))
+ fObj.write(root_cert_pem.decode("ascii"))
self._load_verify_locations_test(None, capath)
@@ -1308,10 +1301,10 @@ class TestContext(object):
"""
serverContext = Context(TLSv1_METHOD)
serverContext.use_privatekey(
- load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ load_privatekey(FILETYPE_PEM, root_key_pem)
)
serverContext.use_certificate(
- load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ load_certificate(FILETYPE_PEM, root_cert_pem)
)
serverConnection = Connection(serverContext, None)
@@ -1339,10 +1332,10 @@ class TestContext(object):
"""
serverContext = Context(TLSv1_METHOD)
serverContext.use_privatekey(
- load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ load_privatekey(FILETYPE_PEM, root_key_pem)
)
serverContext.use_certificate(
- load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ load_certificate(FILETYPE_PEM, root_cert_pem)
)
serverConnection = Connection(serverContext, None)
@@ -1365,10 +1358,10 @@ class TestContext(object):
"""
serverContext = Context(TLSv1_2_METHOD)
serverContext.use_privatekey(
- load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM)
+ load_privatekey(FILETYPE_PEM, root_key_pem)
)
serverContext.use_certificate(
- load_certificate(FILETYPE_PEM, cleartextCertificatePEM)
+ load_certificate(FILETYPE_PEM, root_cert_pem)
)
clientContext = Context(TLSv1_2_METHOD)