I’m trying to add a gadget-snap into an Ubuntu 18.04 desktop image. For this I use the command: sudo snap prepare-image --classic --snap [my_build_gadget_file.snap] model.assertion /mnt/. The model.assertion I got from my device by using: sudo snap known serial.
Sadly it fails with this message: assertion body length and declared body-length don’t match: 728 != 0. This is because it wants a body that matches the current body-length (which I haven’t defined because I don’t have a body yet). If I do change the body length to 728 it will say that my signature is empty. The problem is that because I don’t have I body it will see my signature as the body and think that the signature field is left empty.
According to https://docs.ubuntu.com/core/en/reference/assertions I don’t need a body, but still the message implies I do. What could I put in the body or is there some way to separate the two (body and signature).