Escape dots in regex patterns for ssh algorithms

Co-authored-by: Stéphane Lesimple <speed47_github@speed47.net>
This commit is contained in:
Pierre-Elliott Bécue 2023-09-25 15:36:45 +02:00 committed by Stéphane Lesimple
parent d0ac9eabb9
commit 7dce5734fd

View file

@ -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);