aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* backwards incompatible change to UniformResourceIdentifier (#3954)Paul Kehrer2017-10-102-167/+166
| | | | | | | | | | | | | | | * backwards incompatible change to UniformResourceIdentifier During this release cycle we decided to officially deprecate passing U-labels to our GeneralName constructors. At first we tried changing this in a purely backwards compatible way but get_values_for_type made that untenable. This PR modifies URI to accept two types: U-label strings (which raises a deprecation warning) and A-label strings (the new preferred type). There is also a constructor for URI that bypasses validation so we can parse garbage out of certificates (and round trip it if necessary) * nonsense empty commit 2.6 and codecov are the worst
* backwards incompatible change to RFC822Name (#3953)Paul Kehrer2017-10-102-38/+47
| | | | | | | | | | | | | | | * backwards incompatible change to RFC822Name During this release cycle we decided to officially deprecate passing U-labels to our GeneralName constructors. At first we tried changing this in a purely backwards compatible way but get_values_for_type made that untenable. This PR modifies RFC822Name to accept two types: U-label strings (which raises a deprecation warning) and A-label strings (the new preferred type). There is also a constructor for RFC822Name that bypasses validation so we can parse garbage out of certificates (and round trip it if necessary) * whoops
* Backwards incompatible change to DNSName (#3951)Paul Kehrer2017-10-103-142/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Backwards incompatible change to DNSName During this release cycle we decided to officially deprecate passing U-labels to our GeneralName constructors. At first we tried changing this in a purely backwards compatible way but get_values_for_type made that untenable. This PR modifies DNSName to take three different types. U-label strings (which raises a deprecation warning), A-label strings (the new preferred type), and bytes (which are assumed to be decodable to unicode strings). The latter, while supported, is primarily intended for use by our parser and allows us to return the actual encoded data in a certificate even if it has not been properly encoded to A-label before the certificate is created. (Of course, if the certificate contains invalid utf8 sequences this will still fail, but let's handle one catastrophic failure at a time). * coverage * don't delete that asterisk from a test. it does things. * no bytes in DNSName. Private constructor for bypassing validation * test unicode in dnsname (yuck) * fix docs * empty commit, you disappoint me codecov * CI is the worst
* Add support for AES XTS (#3900)Paul Kehrer2017-10-012-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | * Add support for AES XTS We drop the non-byte aligned test vectors because according to NIST http://csrc.nist.gov/groups/STM/cavp/documents/aes/XTSVS.pdf "An implementation may support a data unit length that is not a multiple of 8 bits." OpenSSL does not support this, so we can't use those test vectors. * fix docs and pep8 * docs fix * the spellchecker is so frustrating * add note about AES 192 for XTS (it's not supported) * docs work * enforce key length on ECB mode in AES as well (thanks XTS) * a few more words about why we exclude some test vectors for XTS
* add ChaCha20 support (#3919)Paul Kehrer2017-09-281-0/+60
| | | | | | | | | | * add ChaCha20 support * review feedback * 256 divided by 8 is what again? * ...
* both parse and encode the ASN1 string type for Name attributes (#3896)Paul Kehrer2017-09-251-0/+58
| | | | | | | | | | | | | | | * both parse and encode the ASN1 string type for Name attributes Previously cryptography encoded everything (except country names) as UTF8String. This caused problems with chain building in libraries like NSS where the subject and issuer are expected to match byte-for-byte. With this change we now parse and store the ASN1 string type as a private _type in NameAttribute. We then use this to encode when issuing a new certificate. This allows the CertificateBuilder to properly construct an identical issuer and fixes the issue with NSS. * make the sentinel private too
* FreshestCRL extension support (#3937)Paul Kehrer2017-09-232-0/+259
| | | | | | | | | | * add freshest CRL support * add tests * add changelog * add tests for FreshestCRL generation
* support delta crl indicator extension (#3936)Paul Kehrer2017-09-223-0/+44
| | | This is an extension for CRLs
* parametrize a bunch of x509 extension tests that were identical (#3931)Paul Kehrer2017-09-211-377/+139
|
* implement __hash__ on DistributionPoint and CRLDistributionPoints (#3915)Paul Kehrer2017-09-131-0/+74
|
* add __hash__ to GeneralNames, SAN, IAN, and CertificateIssuer (#3916)Paul Kehrer2017-09-131-0/+34
|
* add __hash__ to PolicyConstraints and Extension (#3917)Paul Kehrer2017-09-131-0/+26
|
* implement __hash__ on KeyUsage and ExtendedKeyUsage (#3913)Paul Kehrer2017-09-131-0/+48
| | | | | | * implement __hash__ on KeyUsage and ExtendedKeyUsage * properly use private values and alter test to catch that bug
* implement __hash__ on CertificatePolicies and its child classes (#3914)Paul Kehrer2017-09-131-0/+45
|
* add aki hash (#3910)Paul Kehrer2017-09-131-1/+10
| | | | | | | | | | * Implement __hash__ on AuthorityKeyIdentifier * Adding dirname to fix build issue on AuthorityKeyIdentifier test * .authority_cert_issuer to str * use a tuple and not a str repr
* name constraints __hash__ (#3912)Paul Kehrer2017-09-131-0/+21
|
* AIA hashing (#3911)Paul Kehrer2017-09-131-0/+34
|
* fix a bug with URI value when parsing a string with no hostname (#3909)Paul Kehrer2017-09-131-4/+5
| | | | | strings of the form "scheme:///anything" would incorrectly have two slashes dropped. This is fixed in two code paths in this PR but one of those code paths will be entirely removed in a followup PR.
* implement __hash__ on all GeneralName types (#3907)Paul Kehrer2017-09-131-0/+41
| | | Needed to implement __hash__ on AuthorityKeyIdentifier
* compare against bytes values, not the U-label decoded ones (#3906)Paul Kehrer2017-09-121-0/+5
| | | | We need to add one small test to cover a case that is no longer covered with this switch.
* [WIP] add support for the TLSFeature extension in x509 (#3899)Paul Kehrer2017-09-102-0/+115
| | | | | | | | | | | | | | | | | | * add support for the TLSFeature extension in x509 This extension is used for OCSP Must-Staple. * fix changelog link * pep8 * refactor to support the sequence properly and add status_request_v2 * update some language * add test vector, implement eq/ne/hash on TLSFeature * address review comments
* RSA OAEP label support for OpenSSL 1.0.2+ (#3897)Paul Kehrer2017-09-082-14/+129
| | | | | | | | | | * RSA OAEP label support for OpenSSL 1.0.2+ * changelog * move around tests, address review feedback, use backend supported method * unsupported padding catches this now
* move x509 tests into a module (#3889)Paul Kehrer2017-09-066-12/+12
| | | | | | | | | | | * move x509 tests into a module This is just to make grouping things like test_ocsp, etc a bit simpler in the future * fix path * pep8
* add blake2b/blake2s support for hmac (#3873)Paul Kehrer2017-08-221-1/+29
| | | | | | | | | | * add blake2b/blake2s support for hmac This was a bug, but it turns out the noise protocol suggests using the HMAC construction with BLAKE2 (rather than BLAKE2's own keyed functionality) for a few reasons, so we should support it. * actually test the thing
* Add is_signature_valid method on CertificateRevocationList (#3849)Vincent Pelletier2017-08-121-0/+41
|
* deprecate unicode input for RFC822Name (#3836)Paul Kehrer2017-08-011-25/+34
| | | | | | * deprecate unicode input for RFC822Name * pep8...?
* deprecate auto-idna on UniformResourceIdentifier (#3832)Paul Kehrer2017-08-012-147/+186
| | | | | | | | | | * deprecate auto-idna on UniformResourceIdentifier * fix repr test * docs * some updated language
* Begin the deprecation of auto-idna for x509.DNSName (#3830)Alex Gaynor2017-07-303-122/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Begin the deprecation of auto-idna for x509.DNSName Refs #3357 * fix warning * py3k fixes * fix docs * sigh * flake8 * these are words * words * tests for coverage * another test * do idna things * more idna things
* remove deprecated items (#3794)Paul Kehrer2017-07-206-147/+4
| | | | | | | | | | * remove deprecated items whirlpool, ripemd160, unsupportedextension, and the old interfaces * flake8 and remove a test generator we no longe use * make it clear we warned you about these things
* Remove DH generator size constraint (#3364)mtury2017-07-171-1/+1
| | | | | | * Remove DH generator size constraint * Check that g > 1
* add AESGCM AEAD support (#3785)Paul Kehrer2017-07-171-1/+81
| | | | | | | | * add AESGCM AEAD support * remove stray newline * move AESGCM docs above CCM
* move tag_length to the AESCCM constructor (#3783)Paul Kehrer2017-07-161-20/+18
| | | | | | * move tag_length to the AESCCM constructor * review feedback
* AESCCM support (#3700)Paul Kehrer2017-07-161-6/+151
|
* allow p % 24 == 23 when generator == 2 in DH_check (#3768)Paul Kehrer2017-07-091-1/+25
| | | | | | | | | | * allow p % 24 == 23 when generator == 2 in DH_check * short url * update and expand comments * even better language!
* use an instance in aead_cipher_supported (#3772)Paul Kehrer2017-07-091-9/+15
| | | | | | | | * use an instance in aead_cipher_supported * test for chacha20poly1305 compatibility via init exception * pep8
* Fixed #3747 -- cache extensions on x.509 objects (#3769)Alex Gaynor2017-07-081-0/+47
| | | | | | | | | | * Fixed #3747 -- cache extensions on x.509 objects * be kind to cpython, save a dict lookup * flake8 * changelog
* change chacha20poly1305_supported to aead_cipher_supported (#3762)Paul Kehrer2017-07-081-2/+2
|
* don't parse SCTs on older openssl (#3749)Paul Kehrer2017-07-041-4/+27
| | | | | | | | * don't parse SCTs on older openssl * use two diff extension parsers because why not * review feedback
* disallow MD5 in CertificateBuilder and CertificateSigningRequestBuilder (#3738)Paul Kehrer2017-06-302-1/+133
| | | | | | | | | | | | * disallow MD5 in CertificateBuilder and CertificateSigningRequestBuilder * only error on ECDSA and DSA lots of duplication in tests here, bleh * remove changelog entry, also handle this for CRLBuilder * pep8
* Fixed a memory leak in EC private numbers (#3741)Alex Gaynor2017-06-301-10/+16
|
* Fix for leaking memory in EllipticCurvePublicNumbers.public_key() (#3732)Alex Gaynor2017-06-281-0/+19
| | | | | | | | | | * Test for leaking memory in EllipticCurvePublicNumbers.public_key() * Fix the memory leak As far as I can tell, from spelunking in the OpenSSL source (as you do), EC_KEY_set_public_key_affine_coordinates doesn't take ownership of "x" or "y". https://github.com/openssl/openssl/blob/master/crypto/ec/ecp_smpl.c#L362-L420 is the place in the source I found that actually uses "x" and "y". * Unused imports
* Dh parameters serialization (#3504)Aviv Palivoda2017-06-243-2/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support DH parameter serizalization - no X9.42 * Support X9.42 serialization - DER not working * Fix dhp_rfc5114_2.der Changing the DER parameters serialization after the fix in openssl commit a292c9f1b835 * DH parameters X9.42 DER serialization fixed * fix _skip_dhx_unsupported * document DH parameter_bytes * PEP8 fixes * Document load_pem_parameters * Document load_der_parameters * document ParameterFormat * Increase test coverage * Increase test covrage * Remove unneeded check * Fix typo * Fix error in load_der_parameters * Add load_pem_parameters and load_der_parameters to interfaces * CR fixes * Removed unverified phrase * Update version to 2.0 * Fix pep8 * Rename ParameterFormat.ASN1 to ParameterFormat.DHParameter * link pkcs3 * Add new line at end of file to serialization.rst * Rename DHparameters to PKCS3 * doc CR fix
* Add DERSerializationBackend to test_dh serialization tests (#3717)Aviv Palivoda2017-06-241-1/+3
|
* implement CCM vector parser (#3699)Paul Kehrer2017-06-212-3/+260
|
* ed25519 vector loader (#3707)Paul Kehrer2017-06-202-1/+110
| | | | | | * ed25519 vector loader * refactor to use unpacking
* disallow empty string for NameAttribute (#3711)Paul Kehrer2017-06-191-0/+4
|
* X25519 Support (#3686)Paul Kehrer2017-06-091-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * early days * sort of working * more things * remove private_bytes * public bytes, interface fix * load public keys * x25519 support basically done now * private_bytes is gone * some reminders * doctest this too * remove a thing that doesn't matter * x25519 supported checks * libressl has the NID, but a different API, so check for OpenSSL * pep8 * add missing coverage * update to use reasons * expand test a little * add changelog entry * review feedback
* ChaCha20Poly1305 support (#3680)Paul Kehrer2017-06-081-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * chacha20poly1305 support * add chacha20poly1305 backend and some fixes * refactor * forgot to remove this * pep8 * review feedback and a lot of type/value checking * review feedback * raise unsupportedalgorithm when creating a ChaCha20Poly1305 object if it's not supported. * switch to ciphertext||tag * typo * remove a branch we don't need * review feedback * decrypts is *also* a word * use reasons
* Refs #3461 -- parse SCTs from x.509 extension (#3480)Alex Gaynor2017-06-041-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Stub API for SCTs, feedback wanted * grr, flake8 * finish up the __init__ * Initial implementation and tests * write a test. it fails because computer * get the tests passing and fix some TODOs * changelog entry * This can go now * Put a skip in this test * grump * Removed unreachable code * moved changelog to the correct section * Use the deocrator for expressing requirements * This needs f for the right entry_type * coverage * syntax error * tests for coverage * better sct eq tests * docs * technically correct, the most useless kind of correct * typo and more details * bug * drop __eq__
* deprecate signer/verifier on asymmetric keys (#3663)Paul Kehrer2017-06-033-6/+16
| | | | | | * deprecate signer/verifier on asymmetric keys * review feedback, switch deprecated_call to work around a bug