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

remove pkcs8 file loading functions #208

Merged
merged 1 commit into from
Feb 14, 2024
Merged

remove pkcs8 file loading functions #208

merged 1 commit into from
Feb 14, 2024

Conversation

Geal
Copy link
Contributor

@Geal Geal commented Feb 13, 2024

We made a mistake when merging #204, that feature can't compile right now, because it needs the std feature active on the e25519 crate. That features requires std::fs, which may not work easily in other target platforms like web assembly.
It is reasonably easy to load a file manually in rust and pass a buffer, so I propose we remove those functions entirely.

cc @baranyildirim

@Geal Geal requested a review from divarvel February 13, 2024 21:56
Copy link
Collaborator

@divarvel divarvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

@baranyildirim
Copy link
Contributor

Hey folks, does the gating behind the feature not work here?

@Geal
Copy link
Contributor Author

Geal commented Feb 13, 2024

The gating works, but when activating the pem feature, the library does not compile

@baranyildirim
Copy link
Contributor

baranyildirim commented Feb 13, 2024

The gating works, but when activating the pem feature, the library does not compile

Oh, should we fix forward instead? It sounds like we need to make the pem feature enable the other features that would enable std::fs.

I think pkcs8 is a pretty common format, but I can make my own workaround. Feel free to revert.

@Geal
Copy link
Contributor Author

Geal commented Feb 13, 2024

What I'm proposing in this format keeps the pem and der loading from buffers, but not the functions to load from file, because to activate files I would then have to add a second feature gate to the router, since file loading would not make sense in other platforms like wasm.
If you have the functions to load from a buffer, loading from a file is not too far, that's a reasonable tradeoff

@baranyildirim
Copy link
Contributor

baranyildirim commented Feb 14, 2024

Sounds good. I think a pkcs8 PEM file is quite common (easier to use interface), but I don’t mind the change. If we can gate pem + std::fs together that would be awesome, but I'm not quite sure how to do that. Sorry for breaking the build.

@Geal Geal merged commit 8fc071f into main Feb 14, 2024
2 checks passed
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.

3 participants