/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2013-10-13 17:05:59 UTC
  • mto: This revision was merged to the branch mainline in revision 625.
  • Revision ID: teddy@recompile.se-20131013170559-44x665vs0pl3n8sf
Tags: version-1.6.1-1
* Makefile (version): Changed to "1.6.1".
* NEWS (Version 1.6.1): New entry.
* debian/changelog (1.6.1-1): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# "AvahiService" class, and some lines in "main".
12
12
13
13
# Everything else is
14
 
# Copyright © 2008-2013 Teddy Hogeborn
15
 
# Copyright © 2008-2013 Björn Påhlsson
 
14
# Copyright © 2008-2012 Teddy Hogeborn
 
15
# Copyright © 2008-2012 Björn Påhlsson
16
16
17
17
# This program is free software: you can redistribute it and/or modify
18
18
# it under the terms of the GNU General Public License as published by
172
172
    def password_encode(self, password):
173
173
        # Passphrase can not be empty and can not contain newlines or
174
174
        # NUL bytes.  So we prefix it and hex encode it.
175
 
        encoded = b"mandos" + binascii.hexlify(password)
176
 
        if len(encoded) > 2048:
177
 
            # GnuPG can't handle long passwords, so encode differently
178
 
            encoded = (b"mandos" + password.replace(b"\\", b"\\\\")
179
 
                       .replace(b"\n", b"\\n")
180
 
                       .replace(b"\0", b"\\x00"))
181
 
        return encoded
 
175
        return b"mandos" + binascii.hexlify(password)
182
176
    
183
177
    def encrypt(self, data, password):
184
178
        passphrase = self.password_encode(password)
2349
2343
                        "port": "",
2350
2344
                        "debug": "False",
2351
2345
                        "priority":
2352
 
                        "SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:+SIGN-RSA-SHA224:+SIGN-RSA-RMD160",
 
2346
                        "SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:+SIGN-RSA-SHA224",
2353
2347
                        "servicename": "Mandos",
2354
2348
                        "use_dbus": "True",
2355
2349
                        "use_ipv6": "True",
2456
2450
                              socketfd=(server_settings["socket"]
2457
2451
                                        or None))
2458
2452
    if not foreground:
2459
 
        pidfilename = "/run/mandos.pid"
 
2453
        pidfilename = "/var/run/mandos.pid"
2460
2454
        pidfile = None
2461
2455
        try:
2462
2456
            pidfile = open(pidfilename, "w")