Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rustls] identity: handle elliptic curve private keys #1526

Conversation

flavio
Copy link
Contributor

@flavio flavio commented Apr 14, 2022

This commit improves the user experience of the users leveraging rustls.

When building the identity to use for requests, it's now possible to use also private keys using Elliptic Curve that are encoded with SEC1 standard.

This is the default encoding used by openssl when EC keys are created. Prior to this commit users had to convert those keys from the SEC1 encoding to the PKCS 8 one, which is something not trivial.

This feature has been recently added to rustls-pemfile crate. This commit update the rustls-pemfile crate to its latest stable release.

I also had to change a little the code used to extract the private keys from the PEM file. That's because rustls-pemfile doens't provide a high level API that extracts Elliptic Curve keys.

@seanmonstar
Copy link
Owner

Thanks for the PR! I'm generally pro on this addition. I'm starting to worry about a bunch of this TLS code that doesn't really have tests, but that's not the fault of this PR. More just me worrying... Anyways, I think this just needs a rebase, since I already merged a different PR that updated the dependency version.

This commit improves the user experience of the users leveraging rustls.

When building the identity to use for requests, it's now possible to use
also private keys using Elliptic Curve that are encoded with SEC1
standard.

This is the default encoding used by openssl when EC keys are created.
Prior to this commit users had to convert those keys from the SEC1
encoding to the PKCS 8 one, which is something not trivial.

This feature has been recently added to rustls-pemfile crate.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio flavio force-pushed the rustls-identity-handle-elliptic-curve-private-keys branch from 96704eb to 1fac3cd Compare April 15, 2022 08:30
@flavio
Copy link
Contributor Author

flavio commented Apr 15, 2022

Thanks for the PR! I'm generally pro on this addition. I'm starting to worry about a bunch of this TLS code that doesn't really have tests, but that's not the fault of this PR. More just me worrying...

I get it... thanks for being positive about this PR

Anyways, I think this just needs a rebase, since I already merged a different PR that updated the dependency version.

Done

@seanmonstar seanmonstar merged commit 2e5debe into seanmonstar:master Apr 15, 2022
flavio added a commit to flavio/krew-wasm that referenced this pull request Apr 20, 2022
This is required to include the fix merged upstream inside of seanmonstar/reqwest#1526

Thanks to this fix, krew-wasm can cannot to kubernetes clients that are
using elliptic curve keys to authenticate users (such as k3s and k3d).

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
flavio added a commit to flavio/krew-wasm that referenced this pull request Apr 20, 2022
This is required to include the fix merged upstream inside of seanmonstar/reqwest#1526

Thanks to this fix, krew-wasm can cannot to kubernetes clients that are
using elliptic curve keys to authenticate users (such as k3s and k3d).

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Nutomic pushed a commit to Nutomic/reqwest that referenced this pull request Nov 7, 2024
This commit improves the user experience of the users leveraging rustls.

When building the identity to use for requests, it's now possible to use
also private keys using Elliptic Curve that are encoded with SEC1
standard.

This is the default encoding used by openssl when EC keys are created.
Prior to this commit users had to convert those keys from the SEC1
encoding to the PKCS 8 one, which is something not trivial.

This feature has been recently added to rustls-pemfile crate.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants