add --use-agent to GPG so that we work with gnupg-agent
This commit is contained in:
parent
a1349f9c3d
commit
8ede60ebb0
2 changed files with 6 additions and 3 deletions
|
@ -43,8 +43,9 @@ else:
|
||||||
USE_GPG = False
|
USE_GPG = False
|
||||||
|
|
||||||
class GnuPG(GnuPGInterface.GnuPG):
|
class GnuPG(GnuPGInterface.GnuPG):
|
||||||
def __init__(self):
|
def __init__(self, use_agent = False):
|
||||||
GnuPGInterface.GnuPG.__init__(self)
|
GnuPGInterface.GnuPG.__init__(self)
|
||||||
|
self.use_agent = use_agent
|
||||||
self._setup_my_options()
|
self._setup_my_options()
|
||||||
|
|
||||||
def _setup_my_options(self):
|
def _setup_my_options(self):
|
||||||
|
@ -53,6 +54,8 @@ else:
|
||||||
self.options.extra_args.append('--no-secmem-warning')
|
self.options.extra_args.append('--no-secmem-warning')
|
||||||
# Nolith's patch - prevent crashs on non fully-trusted keys
|
# Nolith's patch - prevent crashs on non fully-trusted keys
|
||||||
self.options.extra_args.append('--always-trust')
|
self.options.extra_args.append('--always-trust')
|
||||||
|
if self.use_agent:
|
||||||
|
self.options.extra_args.append('--use-agent')
|
||||||
|
|
||||||
def _read_response(self, child_stdout):
|
def _read_response(self, child_stdout):
|
||||||
# Internal method: reads all the output from GPG, taking notice
|
# Internal method: reads all the output from GPG, taking notice
|
||||||
|
|
|
@ -84,7 +84,7 @@ class Connection(ConnectionHandlers):
|
||||||
# Do we continue connection when we get roster (send presence,get vcard...)
|
# Do we continue connection when we get roster (send presence,get vcard...)
|
||||||
self.continue_connect_info = None
|
self.continue_connect_info = None
|
||||||
if USE_GPG:
|
if USE_GPG:
|
||||||
self.gpg = GnuPG.GnuPG()
|
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||||
gajim.config.set('usegpg', True)
|
gajim.config.set('usegpg', True)
|
||||||
else:
|
else:
|
||||||
gajim.config.set('usegpg', False)
|
gajim.config.set('usegpg', False)
|
||||||
|
@ -203,7 +203,7 @@ class Connection(ConnectionHandlers):
|
||||||
return
|
return
|
||||||
self.password = self.new_account_info['password']
|
self.password = self.new_account_info['password']
|
||||||
if USE_GPG:
|
if USE_GPG:
|
||||||
self.gpg = GnuPG.GnuPG()
|
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||||
gajim.config.set('usegpg', True)
|
gajim.config.set('usegpg', True)
|
||||||
else:
|
else:
|
||||||
gajim.config.set('usegpg', False)
|
gajim.config.set('usegpg', False)
|
||||||
|
|
Loading…
Add table
Reference in a new issue