From a92adfa230e84317e2337e9b30631acd909a4b14 Mon Sep 17 00:00:00 2001 From: Douglas Freed Date: Wed, 18 Dec 2013 19:08:27 +0000 Subject: [PATCH] Use the existing pubkey for the sign in payload Rather than making a temp file to save out the public key just to read it back in to give to the master for sign in, we can just read the existing public key file that was just created. --- salt/crypt.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/salt/crypt.py b/salt/crypt.py index 7b5d0401b9df..8ad32a40d157 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -237,9 +237,6 @@ def minion_sign_in_payload(self): public key to encrypt the AES key sent back form the master. ''' payload = {} - key = self.get_keys() - tmp_pub = salt.utils.mkstemp() - key.save_pub_key(tmp_pub) payload['enc'] = 'clear' payload['load'] = {} payload['load']['cmd'] = '_auth' @@ -251,9 +248,8 @@ def minion_sign_in_payload(self): payload['load']['token'] = pub.public_encrypt(self.token, RSA.pkcs1_oaep_padding) except Exception: pass - with salt.utils.fopen(tmp_pub, 'r') as fp_: + with salt.utils.fopen(self.pub_path, 'r') as fp_: payload['load']['pub'] = fp_.read() - os.remove(tmp_pub) return payload def decrypt_aes(self, payload, master_pub=True):