~jtaylor/ubuntu/oneiric/gajim/multiple-CVE

« back to all changes in this revision

Viewing changes to src/common/GnuPGInterface.py

  • Committer: Bazaar Package Importer
  • Author(s): Nafallo Bjälevik
  • Date: 2008-11-16 00:26:27 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20081116002627-4olie99o2rqc7001
Tags: 0.12~beta1-0ubuntu1
* New upstream beta release:
  + Security improvements: End-to-End encryption, SSL certificat verification
  + Ability to minimize groupchats in roster
  + Chat to groupchat transformation
  + Block/Unblock contacts directly from roster
  + Single window mode
  + PEP support (User activity, mood and tune)
  + Security improvements: Kerberos (GSSAPI) SASL Authentication mechanism
  + Improve GUI of some windows
  + Fix handling of invalid XML
  + Fix freeze on connection
* Dropped all changes, patches and backports.
* src/common/passwords.py:
  - Change keyring to 'login', which is what gets unlocked at login.
* debian/copyright:
  - Updated for the GPL-3 change and for the amount of upstream authors.
* debian/control:
  - Update Standards-Version and drop XS for Vcs-Bzr.
  - Add Homepage and use ${shlibs:Depends}.
* debian/rules:
  - Update to not ignore errors from make clean.
  - Update with dh_shlibdeps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding:utf-8 -*-
 
2
## src/common/GnuPGInterface.py
 
3
##
 
4
## Copyright (C) 2001 Frank J. Tobin <ftobin AT neverending.org>
 
5
## Copyright (C) 2005 Nikos Kouremenos <kourem AT gmail.com>
 
6
## Copyright (C) 2006-2007 Yann Leboulanger <asterix AT lagaule.org>
 
7
## Copyright (C) 2008 Jean-Marie Traissard <jim AT lapin.org>
 
8
##
 
9
## This file is part of Gajim.
 
10
##
 
11
## Gajim is free software; you can redistribute it and/or modify
 
12
## it under the terms of the GNU General Public License as published
 
13
## by the Free Software Foundation; version 3 only.
 
14
##
 
15
## Gajim is distributed in the hope that it will be useful,
 
16
## but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
18
## GNU General Public License for more details.
 
19
##
 
20
## You should have received a copy of the GNU General Public License
 
21
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
 
22
##
 
23
 
1
24
"""Interface to GNU Privacy Guard (GnuPG)
2
25
 
3
26
GnuPGInterface is a Python module to interface with GnuPG.
196
219
>>> proc.handles['logger'].close()
197
220
>>> 
198
221
>>> proc.wait()
199
 
 
200
 
 
201
 
COPYRIGHT:
202
 
 
203
 
Copyright (C) 2001  Frank J. Tobin, ftobin@neverending.org
204
 
 
205
 
LICENSE:
206
 
 
207
 
This library is free software; you can redistribute it and/or
208
 
modify it under the terms of the GNU Lesser General Public
209
 
License as published by the Free Software Foundation; either
210
 
version 2.1 of the License, or (at your option) any later version.
211
 
 
212
 
This library is distributed in the hope that it will be useful,
213
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
214
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
215
 
Lesser General Public License for more details.
216
 
 
217
 
You should have received a copy of the GNU Lesser General Public
218
 
License along with this library; if not, write to the Free Software
219
 
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
220
 
or see http://www.gnu.org/copyleft/lesser.html
221
222
"""
222
223
 
223
224
import os
336
337
        and can be written to.
337
338
        """
338
339
        
339
 
        if args == None: args = []
340
 
        if create_fhs == None: create_fhs = []
341
 
        if attach_fhs == None: attach_fhs = {}
 
340
        if args is None: args = []
 
341
        if create_fhs is None: create_fhs = []
 
342
        if attach_fhs is None: attach_fhs = {}
342
343
        
343
344
        for std in _stds:
344
 
            if not attach_fhs.has_key(std) \
 
345
            if std not in attach_fhs \
345
346
               and std not in create_fhs:
346
347
                attach_fhs.setdefault(std, getattr(sys, std))
347
348
        
348
349
        handle_passphrase = 0
349
350
        
350
 
        if self.passphrase != None \
351
 
           and not attach_fhs.has_key('passphrase') \
 
351
        if self.passphrase is not None \
 
352
           and 'passphrase' not in attach_fhs \
352
353
           and 'passphrase' not in create_fhs:
353
354
            handle_passphrase = 1
354
355
            create_fhs.append('passphrase')
372
373
        process = Process()
373
374
        
374
375
        for fh_name in create_fhs + attach_fhs.keys():
375
 
            if not _fd_modes.has_key(fh_name):
 
376
            if fh_name not in _fd_modes:
376
377
                raise KeyError, \
377
378
                      "unrecognized filehandle name '%s'; must be one of %s" \
378
379
                      % (fh_name, _fd_modes.keys())
380
381
        for fh_name in create_fhs:
381
382
            # make sure the user doesn't specify a filehandle
382
383
            # to be created *and* attached
383
 
            if attach_fhs.has_key(fh_name):
 
384
            if fh_name in attach_fhs:
384
385
                raise ValueError, \
385
386
                      "cannot have filehandle '%s' in both create_fhs and attach_fhs" \
386
387
                      % fh_name
564
565
    def get_standard_args( self ):
565
566
        """Generate a list of standard, non-meta or extra arguments"""
566
567
        args = []
567
 
        if self.homedir != None: args.extend( [ '--homedir', self.homedir ] )
568
 
        if self.options != None: args.extend( [ '--options', self.options ] )
569
 
        if self.comment != None: args.extend( [ '--comment', self.comment ] )
570
 
        if self.compress_algo != None: args.extend( [ '--compress-algo', self.compress_algo ] )
571
 
        if self.default_key != None: args.extend( [ '--default-key', self.default_key ] )
 
568
        if self.homedir is not None:
 
569
            args.extend( [ '--homedir', self.homedir ] )
 
570
        if self.options is not None:
 
571
            args.extend( [ '--options', self.options ] )
 
572
        if self.comment is not None:
 
573
            args.extend( [ '--comment', self.comment ] )
 
574
        if self.compress_algo is not None:
 
575
            args.extend( [ '--compress-algo', self.compress_algo ] )
 
576
        if self.default_key is not None:
 
577
            args.extend( [ '--default-key', self.default_key ] )
572
578
        
573
579
        if self.no_options: args.append( '--no-options' )
574
580
        if self.armor: args.append( '--armor' )
647
653
 
648
654
if __name__ == '__main__':
649
655
    _run_doctests()
 
656
 
 
657
# vim: se ts=3: