Example #1
0
    def unwrap_header(self, header_data):
        self.__iv = header_data[self.__iv_begin_pos:self.__iv_end_pos]
        data = aes_cfb.decrypt(self.__key, self.__iv, header_data[self.__iv_end_pos:FIXED_HEADER_SIZE])
        real_hdr = data[0:tunnel.MIN_FIXED_HEADER_SIZE]

        # 丢弃误码的包
        if self.__const_fill != data[tunnel.MIN_FIXED_HEADER_SIZE:]: return None

        return real_hdr
Example #2
0
    def unwrap_header(self, header_data):
        self.__iv = header_data[self.__iv_begin_pos:self.__iv_end_pos]
        data = aes_cfb.decrypt(self.__key, self.__iv, header_data[self.__iv_end_pos:FIXED_HEADER_SIZE])
        real_hdr = data[0:tunnel.MIN_FIXED_HEADER_SIZE]

        # 丢弃误码的包
        if self.__const_fill != data[tunnel.MIN_FIXED_HEADER_SIZE:]: raise proto_utils.ProtoError("data wrong")

        return real_hdr
Example #3
0
    def unwrap_header(self, header_data):
        self.__iv = header_data[self.__iv_begin_pos:self.__iv_end_pos]
        data = aes_cfb.decrypt(self.__key, self.__iv, header_data[self.__iv_end_pos:FIXED_HEADER_SIZE])
        real_hdr = data[0:tunnel.MIN_FIXED_HEADER_SIZE]

        # 丢弃误码的包
        if self.__const_fill != data[tunnel.MIN_FIXED_HEADER_SIZE:]: return None

        return real_hdr
Example #4
0
    def unwrap_header(self, header_data):
        self.__iv = header_data[self.__iv_begin_pos:self.__iv_end_pos]
        data = aes_cfb.decrypt(
            self.__key, self.__iv,
            header_data[self.__iv_end_pos:FIXED_HEADER_SIZE])
        real_hdr = data[0:tunnel.MIN_FIXED_HEADER_SIZE]

        # 丢弃误码的包
        if self.__const_fill != data[tunnel.MIN_FIXED_HEADER_SIZE:]:
            raise proto_utils.ProtoError("data wrong")

        return real_hdr
Example #5
0
    def unwrap_body(self, length, body_data):
        d = aes_cfb.decrypt(self.__key, self.__iv, body_data)

        return d[0:length]
Example #6
0
    def unwrap_body(self, length, body_data):
        d = aes_cfb.decrypt(self.__key, self.__iv, body_data)

        return d[0:length]