Skip to content

Commit

Permalink
Escape dots in regex patterns for ssh algorithms
Browse files Browse the repository at this point in the history
Co-authored-by: Stéphane Lesimple <[email protected]>
  • Loading branch information
P-EB and speed47 committed Mar 27, 2024
1 parent 0ed6ef8 commit db5113c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/perl/OVH/Bastion/ssh.inc
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ sub get_ssh_pub_key_info {

my ($prefix, $typecode, $base64, $comment);
if ($pubKey =~
m{^\s*((\S+)\s+)?(ssh-dss|ssh-rsa|ecdsa-sha\d+-nistp\d+|ssh-ed\d+|sk-ssh-ed25519\@openssh.com|sk-ecdsa-sha2-nistp256\@openssh.com)\s+([a-zA-Z0-9/=+]+)(\s+(.{1,128})?)?$}
m{^\s*((\S+)\s+)?(ssh-dss|ssh-rsa|ecdsa-sha\d+-nistp\d+|ssh-ed\d+|sk-ssh-ed25519\@openssh\.com|sk-ecdsa-sha2-nistp256\@openssh\.com)\s+([a-zA-Z0-9/=+]+)(\s+(.{1,128})?)?$}
&& length($pubKey) <= 3000)
{
($prefix, $typecode, $base64, $comment) = ($2, $3, $4, $6);
Expand Down

0 comments on commit db5113c

Please sign in to comment.