Closed av8ta closed 5 years ago
okay, so the sign cap hmac's the content before signing it. https://github.com/ssbc/ssb-keys/blob/master/index.js#L124-L131
This gaurantees the signature to be different to a normal signature, so that the messages in your test net will never be valid to the main net.
From the error message I can instantly see that the problem here is just that something should have converted from the base64 string to a buffer but didn't. possibly that is my fault: https://github.com/ssbc/secure-scuttlebutt/blob/master/minimal.js#L138
Important Question: did you just start to see this error, or is this the first time you tried this?
I think this should happen on all messages, if it only happens on private messages and also not public messages, then there is something I still don't understand.
this should be fixed in secure-scuttlebutt@18.0.1, reinstalling should get you that.
Important Question: did you just start to see this error, or is this the first time you tried this?
First time I tried private messages with sign set.
Updated to secure-scuttlebutt@18.0.1 in scuttlebot but error is the same.
Installed scuttlebot@10.5.2 - private messages are working now with 'sign' set. I've tried a few of v11 but no luck. I'm starting to wonder if the api changed after v10?
This is the code that works with 10.5.2
sbot.private.publish(
// message:
{
type: 'post',
text: 'This is an encrypted message for testing purposes'
},
// recipient PKs:
[
"@32eYi2kQTUrEcbXI9MD7fjU+oXIQ+jELRLTVCwj9Rrg=.ed25519"
],
// cb:
function (err, privateMsg) {
if (err) console.log(err)
else console.log('privateMsg', privateMsg)
// privateMsg.value.content is
// an encrypted string
}
)
what version of ssb-keys do you have? post output of npm ls ssb-keys
?
Ah okay, the change between 10 and 11 is that it removed sbot.private
so that api must come via ssb-private plugin...
7.0.15
@av8ta Can you confirm that you're still facing this issue? I'd like to try to help but I'm not sure how to reproduce the problem.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
Hi all, I got this error when creating a private message using both my own code and from patchfoo:
It was on my test altnet called ssb-test with the following 'caps' settings in the config file:
I nuked the database and set the following config and was able to correctly publish a private message:
So it looks like having 'sign' set doesn't work as expected for private messages. Works fine for public ones though.