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

Accept ed25519 and other common SSH Keys #200

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

bobbykdhan
Copy link
Contributor

@bobbykdhan bobbykdhan commented Dec 19, 2023

#199 Here you go @jabbate19

Updated the regex expression to accept other common ssh keys besides RSA

@jabbate19
Copy link
Collaborator

Fixes #199

Copy link
Collaborator

@jabbate19 jabbate19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works for letter only types, but there are other big ones (ed25519)

Copy link
Collaborator

@jabbate19 jabbate19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Does not fix ed25519 or other algorithms with numbers in the spec

@@ -223,7 +223,7 @@ $("#create-vm").click(function(){
const max_cpu = $(this).data('max_cpu');
const max_mem = $(this).data('max_mem');
const max_disk = $(this).data('max_disk');
var ssh_regex = new RegExp("ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3}( [^@]+@[^@]+)?")
var ssh_regex = new RegExp("ssh-[a-z]+ AAAA[0-9A-Za-z+/]+[=]{0,3}( [^@]+@[^@]+)?");;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two semicolon?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was in the original

Copy link
Collaborator

@jabbate19 jabbate19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@@ -223,7 +223,7 @@ $("#create-vm").click(function(){
const max_cpu = $(this).data('max_cpu');
const max_mem = $(this).data('max_mem');
const max_disk = $(this).data('max_disk');
var ssh_regex = new RegExp("ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3}( [^@]+@[^@]+)?")
var ssh_regex = new RegExp("ssh-[a-z0-9]+ AAAA[0-9A-Za-z+/]+[=]{0,3}( [^@]+@[^@]+)?");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't match security keys created with a hardware auth key (yubikey, solokey, etc)

@jabbate19 jabbate19 merged commit 3bad35d into ComputerScienceHouse:master Mar 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants