Exemplo n.º 1
0
 def connected(protocol):
     if not ITLSTransport.providedBy(protocol.transport):
         results.append("skip")
     else:
         results.append(self.assertRaises(ValueError,
                                          protocol.transport.startTLS,
                                          brokenFactory))
Exemplo n.º 2
0
 def connected(protocol):
     if not ITLSTransport.providedBy(protocol.transport):
         results.append("skip")
     else:
         results.append(self.assertRaises(ValueError,
                                          protocol.transport.startTLS,
                                          brokenFactory))
Exemplo n.º 3
0
            def connectionMade(self):
                if not ITLSTransport.providedBy(self.transport):
                    # Functionality isn't available to be tested.
                    finished = self.factory.finished
                    self.factory.finished = None
                    finished.errback(SkipTest("No ITLSTransport support"))
                    return

                # Switch the transport to TLS.
                self.transport.startTLS(self.factory.context)
                # Force TLS to really get negotiated.  If nobody talks, nothing
                # will happen.
                self.transport.write("x")
Exemplo n.º 4
0
            def connectionMade(self):
                if not ITLSTransport.providedBy(self.transport):
                    # Functionality isn't available to be tested.
                    finished = self.factory.finished
                    self.factory.finished = None
                    finished.errback(SkipTest("No ITLSTransport support"))
                    return

                # Switch the transport to TLS.
                self.transport.startTLS(self.factory.context)
                # Force TLS to really get negotiated.  If nobody talks, nothing
                # will happen.
                self.transport.write("x")
Exemplo n.º 5
0
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
Tests for L{twisted.conch.ssh.agent}.
"""

import struct

from twisted.internet import reactor
from twisted.internet.interfaces import ITLSTransport
from twisted.trial import unittest

if not ITLSTransport.providedBy(reactor):
    iosim = None
else:
    from twisted.test import iosim

try:
    import Crypto.Cipher.DES3
except ImportError:
    Crypto = None

try:
    import pyasn1
except ImportError:
    pyasn1 = None

if Crypto and pyasn1:
    from twisted.conch.ssh import keys, agent
else:
Exemplo n.º 6
0
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh.agent}.
"""

import struct

from twisted.internet import reactor
from twisted.internet.interfaces import ITLSTransport
from twisted.trial import unittest

if not ITLSTransport.providedBy(reactor):
    iosim = None
else:
    from twisted.test import iosim

try:
    import Crypto.Cipher.DES3
except ImportError:
    Crypto = None

try:
    import pyasn1
except ImportError:
    pyasn1 = None

if Crypto and pyasn1:
    from twisted.conch.ssh import keys, agent
else:
    keys = agent = None