From f17f78fa9d28e62793a5f2c7109fc29eeffb0c89 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Wed, 5 May 2021 10:54:17 -0500 Subject: Add \r\n check for SSH keys in Azure (#889) See https://bugs.launchpad.net/cloud-init/+bug/1910835 --- cloudinit/sources/DataSourceAzure.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cloudinit') diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index c0025c7b..2f3390c3 100755 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -1551,6 +1551,9 @@ def _key_is_openssh_formatted(key): """ Validate whether or not the key is OpenSSH-formatted. """ + # See https://bugs.launchpad.net/cloud-init/+bug/1910835 + if '\r\n' in key.strip(): + return False parser = ssh_util.AuthKeyLineParser() try: -- cgit v1.2.3