# Path: tests/util.py
# def _support(filename):
# def _config(name):
# def needs_builtin(name):
#         def __init__(self):
#         def setUpClass(cls):
#         def tearDownClass(cls):
#             def setUpClass(cls):
# def update_env(testcase, mapping, env=os.environ):
#     def replace(target, source):
# def k5shell(args=None):
# def is_low_entropy():
#     class DummyK5Realm(object):
#     class KerberosTestCase(unittest.TestCase):
#         class KerberosTestCase(unittest.TestCase):


import socket
import threading
import unittest
import paramiko
from .util import needs_gssapi, KerberosTestCase, update_env





class NullServer(paramiko.ServerInterface):
    def get_allowed_auths(self, username):
        return "gssapi-keyex"

    def check_auth_gssapi_keyex(
        self, username, gss_authenticated=paramiko.AUTH_FAILED, cc_file=None
    ):
        if gss_authenticated == paramiko.AUTH_SUCCESSFUL:
            return paramiko.AUTH_SUCCESSFUL
        return paramiko.AUTH_FAILED

    def enable_auth_gssapi(self):
        UseGSSAPI = True
        return UseGSSAPI

    def check_channel_request(self, kind, chanid):
        return paramiko.OPEN_SUCCEEDED

    def check_channel_exec_request(self, channel, command):
        if command != b"yes":
            return False
        return True


@needs_gssapi

# Path: tests/util.py
# def _support(filename):
# def _config(name):
# def needs_builtin(name):
#         def __init__(self):
#         def setUpClass(cls):
#         def tearDownClass(cls):
#             def setUpClass(cls):
# def update_env(testcase, mapping, env=os.environ):
#     def replace(target, source):
# def k5shell(args=None):
# def is_low_entropy():
#     class DummyK5Realm(object):
#     class KerberosTestCase(unittest.TestCase):
#         class KerberosTestCase(unittest.TestCase):


# Path: tests/test_kex_gss.py
import socket
import threading
import unittest
import paramiko
from .util import needs_gssapi, KerberosTestCase, update_env






class NullServer(paramiko.ServerInterface):
    def get_allowed_auths(self, username):
        return "gssapi-keyex"

    def check_auth_gssapi_keyex(
        self, username, gss_authenticated=paramiko.AUTH_FAILED, cc_file=None
    ):
        if gss_authenticated == paramiko.AUTH_SUCCESSFUL:
            return paramiko.AUTH_SUCCESSFUL
        return paramiko.AUTH_FAILED

    def enable_auth_gssapi(self):
        UseGSSAPI = True
        return UseGSSAPI

    def check_channel_request(self, kind, chanid):
        return paramiko.OPEN_SUCCEEDED

    def check_channel_exec_request(self, channel, command):
        if command != b"yes":
            return False
        return True


@needs_gssapi

class GSSKexTest(KerberosTestCase):