29 #include "pprzlink/pprzlink_transport.h"
30 #include "pprzlink/pprz_transport.h"
35 #if USE_USB_SERIAL || USE_USB_SERIAL_DEBUG
44 #define KEY_EXCHANGE_MSG_ID_UAV 239
45 #define KEY_EXCHANGE_MSG_ID_GCS 159
46 #define WHITELIST_LEN 20
103 uint8_t *buf,
bool *msg_available);
Galois embedded crypto implementation.
void gec_dl_init(void)
Init function.
void gec_check_and_parse(struct link_device *dev, struct gec_transport *trans, uint8_t *buf, bool *msg_available)
Parsing a frame data and copy the payload to the datalink buffer.
uint8_t whitelist[WHITELIST_LEN]
bool gec_process_msg3(uint8_t *buf)
Process incoming message (expected MSG3) if the right (KEY_EXCHANGE) message received with the right ...
void respond_sts(struct link_device *dev, struct gec_transport *trans, uint8_t *buf)
void gec_add_to_whitelist(struct gec_whitelist *whitelist, uint8_t id)
uint8_t msg[TRANSPORT_PAYLOAD_LEN]
void gec_dl_event(void)
Datalink Event.
bool gec_encrypt_message(uint8_t *buf, uint8_t *payload_len)
Attempts message encryption Adds crypto_byte, counter and tag Returns encrypted pprzlink message (cry...
struct gec_transport gec_tp
PPRZ transport structure.
void gec_process_sts_msg(struct link_device *dev, struct gec_transport *trans, uint8_t *buf)
void finish_sts(struct link_device *dev, struct gec_transport *trans, uint8_t *buf)
bool gec_is_in_the_whitelist(struct gec_whitelist *whitelist, uint8_t id)
bool gec_decrypt_message(uint8_t *buf, volatile uint8_t *payload_len)
Attemp message decryption If a message is unencrypted, pass it through only if the MSG_ID is in the w...
void gec_process_msg1(uint8_t *buf)
NOTE: for RESPONDER party only Process incoming message (expected MSG1) if the right (KEY_EXCHANGE) m...
void gec_transport_init(struct gec_transport *t)
Whitelist for sending and receiving unencrypted messages (mostly for KEY_EXCHANGE messages)
Auxilliary message buffer for storing precomputed key exchange messages.
Utility functions and macros to abstract some RTOS functionalities such as mutexes.
static const struct usb_device_descriptor dev
uint8_t tx_msg[TRANSPORT_PAYLOAD_LEN]
struct transport_tx trans_tx
struct transport_rx trans_rx
struct pprz_transport pprz_tp
struct gec_whitelist whitelist
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.