Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. [Solved] Soft signing issue

[Solved] Soft signing issue

Scheduled Pinned Locked Moved Troubleshooting
13 Posts 2 Posters 3.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • carlierdC Offline
    carlierdC Offline
    carlierd
    wrote on last edited by carlierd
    #1

    Hello,

    I followed the signing post to enable soft signing between a serial gateway and one temperature node.

    I first started by simply enabling MY_SIGNING_FEATUREand changing MY_HMAC_KEYin config.h. The result seems working correctly (I saw nonce and sign messages in MYSController).

    I then try to set a soft_serialto the gateway using the example giving in the signing post:

    // Change the soft_serial value to an arbitrary value for proper security
    uint8_t soft_serial[SHA204_SERIAL_SZ] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09};
    MySigningAtsha204Soft signer(true, soft_serial);  // Select SW ATSHA signing backend
    

    I got the following compilation error:

    SerialGateway:54: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'uint8_t {aka unsigned char}' [-fpermissive]
    In file included from SerialGateway.ino:34:0:
    /Users/carlierd/Arduino/libraries/MySensors/MySigningAtsha204Soft.h:57:2: error:   initializing argument 2 of 'MySigningAtsha204Soft::MySigningAtsha204Soft(bool, uint8_t)' [-fpermissive]
      MySigningAtsha204Soft(bool requestSignatures=true,
      ^
    invalid conversion from 'uint8_t* {aka unsigned char*}' to 'uint8_t {aka unsigned char}' [-fpermissive]
    

    If I add a '*' before soft_serial in MySigningAtsha204Soft signer(true, *soft_serial); it's compiling correctly.

    Why ? And is it correct with the '*' in the constructor ?

    Thanks,

    David.

    P.S.: For the moment I don't use the whitlist (I do step-by-step).

    1 Reply Last reply
    0
    • carlierdC Offline
      carlierdC Offline
      carlierd
      wrote on last edited by
      #2

      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 ...

      1 Reply Last reply
      0
      • AnticimexA Offline
        AnticimexA Offline
        Anticimex
        Contest Winner
        wrote on last edited by Anticimex
        #3

        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

        Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

        1 Reply Last reply
        0
        • carlierdC Offline
          carlierdC Offline
          carlierd
          wrote on last edited by
          #4

          Ok ! It's clear !

          So I enable MY_SECURE_NODE_WHITELISTING in 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 !

          AnticimexA 1 Reply Last reply
          0
          • carlierdC carlierd

            Ok ! It's clear !

            So I enable MY_SECURE_NODE_WHITELISTING in 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 !

            AnticimexA Offline
            AnticimexA Offline
            Anticimex
            Contest Winner
            wrote on last edited by
            #5

            @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.

            Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

            1 Reply Last reply
            0
            • carlierdC Offline
              carlierdC Offline
              carlierd
              wrote on last edited by
              #6

              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 ?

              AnticimexA 2 Replies Last reply
              0
              • carlierdC carlierd

                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 ?

                AnticimexA Offline
                AnticimexA Offline
                Anticimex
                Contest Winner
                wrote on last edited by
                #7

                @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.

                Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                1 Reply Last reply
                0
                • carlierdC carlierd

                  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 ?

                  AnticimexA Offline
                  AnticimexA Offline
                  Anticimex
                  Contest Winner
                  wrote on last edited by
                  #8

                  @carlierd that said, your understanding is correct. But you have to supply the proper constructor arguments.

                  Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                  1 Reply Last reply
                  0
                  • carlierdC Offline
                    carlierdC Offline
                    carlierd
                    wrote on last edited by
                    #9

                    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 ?

                    AnticimexA 1 Reply Last reply
                    0
                    • carlierdC carlierd

                      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 ?

                      AnticimexA Offline
                      AnticimexA Offline
                      Anticimex
                      Contest Winner
                      wrote on last edited by
                      #10

                      @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.

                      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                      1 Reply Last reply
                      0
                      • carlierdC Offline
                        carlierdC Offline
                        carlierd
                        wrote on last edited by
                        #11

                        So simple as soon as you give me the answer ;)

                        Thanks a lot !

                        AnticimexA 1 Reply Last reply
                        1
                        • carlierdC carlierd

                          So simple as soon as you give me the answer ;)

                          Thanks a lot !

                          AnticimexA Offline
                          AnticimexA Offline
                          Anticimex
                          Contest Winner
                          wrote on last edited by
                          #12

                          @carlierd no problem. I am on a phone so it is difficult to read the code formatting ok a small screen so I did not see the complete error message until now. Good to hear that it works now! :)

                          Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                          1 Reply Last reply
                          0
                          • carlierdC Offline
                            carlierdC Offline
                            carlierd
                            wrote on last edited by
                            #13

                            Thanks to take time ! Especially on your phone :)

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            17

                            Online

                            11.7k

                            Users

                            11.2k

                            Topics

                            113.1k

                            Posts


                            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • MySensors
                            • OpenHardware.io
                            • Categories
                            • Recent
                            • Tags
                            • Popular