aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Make DER reader into a context manager (#4957)Alex Gaynor2019-07-283-17/+22
| | | | | | | | * Make DER reader into a context manager * Added another test case * flake8
* Remove asn1crypto dependency (#4941)David Benjamin2019-07-285-34/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove non-test dependencies on asn1crypto. cryptography.io actually contains two OpenSSL bindings right now, the expected cffi one, and an optional one hidden in asn1crypto. asn1crypto contains a lot of things that cryptography.io doesn't use, including a BER parser and a hand-rolled and not constant-time EC implementation. Instead, check in a much small DER-only parser in cryptography/hazmat. A quick benchmark suggests this parser is also faster than asn1crypto: from __future__ import absolute_import, division, print_function import timeit print(timeit.timeit( "decode_dss_signature(sig)", setup=r""" from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature sig=b"\x30\x2d\x02\x15\x00\xb5\xaf\x30\x78\x67\xfb\x8b\x54\x39\x00\x13\xcc\x67\x02\x0d\xdf\x1f\x2c\x0b\x81\x02\x14\x62\x0d\x3b\x22\xab\x50\x31\x44\x0c\x3e\x35\xea\xb6\xf4\x81\x29\x8f\x9e\x9f\x08" """, number=10000)) Python 2.7: asn1crypto: 0.25 _der.py: 0.098 Python 3.5: asn1crypto: 0.17 _der.py: 0.10 * Remove test dependencies on asn1crypto. The remaining use of asn1crypto was some sanity-checking of Certificates. Add a minimal X.509 parser to extract the relevant fields. * Add a read_single_element helper function. The outermost read is a little tedious. * Address flake8 warnings * Fix test for long-form vs short-form lengths. Testing a zero length trips both this check and the non-minimal long form check. Use a one-byte length to cover the missing branch. * Remove support for negative integers. These never come up in valid signatures. Note, however, this does change public API. * Update src/cryptography/hazmat/primitives/asymmetric/utils.py Co-Authored-By: Alex Gaynor <alex.gaynor@gmail.com> * Review comments * Avoid hardcoding the serialization of NULL in decode_asn1.py too.
* fix osrandom/builtin switching methods for 1.1.0+ (#4955)Paul Kehrer2019-07-272-7/+9
| | | | | | | | | | * fix osrandom/builtin switching methods for 1.1.0+ In 1.1.0 RAND_cleanup became a no-op. This broke changing to the builtin random engine via activate_builtin_random(). Fixed by directly calling RAND_set_rand_method. This works on 1.0.x and 1.1.x * missed an assert
* add bindings to parse and create challenge passwords in X509 CSRs (#4943)Paul Kehrer2019-07-092-1/+11
| | | | | | * add bindings to parse and create challenge passwords in X509 CSRs * moved away from the 1.1.0 section
* add class methods for poly1305 sign verify operations (#4932)Jeff Yang2019-07-081-0/+12
|
* ed25519 support in x509 certificate builder (#4937)Paul Kehrer2019-07-063-7/+23
| | | | | | | | | | * ed25519 support in x509 certificate builder This adds minimal ed25519 support. More to come. * Apply suggestions from code review Co-Authored-By: Alex Gaynor <alex.gaynor@gmail.com>
* Refs #4923; deprecate OpenSSL 1.0.1 (#4924)Alex Gaynor2019-06-151-1/+1
| | | | | | * Refs #4923; deprecate OpenSSL 1.0.1 * changelog
* Switch to new notBefore/After APIs (#4914)Rosen Penev2019-06-073-4/+13
| | | Introduced in OpenSSL 1.1. Added compatibility for older versions.
* Only EVP_CTRL_AEAD_SET_TAG in _aead_setup for CCM mode (#4916)Christian Heimes2019-06-051-1/+2
|
* reopen master for 2.8 (#4906)Paul Kehrer2019-05-301-1/+1
| | | | | | | | * reopen master for 2.8 also add the missing changelog * sigh, empty commit to trigger azure pipelines
* bump for 2.7 release (#4903)Paul Kehrer2019-05-301-1/+1
|
* add name for ExtensionOID.PRECERT_POISON (#4853)redshiftzero2019-05-191-0/+1
| | | | | | | | * test: ensure all public members of ExtensionOID have names defined * add name for ExtensionOID.PRECERT_POISON ref: https://github.com/google/certificate-transparency/blob/5fce65cb60cfe7808afc98de23c7dd5ddbfa1509/python/ct/crypto/asn1/oid.py#L338
* fix aia encoding memory leak (#4889)Paul Kehrer2019-05-181-12/+15
| | | | | | * fix aia encoding memory leak * don't return anything from the prealloc func
* add BIO_free_all (#4874)Dominic Chen2019-05-061-0/+1
|
* fix from_issuer_subject_key_identifier to take the right type (#4864)Paul Kehrer2019-05-042-1/+16
| | | | | | | | | | * fix from_issuer_subject_key_identifier to take the right type deprecate passing the old Extension wrapper object * don't use a try:except: * hilarious contortions to satisfy doc8
* Use generic DTLS functions added in LibreSSL 2.9.1 (#4855)Charlie Li2019-04-232-3/+9
| | | | | | | | | | * Use generic DTLS functions added in LibreSSL 2.9.1 While here, bump travis. * Remove LibreSSL 2.9.0 from travis now that 2.9.1 exists. Requested by: @reaperhulk
* 4810 bugfix: avoid UnicodeEncodeError on python 2 (#4846)redshiftzero2019-04-161-1/+4
| | | | | | | | * test: regression test for UnicodeEncodeError in x509 name in #4810 added utf8 encoding at the top of the file due to PEP 263 * bugfix: #4810 resolve UnicodeEncodeError in x509 name
* Fixes #4830 -- handle negative serial numbers (#4843)Alex Gaynor2019-04-131-1/+4
|
* fix a memory leak in AIA parsing (#4836)Paul Kehrer2019-04-112-1/+11
| | | | | | * fix a memory leak in AIA parsing * oops can't remove that
* Added BN_is_negative -- refs #4830 (#4831)Alex Gaynor2019-04-051-0/+1
|
* fix != comparison in py2 (fixes #4821) (#4822)Mathias Ertl2019-03-251-0/+6
| | | | | | | | * fix != comparison in py2 (fixes #4821) * remove blank line b/c pep8 * move __ne__ next to __eq__ as per review request
* implement eq__, __hash__ and __repr__ for OCSPNoCheck and PrecertPoison (#4819)Mathias Ertl2019-03-251-0/+24
|
* Try to use getrandom even in manylinux1 wheels (#4816)Alex Gaynor2019-03-191-0/+12
| | | | | | * Try to use getrandom even in manylinux1 wheels * typo
* add new branch for unsupported openssh serialization (#4813)Paul Kehrer2019-03-181-2/+5
| | | | | we don't support ed448 openssh keys so we'll use that to test this branch. if we ever do support ed448 keys we can always just call this private method directly to keep coverage.
* add OpenSSH serialization for ed25519 keys (#4808) (#4811)bernhl2019-03-171-0/+7
| | | | | | * add OpenSSH serialization for ed25519 keys (#4808) * address review comments
* poly1305 support (#4802)Paul Kehrer2019-03-094-0/+117
| | | | | | | | | | | | | | | | | | | | * poly1305 support * some more tests * have I mentioned how bad the spellchecker is? * doc improvements * EVP_PKEY_new_raw_private_key copies the key but that's not documented Let's assume that might change and be very defensive * review feedback * add a test that fails on a tag of the correct length but wrong value * docs improvements
* Improve deprecation warning to specify the release (#4804)Josh Soref2019-03-081-2/+2
|
* remove maccontext (#4803)Paul Kehrer2019-03-076-47/+6
|
* add poly1305 NID/EVP, and EVP_DigestSign{Update,Final} for incremental (#4799)Paul Kehrer2019-03-073-0/+25
|
* Reopen master for 2.7 (#4788)Alex Gaynor2019-02-281-1/+1
|
* 2.6.1 release with fixed wheels (#4792)Alex Gaynor2019-02-281-1/+1
|
* bump version and update changelog for 2.6 release (#4787)Paul Kehrer2019-02-271-1/+1
| | | | | | * bump version and update changelog for 2.6 release * 1.1.1b wheels for 2.6
* support ed25519 openssh public keys (#4785)Paul Kehrer2019-02-274-9/+21
| | | | | | * support ed25519 openssh public keys * don't need this check
* ed448 support (#4610)Paul Kehrer2019-02-273-0/+276
| | | | | | | | * ed448 support * move the changelog entry * flake8
* ed25519 support (#4114)Paul Kehrer2019-02-264-0/+281
| | | | | | * ed25519 support * review feedback
* remove unused x509 bindings (#4776)Paul Kehrer2019-02-261-87/+1
|
* remove unused locking functions (#4780)Paul Kehrer2019-02-262-29/+2
| | | | | | | | * remove unused locking functions we do all this in C when necessary * oops, need this
* remove unused DH bindings (#4779)Paul Kehrer2019-02-261-7/+0
|
* remove unused PEM bindings (#4778)Paul Kehrer2019-02-261-10/+0
|
* how about we have less NIDs (#4777)Paul Kehrer2019-02-261-204/+0
| | | | | | * how about we have less NIDs * pyopenssl needs these two NIDs still
* strip out unused EVP functions (#4775)Paul Kehrer2019-02-261-51/+0
|
* Remove unused constant binding from ecdh.py (#4774)Alex Gaynor2019-02-261-3/+0
|
* Remove unused constant from ec.py bindings (#4773)Alex Gaynor2019-02-261-3/+0
|
* Remove unused bindings from aes.py (#4772)Alex Gaynor2019-02-261-7/+1
|
* Removed unused constant from bindings (#4771)Alex Gaynor2019-02-261-2/+0
|
* Polish off removal of unused engine bindings (#4769)Alex Gaynor2019-02-252-15/+0
|
* reduce our engine bindings even more (#4768)Paul Kehrer2019-02-255-110/+28
|
* support NO_ENGINE (#4763)Paul Kehrer2019-02-255-11/+122
| | | | | | | | * support OPENSSL_NO_ENGINE * support some new openssl config args * sigh
* Remove a bunch of unused engine bindings (#4766)Alex Gaynor2019-02-251-61/+0
|
* why did we have these variables (#4764)Paul Kehrer2019-02-242-3/+1
|