Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the test-key regeneration script to distinguish “legacy” RSA keys (ssh-rsa) from “modern” RSA-SHA2 (rsa-sha2-256) so the integration test assets can be regenerated with the intended algorithm identifiers (follow-up to #1314’s RSA-SHA2 cert behavior work).
Changes:
- Switch RSA-related
ssh-keygeninvocations intests/keys-generate.shfrom genericrsato explicitssh-rsafor legacy keys. - Add a distinct generator command intended to produce an RSA-SHA2-256 variant (
-t rsa-sha2-256) for the “sha2_256” signed key.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The committed key was in reality `rsa-sha2-512`, not `rsa-sha2-256`, as the filenames suggested. Also set the type explicitly to `rsa-sha2-512`, to avoid relying on ssh-keygen's default (`rsa-sha2-512`). ```shell $ grep -E -o ' .+ ' id_rsa_sha2_512_signed-cert.pub | base64 -d | strings | grep -i rsa ``` Bug: #2474 Follow-up to 3a6ab70 #1314 Closes #2479
|
Slightly related observation: it'd be immensly helpful if the test log Another observation: the cert-based keys have the username |
id_rsa_signed.pub to match its intended purpose
id_rsa_signed.pub to match its intended purposeid_rsa_signed.pub to match intent, fix sshd_config to accept it
id_rsa_signed.pub to match intent, fix sshd_config to accept itid_rsa_signed.pub to match intent, fix sshd_config to accept it
Explicitly use
-t ssh-rsa(signature algorithm) to generateid_rsa_signed.pubto match the purpose of the patch it came with. Alsoto differenciate this key (and test) from the subsequently merged
id_rsa_sha2_512_signed-cert.pub, which used the exact same keys (-t rsa-sha2-512, the default) before this patch, and made these testsduplicates.
Also:
sshd_configto actually allow using an obsolete/insecurecertificate signature
ssh-rsa, by adding it toCASignatureAlgorithms.HostKeyAlgorithms, it was notnecessary.
Follow-up to 5b494b0 sshd_config: enable
[email protected]more #2478Testing obsolete/insecure algs is not time best spent in CI and for
maintainers, so maybe in a next step it'd useful to disable the RSA
SHA1-based ones by default.
Ref: https://superuser.com/questions/1556852/how-to-check-if-your-ssh-keys-are-in-the-ssh-rsa2-format
Ref: 7392dc9 #2479
Follow-up to 4b21e49 #710
Trying to untangle this, some info:
id_rsa_signed-cert.pubwasrsa-sha2-512without the original patch mentioning this, and thetest_auth_pubkey_ok_rsa_signedtests breaks when switching it tossh-rsa.id_rsa_sha2_256_signed-cert.pubis also sha2, but contrary to its name, it isrsa-sha2-512. (rsa-sha2-512is the default in ssh-keygen).This is visible in the base64-decoded content of these files.