Beispiel #1
0
    def post_dissection(self, m):
        s = self.tls_session

        # if there are kx params and keys, we assume the crypto library is ok
        if s.client_kx_ecdh_params:
            s.client_kx_pubkey = _tls_named_groups_import(
                s.client_kx_ecdh_params, self.ecdh_Yc)

        if s.server_kx_privkey and s.client_kx_pubkey:
            ZZ = s.server_kx_privkey.exchange(ec.ECDH(), s.client_kx_pubkey)
            s.pre_master_secret = ZZ
            s.compute_ms_and_derive_keys()
Beispiel #2
0
    def register_pubkey(self):
        """
        XXX Support compressed point format.
        XXX Check that the pubkey received is on the curve.
        """
        # point_format = 0
        # if self.point[0] in [b'\x02', b'\x03']:
        #    point_format = 1

        s = self.tls_session
        s.server_kx_pubkey = _tls_named_groups_import(self.named_curve,
                                                      self.point)

        if not s.client_kx_ecdh_params:
            s.client_kx_ecdh_params = self.named_curve
Beispiel #3
0
 def register_pubkey(self):
     self.pubkey = _tls_named_groups_import(
         self.group,
         self.key_exchange
     )