"unknown algorithm" error
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- cryptography
Research direction
Start with the Algorithm enum and the PrivateKey::random entry point, using the Cargo.toml and main.rs example to reproduce the runtime error. Trace how algorithm features are defined and gated, then verify that an unavailable algorithm cannot compile or is otherwise rejected before the current "unknown algorithm" runtime failure.
Written by the indexing model from the issue text.
Description
Using ssh-key to create a new PrivateKey using an algorithm which doesn't have the correct crate feature enabled results in a runtime error (unknown algorithm).
The following code compiles fine but panics with an error at runtime.
# Cargo.toml
[dependencies]
ssh-key = "0.6"
// main.rs
use ssh_key::rand_core::OsRng;
use ssh_key::{Algorithm, PrivateKey};
fn main() {
let private_key = PrivateKey::random(&mut OsRng, Algorithm::Ed25519).unwrap();
dbg!(&private_key);
}
This is not very rusty. It would be much less surprising if the enum variant Ed25519 of the Algorithm enum would also be guarded by the feature that enables the algorithm.
- Dominant language
- Rust
- Stars
- 246
- Forks
- 65
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustCrypto/SSH
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
RustCrypto/SSH#596 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
RustCrypto/SSH#595 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
RustCrypto/SSH#580 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
RustCrypto/SSH#527 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
RustCrypto/SSH#475 · 10 comments · 1 reaction ·
Similar issues
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsPossibly taken @roboomp claimed this today. Openbug prio:p2 providers triaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
can1357/oh-my-pi#15798 · 3 comments ·
Maintainers usually reply within 1 day
-
requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/datafusion-comet#7001 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
builtin-port enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cmlarsen/writemorebetter#235 ·
Maintainers usually reply within 1 day
-
Add a Storybook section to CONTRIBUTING.mdPossibly taken @ChanakyaG2004 claimed this today. Opendocumentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
FlowwStar/FlowStar#995 · 2 comments ·
Maintainers usually reply within 1 day