Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Updated to new gnupg-version 1.3 from isislovecruft
Browse files Browse the repository at this point in the history
  • Loading branch information
KopfKrieg committed Aug 17, 2014
1 parent 8ca5f09 commit b71cc6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libcloudzec.py
Expand Up @@ -138,7 +138,7 @@ def __init__(self, genMasterKey=False, notifyCallback=None, debug=False):
raise Exception('You need to set a username in {}'.format(self.confFile))
# Create gpg instance | needs to be defined before en/decrypting anything
homedir = os.path.join(home, '.gnupg')
if gnupg.__version__.startswith('1.2'): # The „new“ version of GnuPG from isislovecruft on GitHub
if gnupg.__version__.startswith('1.3'): # The „new“ version of GnuPG from isislovecruft on GitHub
binary = '/usr/bin/gpg2' # No symlinks allowed
self.gpg = gnupg.GPG(binary=binary, homedir=homedir)
else: # „Old“ versions or other versions of GnuPG:
Expand Down Expand Up @@ -729,7 +729,7 @@ def encryptFile(self, pathIn, filename, passphrase, force=False):
# Else encrypt it
with open(pathIn, 'rb') as fIn:
binary = None
if gnupg.__version__.startswith('1.2'): # The „new“ version of GnuPG from isislovecruft on GitHu
if gnupg.__version__.startswith('1.3'): # The „new“ version of GnuPG from isislovecruft on GitHub
binary = self.gpg.encrypt(fIn.read(), passphrase=passphrase, armor=False, encrypt=False, symmetric=True, always_trust=True, cipher_algo='AES256', compress_algo=self.compression)
else: # „Old“ versions or other versions of GnuPG:
binary = self.gpg.encrypt(fIn.read(), passphrase=passphrase, armor=False, symmetric=True, always_trust=True, recipients=None)
Expand Down Expand Up @@ -841,7 +841,7 @@ def syncKeysWithBoth(self, cleanup=False, keys=None):
with self.sftp.open(serverLogPath, 'w') as fOut:
data = json.dumps(targetKeys)
enc = None
if gnupg.__version__.startswith('1.2'): # The „new“ version of GnuPG from isislovecruft on GitHub
if gnupg.__version__.startswith('1.3'): # The „new“ version of GnuPG from isislovecruft on GitHub
enc = self.gpg.encrypt(data, passphrase=self.masterKey, armor=True, encrypt=False, symmetric=True, cipher_algo=self.encryption, compress_algo='ZIP')
else: # „Old“ versions or other versions of GnuPG:
enc = self.gpg.encrypt(data, passphrase=self.masterKey, armor=True, symmetric=True, recipients=None)
Expand Down Expand Up @@ -926,7 +926,7 @@ def storeRemoteLog(self, log):
with self.sftp.open(remoteLogPath, 'w') as fOut:
data = json.dumps(log)
enc = None
if gnupg.__version__.startswith('1.2'): # The „new“ version of GnuPG from isislovecruft on GitHub
if gnupg.__version__.startswith('1.3'): # The „new“ version of GnuPG from isislovecruft on GitHub
enc = self.gpg.encrypt(data, passphrase=self.masterKey, armor=True, encrypt=False, symmetric=True, cipher_algo=self.encryption, compress_algo='ZIP')
else: # „Old“ versions or other versions of GnuPG:
enc = self.gpg.encrypt(data, passphrase=self.masterKey, armor=True, symmetric=True, recipients=None)
Expand Down

0 comments on commit b71cc6e

Please sign in to comment.