MySensors Library & Examples  2.3.2-62-ge298769
MySigning.h
Go to the documentation of this file.
1 /*
2  * The MySensors Arduino library handles the wireless radio link and protocol
3  * between your home built sensors/actuators and HA controller of choice.
4  * The sensors forms a self healing radio network with optional repeaters. Each
5  * repeater and gateway builds a routing tables in EEPROM which keeps track of the
6  * network topology allowing messages to be routed to nodes.
7  *
8  * Created by Henrik Ekblad <[email protected]>
9  * Copyright (C) 2013-2022 Sensnology AB
10  * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11  *
12  * Documentation: http://www.mysensors.org
13  * Support Forum: http://forum.mysensors.org
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * version 2 as published by the Free Software Foundation.
18  */
599 #ifndef MySigning_h
600 #define MySigning_h
601 
602 #include "MySensorsCore.h"
603 #include "drivers/ATSHA204/ATSHA204.h"
604 
605 #ifdef MY_SIGNING_NODE_WHITELISTING
606 typedef struct {
607  uint8_t nodeId;
608  uint8_t serial[SHA204_SERIAL_SZ];
609 } whitelist_entry_t;
610 #endif
611 
613 #define NUM_OF(x) (sizeof(x)/sizeof(x[0]))
614 
622 void signerInit(void);
623 
639 void signerPresentation(MyMessage &msg, uint8_t destination);
640 
653 
662 bool signerCheckTimer(void);
663 
677 bool signerPutNonce(MyMessage &msg);
678 
695 bool signerSignMsg(MyMessage &msg);
696 
712 bool signerVerifyMsg(MyMessage &msg);
713 
726 int signerMemcmp(const void* a, const void* b, size_t sz);
727 
728 #endif
729 
signerVerifyMsg
bool signerVerifyMsg(MyMessage &msg)
Verifies signature in provided message.
MySensorsCore.h
destination
uint8_t destination
8 bit - Id of destination node
Definition: MyMessage.h:336
signerPresentation
void signerPresentation(MyMessage &msg, uint8_t destination)
Does signing specific presentation for a node.
signerPutNonce
bool signerPutNonce(MyMessage &msg)
Get nonce from provided message and store for signing operations.
signerSignMsg
bool signerSignMsg(MyMessage &msg)
Signs provided message. All remaining space in message payload buffer is used for signing identifier ...
signerProcessInternal
bool signerProcessInternal(MyMessage &msg)
Manages internal signing message handshaking.
signerMemcmp
int signerMemcmp(const void *a, const void *b, size_t sz)
Do a timing neutral memory comparison.
signerCheckTimer
bool signerCheckTimer(void)
Check timeout of verification session.
signerInit
void signerInit(void)
Initializes signing infrastructure and associated backend.
MyMessage
MyMessage is used to create, manipulate, send and read MySensors messages.
Definition: MyMessage.h:290