/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: 2019-08-05 21:40:46 UTC
  • mfrom: (237.4.120 release)
  • Revision ID: teddy@recompile.se-20190805214046-qaj0w91ltbp92z2q
Merge from release branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
import xml.dom.minidom
89
89
import inspect
90
90
 
91
 
if sys.version_info.major == 2:
92
 
    __metaclass__ = type
93
 
 
94
91
# Try to find the value of SO_BINDTODEVICE:
95
92
try:
96
93
    # This is where SO_BINDTODEVICE is in Python 3.3 (or 3.4?) and
186
183
    pass
187
184
 
188
185
 
189
 
class PGPEngine:
 
186
class PGPEngine(object):
190
187
    """A simple class for OpenPGP symmetric encryption & decryption"""
191
188
 
192
189
    def __init__(self):
282
279
 
283
280
 
284
281
# Pretend that we have an Avahi module
285
 
class avahi:
 
282
class avahi(object):
286
283
    """This isn't so much a class as it is a module-like namespace."""
287
284
    IF_UNSPEC = -1               # avahi-common/address.h
288
285
    PROTO_UNSPEC = -1            # avahi-common/address.h
322
319
    pass
323
320
 
324
321
 
325
 
class AvahiService:
 
322
class AvahiService(object):
326
323
    """An Avahi (Zeroconf) service.
327
324
 
328
325
    Attributes:
510
507
 
511
508
 
512
509
# Pretend that we have a GnuTLS module
513
 
class gnutls:
 
510
class gnutls(object):
514
511
    """This isn't so much a class as it is a module-like namespace."""
515
512
 
516
513
    library = ctypes.util.find_library("gnutls")
579
576
        pass
580
577
 
581
578
    # Classes
582
 
    class Credentials:
 
579
    class Credentials(object):
583
580
        def __init__(self):
584
581
            self._c_object = gnutls.certificate_credentials_t()
585
582
            gnutls.certificate_allocate_credentials(
589
586
        def __del__(self):
590
587
            gnutls.certificate_free_credentials(self._c_object)
591
588
 
592
 
    class ClientSession:
 
589
    class ClientSession(object):
593
590
        def __init__(self, socket, credentials=None):
594
591
            self._c_object = gnutls.session_t()
595
592
            gnutls_flags = gnutls.CLIENT
821
818
    connection.close()
822
819
 
823
820
 
824
 
class Client:
 
821
class Client(object):
825
822
    """A representation of a client host served by this server.
826
823
 
827
824
    Attributes:
2216
2213
    del _interface
2217
2214
 
2218
2215
 
2219
 
class ProxyClient:
 
2216
class ProxyClient(object):
2220
2217
    def __init__(self, child_pipe, key_id, fpr, address):
2221
2218
        self._pipe = child_pipe
2222
2219
        self._pipe.send(('init', key_id, fpr, address))
2495
2492
        return hex_fpr
2496
2493
 
2497
2494
 
2498
 
class MultiprocessingMixIn:
 
2495
class MultiprocessingMixIn(object):
2499
2496
    """Like socketserver.ThreadingMixIn, but with multiprocessing"""
2500
2497
 
2501
2498
    def sub_process_main(self, request, address):
2513
2510
        return proc
2514
2511
 
2515
2512
 
2516
 
class MultiprocessingMixInWithPipe(MultiprocessingMixIn):
 
2513
class MultiprocessingMixInWithPipe(MultiprocessingMixIn, object):
2517
2514
    """ adds a pipe to the MixIn """
2518
2515
 
2519
2516
    def process_request(self, request, client_address):
2534
2531
 
2535
2532
 
2536
2533
class IPv6_TCPServer(MultiprocessingMixInWithPipe,
2537
 
                     socketserver.TCPServer):
 
2534
                     socketserver.TCPServer, object):
2538
2535
    """IPv6-capable TCP server.  Accepts 'None' as address and/or port
2539
2536
 
2540
2537
    Attributes: