[Solved] Soft signing issue
-
I tried to use the signer constructor with the '*' :
MySigningAtsha204Soft signer(true, *soft_serial)but it's not working. I need to use the ClearEepromConfig sketch to clean both gateway and node.No it's working but without the soft_serial function ...
-
You are not supposed to provide a soft_serial without using whitelisting. The argument you pass is directed to the randomseedPin for the software backend. It is optional to pass and if not passed, will default to MY_RANDOMSEED_PIN.
So simply don't enter and pass a soft_serial if you do not intend to use whitelisting and it should work.
You can see the software backends API here:
https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MySigningAtsha204Soft.h -
Ok ! It's clear !
So I enable
MY_SECURE_NODE_WHITELISTINGin MyConfig.h.I tried to compile the following code from your intial post:
MyTransportRFM69 transport; uint8_t soft_serial[SHA204_SERIAL_SZ] = {bla bla bla}; MySigningAtsha204Soft signer(true, 0, NULL, soft_serial);I got the following error:
In file included from SerialGateway.ino:34:0: /Users/carlierd/Arduino/libraries/MySensors/MySigningAtsha204.h:40:3: error: conflicting declaration 'typedef struct whitelist_entry_t whitelist_entry_t' } whitelist_entry_t; ^ In file included from SerialGateway.ino:33:0: /Users/carlierd/Arduino/libraries/MySensors/MySigningAtsha204Soft.h:44:3: error: 'whitelist_entry_t' has a previous declaration as 'typedef struct whitelist_entry_t whitelist_entry_t' } whitelist_entry_t; ^ Erreur lors de la compilation.I don't want to have a whitelist on the gateway. I think it's correct ?
Thanks !
-
Ok ! It's clear !
So I enable
MY_SECURE_NODE_WHITELISTINGin MyConfig.h.I tried to compile the following code from your intial post:
MyTransportRFM69 transport; uint8_t soft_serial[SHA204_SERIAL_SZ] = {bla bla bla}; MySigningAtsha204Soft signer(true, 0, NULL, soft_serial);I got the following error:
In file included from SerialGateway.ino:34:0: /Users/carlierd/Arduino/libraries/MySensors/MySigningAtsha204.h:40:3: error: conflicting declaration 'typedef struct whitelist_entry_t whitelist_entry_t' } whitelist_entry_t; ^ In file included from SerialGateway.ino:33:0: /Users/carlierd/Arduino/libraries/MySensors/MySigningAtsha204Soft.h:44:3: error: 'whitelist_entry_t' has a previous declaration as 'typedef struct whitelist_entry_t whitelist_entry_t' } whitelist_entry_t; ^ Erreur lors de la compilation.I don't want to have a whitelist on the gateway. I think it's correct ?
Thanks !
@carlierd if you don't want whitelisting I suggest you don't enable MY_SECURE_NODE_WHITELISTING and don't use the arguments for whitelisting. See the github link I posted for details on how the api changes based on the MY_SECURE_NODE_WHITELISTING flag.
-
It's probably not clear for me.
I understood that the whitelisting could be enable on node to only accept data from trust gateway (identified by the soft_serial).
So:- I set a soft_serial on the gateway and give a null withelist as I don't want to recompile the gateway for adding soft_serial of a new node.
- I will set a soft_serial on the node and give a whitelist with the soft_serial of the gateway.
I misunderstood ?
-
It's probably not clear for me.
I understood that the whitelisting could be enable on node to only accept data from trust gateway (identified by the soft_serial).
So:- I set a soft_serial on the gateway and give a null withelist as I don't want to recompile the gateway for adding soft_serial of a new node.
- I will set a soft_serial on the node and give a whitelist with the soft_serial of the gateway.
I misunderstood ?
@carlierd if you have not compiled your gw with whitelisting and given it a serial number, it will not salt the signature with that data, and signature will therefore not contain the necessary components for you node to identify your gw as a trusted sender, so if you want to use whitelisting, all nodes involved need to support this. I do believe this was stated on my topic on signatures but if it is missing, I will add that.
-
It's probably not clear for me.
I understood that the whitelisting could be enable on node to only accept data from trust gateway (identified by the soft_serial).
So:- I set a soft_serial on the gateway and give a null withelist as I don't want to recompile the gateway for adding soft_serial of a new node.
- I will set a soft_serial on the node and give a whitelist with the soft_serial of the gateway.
I misunderstood ?
-
I tried to compile the gw with the following code but it failed:
MyTransportRFM69 transport; uint8_t soft_serial[SHA204_SERIAL_SZ] = {bla bla bla}; MySigningAtsha204Soft signer(true, 0, NULL, soft_serial);It's not good ? What is wrong ?
@carlierd from the errors you listed above, it looks like you include two signing backends. Try only including the soft signing backend header since the backends declare conflicting whitelist structure types. They cannot be used simultaneously in the same sketch.