~ubuntu-branches/ubuntu/raring/duplicity/raring-updates

« back to all changes in this revision

Viewing changes to src/gpg.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-04-03 20:40:34 UTC
  • mfrom: (1.9.1 upstream) (16.2.6 natty)
  • Revision ID: james.westby@ubuntu.com-20110403204034-5m1eri4z5qr0nyrr
Tags: 0.6.13-0ubuntu1
* Resync with Debian, no remaining changes
* New upstream release
  - silent data corruption with checkpoint/restore (LP: #613244)
  - Assertion error "time not moving forward at appropriate pace"
    (LP: #579958)
* debian/patches/04future.dpatch:
  - Dropped, applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
blocksize = 256 * 1024
40
40
 
41
 
# user options appended by --gpg-options
42
 
gpg_options = ""
43
 
 
44
41
 
45
42
class GPGError(Exception):
46
43
    """
105
102
        gnupg.options.extra_args.append('--no-secmem-warning')
106
103
        if globals.use_agent:
107
104
            gnupg.options.extra_args.append('--use-agent')
108
 
        if gpg_options:
109
 
            for opt in gpg_options.split():
 
105
        if globals.gpg_options:
 
106
            for opt in globals.gpg_options.split():
110
107
                gnupg.options.extra_args.append(opt)
111
108
 
 
109
        cmdlist = []
112
110
        if profile.sign_key:
113
111
            gnupg.options.default_key = profile.sign_key
 
112
            cmdlist.append("--sign")
114
113
 
115
114
        if encrypt:
116
115
            if profile.recipients:
117
116
                gnupg.options.recipients = profile.recipients
118
 
                cmdlist = ['--encrypt']
119
 
                if profile.sign_key:
120
 
                    cmdlist.append("--sign")
 
117
                cmdlist.append('--encrypt')
121
118
            else:
122
 
                cmdlist = ['--symmetric']
 
119
                cmdlist.append('--symmetric')
123
120
                # use integrity protection
124
121
                gnupg.options.extra_args.append('--force-mdc')
125
122
            p1 = gnupg.run(cmdlist, create_fhs=['stdin', 'passphrase'],