示例#1
0
文件: server.py 项目: vstealth/byob
    def __init__(self, connection=None, id=1):
        """
        Create a new Session 

        `Requires`
        :param connection:  socket.socket object

        `Optional`
        :param int id:      session ID

        """
        super(Session, self).__init__()
        self._prompt = None
        self._abort = False
        self._lock = threading.Lock()
        self._active = threading.Event()
        self._created = time.time()
        self.id = id
        self.connection = connection
        self.key = security.diffiehellman(self.connection)
        self.rsa = security.Cryptodome.PublicKey.RSA.generate(2048)
        try:
            self.info = self.recv_task()
            self.info['id'] = self.id
        except Exception as e:
            self.info = None
            return
示例#2
0
文件: server.py 项目: hmz777/byob
    def __init__(self, connection=None, id=1):
        """
        Create a new Session

        `Requires`
        :param connection:  socket.socket object

        `Optional`
        :param int id:      session ID

        """
        super(Session, self).__init__()
        self._prompt = None
        self._abort = False
        self._lock = threading.Lock()
        self._active = threading.Event()
        self._created = time.time()
        self.id = id
        self.connection = connection
        self.key = security.diffiehellman(self.connection)
        self.rsa = None  # security.Crypto.PublicKey.RSA.generate(2048)
        try:
            self.info = self.recv_task()
            self.info['id'] = self.id
        except Exception as e:
            self.info = None
            return
示例#3
0
文件: server.py 项目: janchuk/byob
    def __init__(self, connection=None, id=1):
        """
        Create a new Session 

        `Requires`
        :param connection:  socket.socket object

        `Optional`
        :param int id:      session ID

        """
        super(Session, self).__init__()
        self._prompt = None
        self._lock = threading.Lock()
        self._active = threading.Event()
        self._created = time.time()
        self.connection = connection
        self.id = id
        self.key = security.diffiehellman(self.connection)
        self.info = self.recv_task()
示例#4
0
文件: server.py 项目: datag00n/byob
    def __init__(self, connection=None, id=1):
        """
        Create a new Session 

        `Requires`
        :param connection:  socket.socket object

        `Optional`
        :param int id:      session ID

        """
        super(Session, self).__init__()
        self._prompt = None
        self._lock = threading.Lock()
        self._active = threading.Event()
        self._created = time.time()
        self.connection = connection
        self.id = id
        self.key = security.diffiehellman(self.connection)
        self.info = self.recv_task()