Beispiel #1
0
def test_unsupported_ciphersuite():
    with pytest.raises(UnsupportedCipherException):
        select_preferred_ciphersuite([
            CipherSuites.TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA
        ], [
            CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5
        ])
Beispiel #2
0
def test_select_preferred_ciphersuite():
    assert select_preferred_ciphersuite([
        CipherSuites.TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA,
        CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5
    ], [
        CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5,
        CipherSuites.TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA
    ]) == CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5
Beispiel #3
0
def test_select_preferred_ciphersuite():
    assert select_preferred_ciphersuite([
        CipherSuites.TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA,
        CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5
    ], [
        CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5,
        CipherSuites.TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA
    ]) == CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5
Beispiel #4
0
def test_unsupported_ciphersuite():
    with pytest.raises(UnsupportedCipherException):
        select_preferred_ciphersuite(
            [CipherSuites.TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA],
            [CipherSuites.TLS_DH_anon_EXPORT_WITH_RC4_40_MD5])