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:
Marti Raudsepp
2018-06-25 18:42:18 +03:00
parent acd2701fa2
commit 1f0f432327
13 changed files with 310 additions and 182 deletions

View File

@ -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')