Exemplo n.º 1
0
    def __init__(self, sim_env):
        ''' Constructor
            
            Input:    sim_env              simpy.Environment                 environment of this component
                      MessageClass         AbstractBusMessage                class that is used for sending and receiving
            Output:   -
        '''
        AbstractCommModule.__init__(self, sim_env)       
         
        # layers
        self.transp_lay = StdTransportLayer(sim_env)  
        self.datalink_lay = StdDatalinkLayer(sim_env)  
        self.physical_lay = StdPhysicalLayer(sim_env) 
        
        # preset used
        if GeneralSpecPreset().enabled: 
            self.transp_lay = GeneralSpecPreset().transport_layer(sim_env, proj.BUS_MSG_CLASS)  
            self.datalink_lay = GeneralSpecPreset().datalink_layer(sim_env)  
            self.physical_lay = GeneralSpecPreset().physical_layer(sim_env) 

        # interconnect layers
        self.datalink_lay.physical_lay = self.physical_lay
        self.transp_lay.datalink_lay = self.datalink_lay
        self.set_settings()
        
        # Timing Variables
        self.STDCM_RECEIVE_PROCESS = time.STDCM_RECEIVE_PROCESS
        self.STDCM_SEND_PROCESS = time.STDCM_SEND_PROCESS
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()
        
        # initialize
        self._init_layers(self.sim_env, self.MessageClass)
        
        # add tags
        self._tags = ["AUTH_SEND_TIME_BEFORE_ENCRYPTION", "AUTH_SEND_TIME_AFTER_ENCRYPTION", "AUTH_RECEIVE_TIME_BEFORE_DECRYPTION", "AUTH_RECEIVE_TIME_AFTER_DECRYPTION"]        
    
        # NEW: Add key pair - public and private
        assymetric_encryption_algorithm = AsymAuthMechEnum.RSA
        assymetric_encryption_key_length = AuKeyLengthEnum.bit_512
        assymetric_encryption_option = 65537
        self.priv_key, self.pub_key = encryption_tools.asy_get_key_pair(assymetric_encryption_algorithm, assymetric_encryption_key_length, assymetric_encryption_option)
        PublicKeyManager().add_key(self._ecu_id, self.pub_key) # make public key available to everybody
        
        self.first_message = False
Exemplo n.º 3
0
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()
        
        # initialize
        self._init_layers(self.sim_env, self.MessageClass)
        
        # add tags
        self._tags = ["AUTH_SEND_TIME_BEFORE_ENCRYPTION", "AUTH_SEND_TIME_AFTER_ENCRYPTION", "AUTH_RECEIVE_TIME_BEFORE_DECRYPTION", "AUTH_RECEIVE_TIME_AFTER_DECRYPTION"]        
    
        # NEW: Add key pair - public and private
        assymetric_encryption_algorithm = AsymAuthMechEnum.RSA
        assymetric_encryption_key_length = AuKeyLengthEnum.bit_512
        assymetric_encryption_option = 65537
        self.priv_key, self.pub_key = encryption_tools.asy_get_key_pair(assymetric_encryption_algorithm, assymetric_encryption_key_length, assymetric_encryption_option)
        PublicKeyManager().add_key(self._ecu_id, self.pub_key) # make public key available to everybody

        # Create a certificate from root L3 along L3 L31 L311
        [certificate, root_certificates_to_verify_this_certificate, priv_key] = GeneralSpecPreset().certificate_manager.generate_valid_ecu_cert(self._ecu_id, CAEnum.CA_L311, 0, float('inf'))
        self.my_certificate = certificate
        self.my_root_certificates = root_certificates_to_verify_this_certificate
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()
        self._have_session_key = False
        self._session_key = None
        
        # initialize
        self._init_layers(self.sim_env, self.MessageClass)
        
        # add tags
        self._tags = ["AUTH_SEND_TIME_BEFORE_ENCRYPTION", "AUTH_SEND_TIME_AFTER_ENCRYPTION", "AUTH_RECEIVE_TIME_BEFORE_DECRYPTION", "AUTH_RECEIVE_TIME_AFTER_DECRYPTION"]        
    
        # NEW: Add key pair - public and private
        assymetric_encryption_algorithm = AsymAuthMechEnum.RSA
        assymetric_encryption_key_length = AuKeyLengthEnum.bit_512
        assymetric_encryption_option = 65537
        self.priv_key, self.pub_key = encryption_tools.asy_get_key_pair(assymetric_encryption_algorithm, assymetric_encryption_key_length, assymetric_encryption_option)
        PublicKeyManager().add_key(self._ecu_id, self.pub_key) # make public key available to everybody

        # Create a certificate from root L3 along L3 L31 L311
        [certificate, root_certificates_to_verify_this_certificate, self.certificate_private_key] = GeneralSpecPreset().certificate_manager.generate_valid_ecu_cert(self._ecu_id, CAEnum.CA_L311, 0, float('inf'))
        self.my_certificate = certificate
        self.my_root_certificates = root_certificates_to_verify_this_certificate
Exemplo n.º 5
0
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()

        # initialize
        self._init_layers(self.sim_env, self.MessageClass)
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()
        
        # initialize
        self._init_layers(self.sim_env, self.MessageClass)
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()
        
        # initialize
        self._init_layers(self.sim_env, self.MessageClass)
        
        # add tags
        self._tags = ["AUTH_SEND_TIME_BEFORE_ENCRYPTION", "AUTH_SEND_TIME_AFTER_ENCRYPTION", "AUTH_RECEIVE_TIME_BEFORE_DECRYPTION", "AUTH_RECEIVE_TIME_AFTER_DECRYPTION"]        
Exemplo n.º 8
0
    def __init__(self, sim_env, MessageClass):
        ''' Constructor
            
            Input:    sim_env              simpy.Environment                environment of this component
                      MessageClass         AbstractBusMessage            class that is used for sending and receiving
            Output:   -
        '''
        AbstractCommModule.__init__(self, sim_env, MessageClass)

        # layers
        self.physical_lay = StdPhysicalLayer(sim_env)
        self.datalink_lay = StdDatalinkLayer(sim_env)
        self.transp_lay = SegmentTransportLayer(sim_env, MessageClass)

        # connection between layers
        self.datalink_lay.physical_lay = self.physical_lay
        self.transp_lay.datalink_lay = self.datalink_lay
        self.set_settings()

        # Timing Parameter
        self.SCM_RECEIVE_PROCESS = time.SCM_RECEIVE_PROCESS
        self.SCM_SEND_PROCESS = time.SCM_SEND_PROCESS
 def __init__(self, sim_env, MessageClass):
     ''' Constructor
         
         Input:    sim_env              simpy.Environment                environment of this component
                   MessageClass         AbstractBusMessage            class that is used for sending and receiving
         Output:   -
     '''
     AbstractCommModule.__init__(self, sim_env, MessageClass)       
      
     # layers
     self.physical_lay = StdPhysicalLayer(sim_env) 
     self.datalink_lay = StdDatalinkLayer(sim_env) 
     self.transp_lay = SegmentTransportLayer(sim_env, MessageClass)      
     
     # connection between layers
     self.datalink_lay.physical_lay = self.physical_lay
     self.transp_lay.datalink_lay = self.datalink_lay        
     self.set_settings()
     
     # Timing Parameter 
     self.SCM_RECEIVE_PROCESS = time.SCM_RECEIVE_PROCESS
     self.SCM_SEND_PROCESS = time.SCM_SEND_PROCESS
 def __init__(self, sim_env):
     ''' Constructor
         
         Input:  sim_env        simpy.Environment        environment of this component
         Output: -
     '''
     AbstractCommModule.__init__(self, sim_env)       
      
     # initialize layers
     self.transp_lay = FakeSegmentTransportLayer(sim_env, proj.BUS_MSG_CLASS)  
     self.datalink_lay = StdDatalinkLayer(sim_env)  
     self.physical_lay = StdPhysicalLayer(sim_env) 
     
     # preset used
     if GeneralSpecPreset().enabled: 
         self.transp_lay = GeneralSpecPreset().transport_layer(sim_env, proj.BUS_MSG_CLASS)  
         self.datalink_lay = GeneralSpecPreset().datalink_layer(sim_env)  
         self.physical_lay = GeneralSpecPreset().physical_layer(sim_env) 
               
     # connect layers
     self.datalink_lay.physical_lay = self.physical_lay
     self.transp_lay.datalink_lay = self.datalink_lay
Exemplo n.º 11
0
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()

        # initialize
        self._init_layers(self.sim_env, self.MessageClass)

        # add tags
        self._tags = [
            "AUTH_SEND_TIME_BEFORE_ENCRYPTION",
            "AUTH_SEND_TIME_AFTER_ENCRYPTION",
            "AUTH_RECEIVE_TIME_BEFORE_DECRYPTION",
            "AUTH_RECEIVE_TIME_AFTER_DECRYPTION"
        ]

        # NEW: Add key pair - public and private
        assymetric_encryption_algorithm = AsymAuthMechEnum.RSA
        assymetric_encryption_key_length = AuKeyLengthEnum.bit_512
        assymetric_encryption_option = 65537
        self.priv_key, self.pub_key = encryption_tools.asy_get_key_pair(
            assymetric_encryption_algorithm, assymetric_encryption_key_length,
            assymetric_encryption_option)
        PublicKeyManager().add_key(
            self._ecu_id,
            self.pub_key)  # make public key available to everybody

        self.first_message = False
Exemplo n.º 12
0
    def __init__(self, sim_env, ecu_id):
        ''' Constructor
            
            Input:  ecu_id         string                   id of the corresponding AbstractECU
                    sim_env        simpy.Environment        environment of this component
            Output:  -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # local parameters
        self._ecu_id = ecu_id
        self._jitter_in = 1
        self.monitor_list = RefList()

        # initialize
        self._init_layers(self.sim_env, self.MessageClass)

        # add tags
        self._tags = [
            "AUTH_SEND_TIME_BEFORE_ENCRYPTION",
            "AUTH_SEND_TIME_AFTER_ENCRYPTION",
            "AUTH_RECEIVE_TIME_BEFORE_DECRYPTION",
            "AUTH_RECEIVE_TIME_AFTER_DECRYPTION"
        ]
Exemplo n.º 13
0
    def __init__(self, sim_env):
        ''' Constructor
            
            Input:  sim_env        simpy.Environment        environment of this component
            Output: -
        '''
        AbstractCommModule.__init__(self, sim_env)

        # initialize layers
        self.transp_lay = FakeSegmentTransportLayer(sim_env,
                                                    proj.BUS_MSG_CLASS)
        self.datalink_lay = StdDatalinkLayer(sim_env)
        self.physical_lay = StdPhysicalLayer(sim_env)

        # preset used
        if GeneralSpecPreset().enabled:
            self.transp_lay = GeneralSpecPreset().transport_layer(
                sim_env, proj.BUS_MSG_CLASS)
            self.datalink_lay = GeneralSpecPreset().datalink_layer(sim_env)
            self.physical_lay = GeneralSpecPreset().physical_layer(sim_env)

        # connect layers
        self.datalink_lay.physical_lay = self.physical_lay
        self.transp_lay.datalink_lay = self.datalink_lay