/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-ctl

  • Committer: Teddy Hogeborn
  • Date: 2015-07-20 03:03:33 UTC
  • Revision ID: teddy@recompile.se-20150720030333-203m2aeblypcsfte
Bug fix for GnuTLS 3: be compatible with old 2048-bit DSA keys.

The mandos-keygen program in Mandos version 1.6.0 and older generated
2048-bit DSA keys, and when GnuTLS uses these it has trouble
connecting using the Mandos default priority string.  This was
previously fixed in Mandos 1.6.2, but the bug reappeared when using
GnuTLS 3, so the default priority string has to change again; this
time also the Mandos client has to change its default, so now the
server and the client should use the same default priority string:

SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256

* mandos (main/server_defaults): Changed default priority string.
* mandos-options.xml (/section/para[id="priority_compat"]): Removed.
  (/section/para[id="priority"]): Changed default priority string.
* mandos.conf ([DEFAULT]/priority): - '' -
* mandos.conf.xml (OPTIONS/priority): Refer to the id "priority"
                                      instead of "priority_compat".
* mandos.xml (OPTIONS/--priority): - '' -
* plugins.d/mandos-client.c (main): Changed default priority string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
4
4
# Mandos Monitor - Control and monitor the Mandos server
5
5
6
 
# Copyright © 2008-2016 Teddy Hogeborn
7
 
# Copyright © 2008-2016 Björn Påhlsson
 
6
# Copyright © 2008-2015 Teddy Hogeborn
 
7
# Copyright © 2008-2015 Björn Påhlsson
8
8
9
9
# This program is free software: you can redistribute it and/or modify
10
10
# it under the terms of the GNU General Public License as published by
72
72
server_path = "/"
73
73
server_interface = domain + ".Mandos"
74
74
client_interface = domain + ".Mandos.Client"
75
 
version = "1.7.3"
76
 
 
77
 
 
78
 
try:
79
 
    dbus.OBJECT_MANAGER_IFACE
80
 
except AttributeError:
81
 
    dbus.OBJECT_MANAGER_IFACE = "org.freedesktop.DBus.ObjectManager"
 
75
version = "1.6.9"
 
76
 
82
77
 
83
78
def milliseconds_to_string(ms):
84
79
    td = datetime.timedelta(0, 0, 0, ms)
346
341
    
347
342
    mandos_serv = dbus.Interface(mandos_dbus_objc,
348
343
                                 dbus_interface = server_interface)
349
 
    mandos_serv_object_manager = dbus.Interface(
350
 
        mandos_dbus_objc, dbus_interface = dbus.OBJECT_MANAGER_IFACE)
351
344
    
352
345
    #block stderr since dbus library prints to stderr
353
346
    null = os.open(os.path.devnull, os.O_RDWR)
356
349
    os.close(null)
357
350
    try:
358
351
        try:
359
 
            mandos_clients = { path: ifs_and_props[client_interface]
360
 
                               for path, ifs_and_props in
361
 
                               mandos_serv_object_manager
362
 
                               .GetManagedObjects().items()
363
 
                               if client_interface in ifs_and_props }
 
352
            mandos_clients = mandos_serv.GetAllClientsWithProperties()
364
353
        finally:
365
354
            #restore stderr
366
355
            os.dup2(stderrcopy, sys.stderr.fileno())
367
356
            os.close(stderrcopy)
368
 
    except dbus.exceptions.DBusException as e:
369
 
        print("Access denied: Accessing mandos server through D-Bus: {}"
370
 
              .format(e), file=sys.stderr)
 
357
    except dbus.exceptions.DBusException:
 
358
        print("Access denied: Accessing mandos server through dbus.",
 
359
              file=sys.stderr)
371
360
        sys.exit(1)
372
361
    
373
362
    # Compile dict of (clients: properties) to process