diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-04-17 10:00:58 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-04-17 10:00:58 +0100 |
commit | 8bb936ebc587a52a0096d8723c8217e92f097603 (patch) | |
tree | 6ddefdef5ab24bb6076a0d5c518b5970509c7787 | |
parent | 9d450f76bb887ee78cf0408ad99bf34b8f05dd84 (diff) | |
download | obnam-8bb936ebc587a52a0096d8723c8217e92f097603.tar.gz |
Fix symmetric key generation to not include newlines.
We'll be feeding it to gpg via a file descriptor,
and gpg reads only the first line. Including a newline
breaks things.
-rw-r--r-- | obnamlib/encryption.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py index 8c064f61..feaec35b 100644 --- a/obnamlib/encryption.py +++ b/obnamlib/encryption.py @@ -28,9 +28,7 @@ def generate_symmetric_key(numbits, filename='/dev/random'): key = f.read(bytes) f.close() - # Passphrase should not contain newlines. Hex encode? - - return key + return key.encode('hex') def _gpg_pipe(args, data, passphrase): |