-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ECDSA keys and use them by default (#563)
* Implement ECDSA keys and use them by default ECDSA keys can be generated an order of magnitude faster than RSA keys. This commit adds an implementation for ECDSA, and adds parameters to CA.__init__, CA.issue_certificate and CA.create_child_ca. The default is ECDSA, given that OpenSSL and browsers support this for at least 10 years. This also adds an option to the cli to switch between RSA and ECDSA. The basic test and the SSL server test have been parametrized over both types of keys. This ensures that RSA support is not accidentally broken, while keeping most of the tests fast. * Drop types-cryptography in lint Cryptography provides types since version 3.4.4 and the relevant interfaces have been typed since version 35.0.0 * Remove check on keytype when loading from file This would be a breaking change and it makes codecov happier. This could be reintroduced in the future using a larger set of allowed keys, for example using cryptography.hazmat.primitives.asymmetric.types.CertificatePublicKeyTypes. * Add newsfragment for ECDSA feature * Add no cover else branch to _generate_key There doesn't seem to be a way to tell coverage to ignore the the case when nothing matches in a if-elif group. --------- Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
- Loading branch information
1 parent
a3e352a
commit 1571357
Showing
7 changed files
with
88 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
mypy==0.910 | ||
# TODO: Switch to cryptography>=35.0.0 once it's released. | ||
types-cryptography>=3.3.3 | ||
cryptography>=35.0.0 | ||
types-pyopenssl>=20.0.4 | ||
pytest>=6.2 | ||
idna>=3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for ECDSA keys in certificates. The type of key used for certificates can be controlled by the `key_type` parameter on the multiple methods that generate certificates. By default trustme will generate ECDSA certificates as they can be generated significantly faster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters