Skip to content

Add secure communication#31

Merged
Igor-Misic merged 3 commits into
masterfrom
pr-security
Aug 30, 2022
Merged

Add secure communication#31
Igor-Misic merged 3 commits into
masterfrom
pr-security

Conversation

@Igor-Misic

Copy link
Copy Markdown
Member

This PR brings the capability to secure communication between IMServer and IMBootloader.
The security mechanism is based on Monocypher.

How it works

The client (IMBootloader) and server (IMServer) exchange the keys to calculate the shared key. The shared key is used to encrypt the file (firmware or new bootloader) on the server side and decrypt the file on the client side.

Purpose

Protection from cloners.
Protection from malicious software attacks.

Current support

Currently, it only supports the STM32H7 MCUs family.

Usage

Build it with:
make stm32h7xx secure=true
make matek_H7_slim secure=true
This will set a SECURED macro that will activate code for a secure bootloader.

Man In The Middle attack prevention

Each time communication is started new keys are generated. This means each time different data is sent from server to client, in other words, captured data can't be used to flash it to another board with the same bootloader.

Pre-shared protection

In order for a file that is arriving to be fully protected Flash read protection needs to be activated at IMBootlaoader.
This way the pre-shared key is protected from JTAG/SWD readout.
If the SECURED flag is enabled, IMBootloader will prevent any unencrypted data to be written.

Other

When a secure bootloader is flashed loading unencrypted data with IMFlasher is disabled by default to prevent malicious software injection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant