From 7dce5734fd14de5c7c197f716e1b5bb2b78a0d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Mon, 25 Sep 2023 15:36:45 +0200 Subject: [PATCH] Escape dots in regex patterns for ssh algorithms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stéphane Lesimple --- lib/perl/OVH/Bastion/ssh.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/perl/OVH/Bastion/ssh.inc b/lib/perl/OVH/Bastion/ssh.inc index e3d96a5..42de94d 100644 --- a/lib/perl/OVH/Bastion/ssh.inc +++ b/lib/perl/OVH/Bastion/ssh.inc @@ -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);