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. Can't create MySigningAtsha204Soft signer

Can't create MySigningAtsha204Soft signer

Scheduled Pinned Locked Moved Troubleshooting
8 Posts 3 Posters 1.4k 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.
  • bogdanB Offline
    bogdanB Offline
    bogdan
    wrote on last edited by
    #1

    I'm trying to introduce signing to my projects, but can't create the MySigningAtsha204Soft object. What did I miss here:

    #include <SPI.h>
    #include <MySensor.h>  
    #include <DHT.h>  
    #include <MySigningAtsha204Soft.h>
    
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define HUMIDITY_SENSOR_DIGITAL_PIN 4
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    
    MyTransportNRF24 radio; // NRFRF24L01 radio driver 
    MyHwATMega328 hw; // Select AtMega328 hardware profile 
    // 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, 0, NULL, soft_serial); // Select SW ATSHA signing backend
    MySensor gw(radio, hw, signer);
    

    Compiler returns error: no matching function for call to 'MySigningAtsha204Soft::MySigningAtsha204Soft(bool, int, NULL, uint8_t [9])'

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      Which version of the MySensors library are you using? Looks like the example for 1.5.x, but I think it has changed for the development version.

      Either use the example with MySensors 1.5.x or use the development version and follow the instructions embedded in the source files (they are available online somewhere I think but I don't know where).

      bogdanB 1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        Which version of the MySensors library are you using? Looks like the example for 1.5.x, but I think it has changed for the development version.

        Either use the example with MySensors 1.5.x or use the development version and follow the instructions embedded in the source files (they are available online somewhere I think but I don't know where).

        bogdanB Offline
        bogdanB Offline
        bogdan
        wrote on last edited by
        #3

        @mfalkvidd I'm using 1.5.1 version of MySensors.

        1 Reply Last reply
        0
        • mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          Strange. The code looks fine to me. Maybe @Anticimex has a clue?

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

            You try to instantiate an object with arguments that indicate you want whitelisting. Are you sure you have set MY_SECURE_NODE_WHITELISTING? If you have not, you have an incorrect number of arguments.

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

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

              This is the constructor:

              MySigningAtsha204Soft(bool requestSignatures=true,
              #ifdef MY_SECURE_NODE_WHITELISTING
              		uint8_t nof_whitelist_entries=0, const whitelist_entry_t* the_whitelist=NULL,
              		const uint8_t* the_serial=NULL, //SHA204_SERIAL_SZ sized buffer expected if provided
              #endif
              		uint8_t randomseedPin=MY_RANDOMSEED_PIN);
              

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

              1 Reply Last reply
              0
              • bogdanB Offline
                bogdanB Offline
                bogdan
                wrote on last edited by bogdan
                #7

                Thank you, I managed to compile the program, by enabling whitelisting.
                But I don't understand, since I copied the sketch above from [security] Introducing signing support to MySensors, from example without whitelisting.
                And how can I tell if everything works fine (messages are properly signed). I receive messages on the Gateway, in debuuging i see:
                send: 28-28-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:1
                send: 28-28-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=ok:1.5.1
                send: 28-28-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
                no sign
                sensor started, id=28, parent=0, distance=1
                send: 28-28-0-0 s=255,c=3,t=11,pt=0,l=8,sg=0,st=ok:Humidity
                send: 28-28-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
                send: 28-28-0-0 s=0,c=0,t=7,pt=0,l=0,sg=0,st=ok:
                send: 28-28-0-0 s=1,c=0,t=6,pt=0,l=0,sg=0,st=ok:
                send: 28-28-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=ok:21.0
                T: 21.00
                send: 28-28-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,st=ok:45.0
                H: 45.00
                send: 28-28-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,st=ok:44.0
                H: 44.00
                send: 28-28-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,st=ok:45.0
                H: 45.00

                AnticimexA 1 Reply Last reply
                0
                • bogdanB bogdan

                  Thank you, I managed to compile the program, by enabling whitelisting.
                  But I don't understand, since I copied the sketch above from [security] Introducing signing support to MySensors, from example without whitelisting.
                  And how can I tell if everything works fine (messages are properly signed). I receive messages on the Gateway, in debuuging i see:
                  send: 28-28-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:1
                  send: 28-28-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=ok:1.5.1
                  send: 28-28-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
                  no sign
                  sensor started, id=28, parent=0, distance=1
                  send: 28-28-0-0 s=255,c=3,t=11,pt=0,l=8,sg=0,st=ok:Humidity
                  send: 28-28-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
                  send: 28-28-0-0 s=0,c=0,t=7,pt=0,l=0,sg=0,st=ok:
                  send: 28-28-0-0 s=1,c=0,t=6,pt=0,l=0,sg=0,st=ok:
                  send: 28-28-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=ok:21.0
                  T: 21.00
                  send: 28-28-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,st=ok:45.0
                  H: 45.00
                  send: 28-28-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,st=ok:44.0
                  H: 44.00
                  send: 28-28-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,st=ok:45.0
                  H: 45.00

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

                  @bogdan there are no signed messages in that log (sg=0). If you want signed messages, you need to tell your node to require signed messages. What settings have you enabled in your sketch in addition to enabling signing and whitelisting? Enabling signing just tells your sketch that it can sign messages, it does not mean that the node will require others to sign messages sent to it.

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

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


                  22

                  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