9. MixCAN Receiver
MixCAN receiver authenticates or verifies data framse based on its configuration. It monitors a set of CAN IDs and verifies authentication tags for it. It leverages the same short term symmetric key (STK) periodically received from the LTK-STK Slave service via mqtt as the MixCAN sender.
9.1. Requirements
Configured mosquitto mqtt broker
Configured dias-ltk-stk key manager
9.2. Installation
To install mixcan run the script from *toolchain/scripts/ :
./mixcan.sh r
The mixcan.service should look like this:
[Unit]
Description=Mixcan Module
[Service]Type=simple
ExecStart=/usr/bin/python3 /usr/lib/python3/dist-packages/mixcan/manager.py -c /etc/mixcan/config.ini
User=pi
Group=pi
[Install]
WantedBy=multi-user.target
And the /etc/mixcan/config.ini should look like this:
[mqtt]
user = mixcan
passwd = mixcan
host = 127.0.0.1
port = 1883
[key]
last_key = /etc/mixcan/keys/last_key.dat
[mixcan]
is_sender = False
frame_id = 0x11 0x12 0x13
mixcan_id = 0x21 0x22 0x23
[pycan]
can =can1
[log]
path = /var/log/mixcan/mixcan.log
where is_sender enables the service to send authenticated frames, frame_id is a sequence of CAN frame ids that are monitored, and mixcan_id is a list with a coresponding set of CAN frame ids authentication tags.