From 986c3eb94a2abfcbf82c2ce6c31eece281fa2d03 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Mon, 19 Jul 2021 16:00:54 -0400
Subject: [PATCH] Fix the ssh key decoding problem

---
 ci-tools/update-grid-servers | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ci-tools/update-grid-servers b/ci-tools/update-grid-servers
index acbacea6..c5206fd4 100755
--- a/ci-tools/update-grid-servers
+++ b/ci-tools/update-grid-servers
@@ -101,6 +101,11 @@ decode_deploy_key() {
     # Decode the contents of the encoded key path into a decoded key path.
     base64 --decode "${encoded_key_path}" > "${decoded_key_path}"
 
+    # If OpenSSH doesn't find a newline after the last line of the key
+    # material then it fails to parse it.  So, make sure there is one.  If
+    # there was already one, it's fine to have an extra.
+    echo >> "${decoded_key_path}"
+
     # Remove the key from the filesystem to reduce the chance of unintentional
     # disclosure.  Overall our handling of this key is still not *particulary*
     # safe or secure but that's why the key is only authorized to perform a
-- 
GitLab