Adding RSA Support to swift-nio-ssh
Not investment advice. Muhabbit scores how much a story may matter, not which way to trade.
LogRaker has vendored a fork of swift-nio-ssh to add RSA support, closing a gap that left the SSH library unable to use PKCS#1 RSA key pairs—including those Amazon EC2 issued by default before adding ed25519 keys in 2021. Because NIOSSHPrivateKey stores keys in an internal enum with no public extension point, the change required editing the module across eight files, including Package.swift to pull in _RSA.Signing from swift-crypto's CryptoExtras product, five sources under Sources/NIOSSH/, and one upstream test. The critical fix addresses RSA's split between the key blob tag (ssh-rsa) and the signature algorithm name (rsa-sha2-256 or rsa-sha2-512 per RFC 8332), since the bare ssh-rsa name implies SHA-1, which OpenSSH 8.8 disabled by default in 2021. The fork adds a signatureAlgorithmName property alongside keyPrefix, and the algorithm name must match byte-for-byte in both SSHMessages.swift (the wire message) and UserAuthSignablePayload.swift (the signed buffer), or servers reject otherwise valid signatures. The change matters because a log viewer that cannot use the key already sitting in ~/.ssh/ is not useful, and any client-side workaround is impossible given EC2's non-negotiable key format. Watch for whether upstream swift-nio-ssh accepts the RSA addition or continues to steer new deployments toward ed25519.
Muhabbit's AI wrote this summary in its own words from Hacker News's report. It can get details wrong, so check the source.
Named in this story
swift-nio-ssh, LogRaker, Amazon EC2, swift-crypto