Skip to content

Commit

Permalink
sfdsdfdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
sk-keeper committed Dec 2, 2023
1 parent fbc65af commit d2b68be
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
21 changes: 11 additions & 10 deletions unit-tests/pam-tunnel/test_pam_tunnel.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import datetime
import socket
import string
import sys
import unittest
from unittest import mock

from cryptography import x509
from cryptography.hazmat._oid import NameOID
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import ec
if sys.version_info >= (3, 11):
import datetime
import socket
import string
from cryptography import x509
from cryptography.hazmat._oid import NameOID
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import ec

from keepercommander.commands.tunnel.port_forward.endpoint import (generate_random_bytes, find_open_port)
from keepercommander.commands.tunnel.port_forward.endpoint import (generate_random_bytes, find_open_port)

if sys.version_info >= (3, 11):
def generate_self_signed_cert(private_key):
# Generate a self-signed certificate
subject = issuer = x509.Name([
Expand Down
26 changes: 13 additions & 13 deletions unit-tests/pam-tunnel/test_private_tunnel.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import asyncio
import logging
import socket
import sys
import unittest

from aiortc import RTCDataChannel
from cryptography.utils import int_to_bytes
from keepercommander import utils
from keepercommander.commands.tunnel.port_forward.endpoint import (PrivateTunnelEntrance, ControlMessage,
CONTROL_MESSAGE_NO_LENGTH, CONNECTION_NO_LENGTH,
ConnectionNotFoundException,
TERMINATOR, DATA_LENGTH)
from test_pam_tunnel import new_private_key
from unittest import mock


if sys.version_info >= (3, 11):
import asyncio
import logging
import socket

from aiortc import RTCDataChannel
from cryptography.utils import int_to_bytes
from keepercommander import utils
from keepercommander.commands.tunnel.port_forward.endpoint import (PrivateTunnelEntrance, ControlMessage,
CONTROL_MESSAGE_NO_LENGTH, CONNECTION_NO_LENGTH,
ConnectionNotFoundException,
TERMINATOR, DATA_LENGTH)
from test_pam_tunnel import new_private_key

# Only define the class if Python version is 3.8 or higher
class TestPrivateTunnelEntrance(unittest.IsolatedAsyncioTestCase):
async def asyncSetUp(self):
Expand Down
19 changes: 10 additions & 9 deletions unit-tests/pam-tunnel/test_public_tunnel.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import sys
import unittest
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from keeper_secrets_manager_core.utils import base64_to_bytes
from keepercommander.commands.tunnel.port_forward.tunnel import ITunnel
from keepercommander.commands.tunnel.port_forward.endpoint import (ControlMessage, CONTROL_MESSAGE_NO_LENGTH,
DATA_LENGTH, CONNECTION_NO_LENGTH, TunnelProtocol,
TERMINATOR, find_server_public_key)
from unittest import mock


if sys.version_info >= (3, 11):
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from keeper_secrets_manager_core.utils import base64_to_bytes
from keepercommander.commands.tunnel.port_forward.tunnel import ITunnel
from keepercommander.commands.tunnel.port_forward.endpoint import (ControlMessage, CONTROL_MESSAGE_NO_LENGTH,
DATA_LENGTH, CONNECTION_NO_LENGTH, TunnelProtocol,
TERMINATOR, find_server_public_key)


# Only define the class if Python version is 3.8 or higher
def make_private_key():
private_key = ec.generate_private_key(
Expand Down

0 comments on commit d2b68be

Please sign in to comment.