summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
authorJames Falcon <TheRealFalcon@users.noreply.github.com>2021-05-05 10:54:17 -0500
committerGitHub <noreply@github.com>2021-05-05 11:54:17 -0400
commitf17f78fa9d28e62793a5f2c7109fc29eeffb0c89 (patch)
tree57d5ba65813dc4eaab81a45918818ed8d70b7eab /cloudinit/sources
parent5f5fa5ee99296b3b1044682c41bab38a32cdccd7 (diff)
downloadvyos-cloud-init-f17f78fa9d28e62793a5f2c7109fc29eeffb0c89.tar.gz
vyos-cloud-init-f17f78fa9d28e62793a5f2c7109fc29eeffb0c89.zip
Add \r\n check for SSH keys in Azure (#889)
See https://bugs.launchpad.net/cloud-init/+bug/1910835
Diffstat (limited to 'cloudinit/sources')
-rwxr-xr-xcloudinit/sources/DataSourceAzure.py3
1 files changed, 3 insertions, 0 deletions
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: