Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check ssh public keys correctly #634

Merged
merged 1 commit into from Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -122,7 +122,8 @@ abstract class SshnpdChannel with AsyncInitialization, AtClientBindings {
logger.info('Sharing public key with sshnpd');
try {
logger.info('sharing ssh public key: $publicKeyContents');
if (!publicKeyContents.startsWith('ssh-')) {
// Check for Supported ssh keypairs from dartssh2 package
if (!publicKeyContents.startsWith(RegExp(r'^(ecdsa-sha2-nistp)|(rsa-sha2-)|(ssh-rsa)|(ssh-ed25519)|(ecdsa-sha2-nistp)'))) {
logger.severe('SSH Public Key does not look like a public key file');
throw ('SSH Public Key does not look like a public key file');
}
Expand Down