Fix unit tests certificates to have correct chains and private keys
In preparation for certificate integrity-checking: invalid certificate chains and mismatching private keys will no longer be allowed anywhere in Lemur code. The test vector certs were generated using the Lemur "cryptography" authority plugin. * Certificates are now more similar to real-world usage: long serial numbers, etc. * Private key is included for all certs, so it's easy to re-generate anything if needed.
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import pytest
|
||||
from datetime import datetime
|
||||
from .vectors import PRIVATE_KEY_STR
|
||||
from .vectors import SAN_CERT_KEY
|
||||
from marshmallow.exceptions import ValidationError
|
||||
|
||||
|
||||
def test_private_key(session):
|
||||
from lemur.common.validators import private_key
|
||||
|
||||
private_key(PRIVATE_KEY_STR)
|
||||
private_key(SAN_CERT_KEY)
|
||||
|
||||
with pytest.raises(ValidationError):
|
||||
private_key('invalid_private_key')
|
||||
|
Reference in New Issue
Block a user