summaryrefslogtreecommitdiff
path: root/src/OpenSSL
Commit message (Collapse)AuthorAgeFilesLines
* Expose X509_V_* constants (#1202)HEADmainItamar Turner-Trauring2023-04-281-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Expose X509_V_* constants. * Switch to strategy where cryptography 40.0.2 exposes the constants. * Fix bad merge. * Fix flake. * Link to PR. * Check availability, rather than versions. * Add namespacing. * Add success code to namespace. * Fix lint. * Remove unnecessary conditional. * Update CHANGELOG.rst Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> --------- Co-authored-by: Itamar Turner-Trauring <itamar@pythonspeed.com> Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* remove X509StoreFlags.NOTIFY_POLICY (#1213)Paul Kehrer2023-04-211-1/+0
| | | | | | | | | * remove X509StoreFlags.NOTIFY_POLICY fixes #1212 * also fix twisted * more CI fixes, sigh
* Reject invalid versions in X509Req.set_version (#1208)Alex Gaynor2023-04-011-0/+6
| | | | | | | | | | | * Reject invalid versions in X509Req.set_version * Update CHANGELOG.rst Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com> --------- Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>
* port changelog (#1205)Paul Kehrer2023-03-271-1/+8
| | | | | * port changelog * forward port the nid2sn workaround
* reopen main (#1200)Alex Gaynor2023-03-251-1/+1
|
* 23.1.0 version bump (#1196)23.1.0Alex Gaynor2023-03-241-1/+1
|
* Add support for DTLS timeouts (#1180)Jeremy Lainé2023-02-131-0/+31
| | | | | | | | | | | | Add support for DTLS timeouts When performing a DTLS handshake, the DTLS state machine may need to be updated based on the passage of time, for instance in response to packet loss. OpenSSL supports this by means of the `DTLSv1_get_timeout` and `DTLSv1_handle_timeout` methods, both of which are included in cryptography's bindings. This change adds Python wrappers for these methods in the `Connection` class.
* Fix CI (#1185)Maximilian Hils2023-02-132-3/+0
| | | | | * Reformat code using black 23.x * fix compat with tox 4
* Reopen main (#1176)Alex Gaynor2023-01-021-1/+1
|
* 23.0.0 version bump (#1175)23.0.0Alex Gaynor2023-01-021-2/+2
|
* fixes #1173 (#1174)Alex Gaynor2022-12-291-1/+2
| | | | | | | * fixes #1173 make the x509extension docs more clear * Update crypto.py
* Fix CRL nextUpdate handling. (#1169)David Benjamin2022-12-161-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix CRL nextUpdate handling. When setting the nextUpdate field of a CRL, this code grabbed the nextUpdate ASN1_TIME field from the CRL and set its time. But nextUpdate is optional in a CRL so that field is usually NULL. But OpenSSL's ASN1_TIME_set_string succeeds when the destination argument is NULL, so it was silently a no-op. Given that, the call in a test to set the nextUpdate field suddenly starts working and sets the time to 2018, thus causing the CRL to be considered expired and breaking the test. So this change also changes the expiry year far into the future. Additionally, the other CRL and Revoked setters violate const in the API. Fixes #1168. * Replace self-check with an assert for coverage * Update src/OpenSSL/crypto.py Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* Fix some memory leaks in CRL.export (#1170)David Benjamin2022-12-161-8/+11
| | | | The bio was never freed, or used. sometime is never freed. While I'm here, check return values for all the functions called here.
* Add support for X509_V_FLAG_PARTIAL_CHAIN (#1166)vEpiphyte2022-12-151-0/+1
| | | | | | | | | * Add support for X509_V_FLAG_PARTIAL_CHAIN * Remove unneeded import * Update changelog to add PR number. * Fix whitespace issue identified by black
* style cleanups from recent PR (#1159)Alex Gaynor2022-10-211-6/+3
| | | don't leave comment out code, and use append rather than += on lists
* add attributes only conditionally (#1158)Ben Greiner2022-10-221-3/+6
| | | | | * add attributes only conditionally * fix flake8
* Reopen main (#1149)Alex Gaynor2022-09-251-1/+1
|
* Bump for 22.1.0 release (#1148)22.1.0Alex Gaynor2022-09-251-2/+2
|
* add `Connection.use_(certificate|privatekey)` (#1121)Maximilian Hils2022-09-161-0/+32
| | | | | | | | | | | * add `Connection.use_(certificate|privatekey)` * bump minimum cryptography version * deduplicate tests * black! * max line length
* Move away from the SSLEAY name (#1144)Alex Gaynor2022-09-161-8/+16
|
* Switch to the new utils.deprecation spelling (#1140)David Benjamin2022-08-131-2/+4
| | | | | | | | | | | | * Switch to the new utils.deprecation spelling The new spelling was introduced in https://github.com/pyca/cryptography/pull/6923 and is more friendly to type checkers. Version-wise, that PR appears to be in cryptography 37.0.0, which is now beyond the minimum version for pyOpenSSL. * reformat
* Fix docs in `SSL.Context.get_alpn_proto_negotiated` (#1137)Nikita Sobolev2022-07-231-1/+1
|
* Make `X509StoreContextError`'s message friendlier (#1133)William Woodruff2022-07-071-7/+11
| | | | | | | | | | | | | | | | | | | * OpenSSL/crypto: make X509StoreContextError's message friendlier Closes #1132. Signed-off-by: William Woodruff <william@trailofbits.com> * tests: update exception tests Signed-off-by: William Woodruff <william@trailofbits.com> * OpenSSL/crypto: blacken Signed-off-by: William Woodruff <william@trailofbits.com> * CHANGELOG: record changes Signed-off-by: William Woodruff <william@trailofbits.com>
* Fix incorrect documentation on X509Req.set_version #1130 (#1131)Amir Omidi2022-06-281-1/+1
|
* Expose SSL_OP_IGNORE_UNEXPECTED_EOF (#1127)dreid2022-06-091-0/+6
| | | This was added to pyca/cryptography at https://github.com/pyca/cryptography/commit/0fe4583d40b0a99feecc1dc33f96fa15002b443f
* Add inline type annotations (#1089)lovetox2022-05-203-201/+285
| | | | | | | | | | | | | | | | | * crypto: Add type annotations * Don’t redefine var mypy complains about the redefinition * _util: Add type annotations * rand: Add type annotations * Prepare package & CI for running mypy * fix toxenv name Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Handle no expire date in X509.has_expire() (#1083)lovetox2022-05-131-1/+4
| | | | | | get_notAfter() can return None. Instead of raising a NoneType error, raise a ValueError which tells us why it failed.
* add `Connection.set_verify`, fix #255 (#1073)Maximilian Hils2022-05-131-0/+29
| | | | | | | | | | | * add `Connection.set_verify`, fix #255 * show that it works with cryptography main * Revert "show that it works with cryptography main" This reverts commit fb0136a8e5aa5d2c6e0c16f8f4ecee2f3c72a16b. * make it black
* Fix X.509 version handling. (#1123)David Benjamin2022-05-121-1/+1
| | | | | | | | | | | | | | | | | Certificate versions go up to v3 (numeric value 2), CRLs go up to v2 (numeric value 1), and CSRs go up to v1 (numeric value 0). This CL fixes the following issues: - Add a missing check to the return value of X509_set_version - Fix crlDataUnsupportedExtension which had an invalid CRL version. - Switch TestX509.test_version to test valid versions, so it doesn't prevent OpenSSL or an OpenSSL derivative from checking for invalid versions. - Make TestX509Req.test_version tolerate set_version(1) failing on CSRs. Since there's nothing useful to test otherwise, I've made the test work for either possible backend behavior.
* repair CI (#1116)Paul Kehrer2022-05-111-0/+18
| | | | | | | | | | | | | | | | | | | | | * repair CI * more fixes * pypy39 requires latest cryptography * Apply suggestions from code review Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> * use constant * bump minimum version * remove unneeded try * fix Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* Remove SSL_library_init call (#1110)Alex Gaynor2022-03-211-5/+0
| | | | a) It's already called by initializing the Bindings in cryptography b) I'm pretty sure it's not actually necessary at all
* Implement Context constructor in terms of new OpenSSL APIs (#1109)Alex Gaynor2022-03-141-22/+14
|
* remove more global initialization that isn't required on modern openssl (#1108)Alex Gaynor2022-03-131-16/+0
|
* Remove call that hasn't been required since OpenSSL 1.1.0 (#1107)Alex Gaynor2022-03-131-5/+0
|
* Changed load_crl doc comment return to CRL (#1105)Oscar Mattsson2022-03-031-1/+1
|
* flake8-import-order (#1099)whiteowl32022-03-024-14/+16
| | | | | | | | | | | * flake8-import-order * make sure bad import orders fail * flake8-import-order * add application name to flake8 section * correct import order for openssl as application
* don't block ec/ed keys from_cryptography_key() (#1096)whiteowl32022-02-261-2/+11
| | | | | | | * don't block ec/ed keys from_cryptography_key() * clean up test comments * properly describe test
* Stop passing backend to cryptography (#1094)Alex Gaynor2022-02-131-23/+5
|
* Use a non-deprecated OpeNSSL function (#1093)Alex Gaynor2022-02-131-4/+4
|
* X509Name: Raise AttributeError correctly (#1088)lovetox2022-01-301-1/+1
| | | | | | | X509Name does only inherit from object, which has no __getattr__() method. By accident this also raised an AttributeError but the error message is confusing. This commit now raises the AttributeError with a descriptive message.
* X509Name: Use functools.totalordering for comparisons (#1086)lovetox2022-01-301-16/+10
| | | | | | | | | | | * X509Name: Use functools.totalordering for comparisons - Reduce the magic - Make it more readable - Make it easier to add type annotations in the future * Correctly return NotImplemented * Add new comparison test case
* Don’t inherit from object (#1084)lovetox2022-01-302-20/+20
| | | In python3 all classes inherit by default from object
* Remove superfluous isinstance() call (#1087)lovetox2022-01-301-3/+2
| | | | - hex() returns always str - don’t redefine variable
* latest black (#1082)Paul Kehrer2022-01-291-1/+1
|
* bump to 22.1.0.dev (#1080)Paul Kehrer2022-01-291-1/+1
|
* bump for 22.0.0 release (#1079)22.0.0Paul Kehrer2022-01-291-1/+1
|
* Docs: Fix param type for methods where digest is used (#1078)lovetox2022-01-291-5/+5
|
* Update variable name, there are now many linuxes (#1070)Alex Gaynor2021-12-241-4/+4
|
* Rename path_string to path_bytes since that's what it actually does (#1067)Alex Gaynor2021-12-203-17/+17
|
* Remove native, it's behavior is confusing (#1069)Alex Gaynor2021-12-203-34/+13
| | | Instead just decode stuff at the call-sites -- 100% of which were passing bytes