ssh-keygen
The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not ssh-keygen’s official test suite, and the ssh-keygen project is not affiliated with atago.
Summary #
1 suite · 6 scenarios
Contents #
- ssh-keygen (OpenSSH key generation) — 6 scenarios
ssh-keygen (OpenSSH key generation) #
Source: test/e2e/thirdparty/ssh-keygen/ssh-keygen.atago.yaml
Scenario: non-interactive generation writes the key pair #
only when command -v ssh-keygen succeeds
When #
ssh-keygen -t ed25519 -N '' -f key -C test@atago
Then #
- exit code is
0 - file
keyexists - file
key.pubexists - file
key.pubcontainsssh-ed25519 - file
key.pubis checked
Generated artifacts #
keykey.pub
Scenario: the fingerprint contract is exact #
only when command -v ssh-keygen succeeds
When #
ssh-keygen -t ed25519 -N '' -f key -C test@atago
ssh-keygen -lf key.pub
Then #
- after
ssh-keygen -t ed25519 -N '' -f key -C test@atago:- exit code is
0
- exit code is
- after
ssh-keygen -lf key.pub:- exit code is
0 - stdout matches
/(?m)^256 SHA256:[A-Za-z0-9+/]+ test@atago \(ED25519\)$/
- exit code is
Scenario: -y regenerates the public key from the private key #
only when command -v ssh-keygen succeeds
When #
ssh-keygen -t ed25519 -N '' -f key -C test@atago
ssh-keygen -y -f key
Then #
- after
ssh-keygen -t ed25519 -N '' -f key -C test@atago:- exit code is
0
- exit code is
- after
ssh-keygen -y -f key:- exit code is
0 - stdout contains
ssh-ed25519
- exit code is
Scenario: -y on a corrupted key file fails #
only when command -v ssh-keygen succeeds
Given #
- Fixture file
corruptis created.
Inputs #
Fixture corrupt:
this is not a private key
When #
chmod 600 corrupt && ssh-keygen -y -f corrupt
Then #
- exit code is one of
255,1 - stderr contains
error in libcrypto
Scenario: interactive passphrase generation prompts twice #
only when command -v ssh-keygen succeeds · skipped on Windows
When #
# interactive (pty): ssh-keygen -t ed25519 -f protected -C test@atago
ssh-keygen -y -P "$PASSPHRASE" -f protected
Then #
- exit code is
0 - file
protectedexists - file
protected.pubexists - file
protected.pubcontainsssh-ed25519 - exit code is
0 - stdout contains
ssh-ed25519
Generated artifacts #
protectedprotected.pub
Scenario: the wrong passphrase is rejected #
only when command -v ssh-keygen succeeds · skipped on Windows
When #
# interactive (pty): ssh-keygen -t ed25519 -f protected -C test@atago
ssh-keygen -y -P definitely-not-the-passphrase -f protected
Then #
- exit code is
0 - exit code is one of
255,1 - stderr contains
incorrect passphrase