Magic signatures in Bash

29 views
Skip to first unread message

@eschnou

unread,
Mar 15, 2011, 5:00:53 PM3/15/11
to salmon-...@googlegroups.com
Hi everyone,

While implementing Salmon Magic Signatures in my node-ostatus library [1], I realized there was no easy way to test and debug interoperability. It seems that some Python code is available but I'm not sure on how to use it and if it has been updated to the latest spec.

So, I hacked a bash script [2] to perform signature in command line using OpenSSL. It is simple to understand and a good peak at how the signature flow goes. Since it uses only command line tools available in every Linux distro, it makes it a good tool to debug your implementations.

You just need to generate a RSA key pair (see the documentation on Github) and then you can sign any file:
./sign.sh input.txt key.pem

It will output the signature as it would appear in me.sign (base64 etc) as well as the key that can be used in the user XRD and plenty of useful stuff.

Now... if some of you could have a quick look at test it with your implementation, I would appreciate. I'm still wondering if I got it right :-)

Thanks,

Laurent

John Panzer

unread,
Mar 16, 2011, 7:54:31 PM3/16/11
to salmon-...@googlegroups.com, @eschnou
Very cool :).
--
John Panzer / Google
jpa...@google.com / abstractioneer.org / @jpanzer

@eschnou

unread,
Mar 28, 2011, 4:31:51 AM3/28/11
to salmon-...@googlegroups.com, John Panzer
Very cool :).

Thanks. It would be great to have a common test framework, a documented test case or a reference implementation to validate implementations. I'm really struggling with interoperability. Could you or someone else spend some time and look into this bash implementation ?

I think it is flawed in fact, because in this example I'm using the hex representation of the SHA256 and not the binary one. This is unclear from the spec (and I have not looked into the RSA PKCS specification to see what is the right way to do it). Would be nice to clarify this in the spec and maybe add a complete example, with all steps documented. 

Cheers,

Laurent
Reply all
Reply to author
Forward
0 new messages