From d417ff48bac9e578e52f12c3399c599b17b27ab7 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 20 Jun 2023 09:55:40 -0400 Subject: [PATCH] Strip trailing whitespace before encrypting entries Former-commit-id: 32429dfb574e465486d1397445fa8b34f5dd73fb Former-commit-id: aca5cc58197564a74e99345ed08c3363dd5acea0 --- lib/sshyp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 1a7ae3a..cd0d816 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -133,7 +133,7 @@ def edit_note(_note_lines, _exit_on_match=False): # encrypts an entry and cleans up the temporary files def encrypt(_entry_data, _entry_dir, _gpg_id): - _bytes_data = '\n'.join(_entry_data).encode() + _bytes_data = '\n'.join(_entry_data).rstrip().encode() _encrypted_data = run(('gpg', '-qr', str(_gpg_id), '-e'), input=_bytes_data, stdout=PIPE).stdout open(_entry_dir + '.gpg', 'wb').write(_encrypted_data)