def test_key_derivation_new(): keyderiv1 = kerberos.KeyDerivationNew() keyderiv2 = kerberos.KeyDerivationNew(5, 10) assert keyderiv1.derive_key( b"password", 123456) == bytes.fromhex("591b45defe20abcd6ec412b63fbacff5") assert keyderiv2.derive_key( b"password", 123456) == bytes.fromhex("09409830bf949ab56fae81bd028fe18d")
def __init__(self, access_key, version, settings=None): if settings: self.settings = settings.copy() else: self.settings = Settings() self.settings.set("server.access_key", access_key) self.settings.set("server.version", version) self.auth_client = authentication.AuthenticationClient(self) self.secure_client = secure.SecureClient(self) if self.settings.get("kerberos.key_derivation") == 0: self.key_derivation = kerberos.KeyDerivationOld(65000, 1024) else: self.key_derivation = kerberos.KeyDerivationNew(1, 1) self.nat_traversal_server = nat.NATTraversalServer() self.notification_server = notification.NotificationServer() self.nintendo_notification_server = nintendo_notification.NintendoNotificationServer() self.protocol_map = { self.nat_traversal_server.PROTOCOL_ID: self.nat_traversal_server, self.notification_server.PROTOCOL_ID: self.notification_server, self.nintendo_notification_server.PROTOCOL_ID: self.nintendo_notification_server }
def __init__(self, settings, client, host, port): self.settings = settings self.auth_client = client self.auth_host = host self.auth_port = port if settings["nex.version"] < 40000: self.auth_proto = authentication.AuthenticationClient(client) else: self.auth_proto = authentication.AuthenticationClientNX(client) if self.settings["kerberos.key_derivation"] == 0: self.key_derivation = kerberos.KeyDerivationOld(65000, 1024) else: self.key_derivation = kerberos.KeyDerivationNew(1, 1)
def __init__(self, settings=None): if isinstance(settings, Settings): self.settings = settings.copy() else: self.settings = Settings(settings) self.auth_client = service.RMCClient(self.settings) self.secure_client = service.RMCClient(self.settings) self.auth_proto = authentication.AuthenticationClient(self.auth_client) self.secure_proto = secure.SecureConnectionClient(self.secure_client) if self.settings.get("kerberos.key_derivation") == 0: self.key_derivation = kerberos.KeyDerivationOld(65000, 1024) else: self.key_derivation = kerberos.KeyDerivationNew(1, 1) self.pid = None self.local_station = None self.public_station = None
def __init__(self, access_key, version, settings=None): if settings: self.settings = settings.copy() else: self.settings = Settings() self.settings.set("server.access_key", access_key) self.settings.set("server.version", version) self.auth_client = service.RMCClient(self.settings) self.secure_client = service.RMCClient(self.settings) self.auth_proto = authentication.AuthenticationClient(self.auth_client) self.secure_proto = secure.SecureConnectionClient(self.secure_client) if self.settings.get("kerberos.key_derivation") == 0: self.key_derivation = kerberos.KeyDerivationOld(65000, 1024) else: self.key_derivation = kerberos.KeyDerivationNew(1, 1) self.my_pid = None self.local_station = None self.public_station = None