Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ssh-key: Avoid writing to tests/examples/ in unit tests

Open Beginner friendly
#595 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
testing

Research direction

The affected tests are encode_ecdsa_p256_openssh, encode_ecdsa_p384_openssh, encode_ecdsa_p521_openssh, encode_ed25519_openssh, encode_rsa_3072_openssh, and encode_rsa_4096_openssh; the issue does not name their file. Read those tests and check how they choose output paths. Change them to write under CARGO_TARGET_DIR or a temporary directory, then verify they no longer write to tests/examples/.

Written by the indexing model from the issue text.

Description

Hello!

The following tests currently write into the source code directory:

 encode_ecdsa_p256_openssh
 encode_ecdsa_p384_openssh
 encode_ecdsa_p521_openssh
 encode_ed25519_openssh
 encode_rsa_3072_openssh
 encode_rsa_4096_openssh

This works fine when working from a git checkout, but in Debian autopkgtests, this directory is root owned and can't be written to.

Instead, the following could be used:

  • A subdirectory in CARGO_TARGET_DIR
  • A temporary directory like mktemp -d
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RustCrypto/SSH

All issues in RustCrypto/SSH

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.