Closed jackturnbull closed 6 years ago
Hi,
The string returned from paseto_v2_encrypt
is standard C string and thus is null-terminated. The docs in the header file also mention this.
Nice that you're building Crystal bindings for paseto :+1:
Ah that's a little embarassing - totally missed that. Thanks :smile:
FYI I just changed the API and added v2.public. You might want to update :)
Oh wow good update! I'll get onto that this weekend, thanks :)
Apologies for the incorrect use of an issue but it feels like the best place to ask. I need a little guidance since I'm not very proficient at reading C and don't want to take something for granted that could potentially be unsafe.
I've written some Crystal C bindings for this library and the largest area of concern is that I'm allowing the Crystal string initialiser to step over the returned pointer from
paseto_v2_encrypt
which appears to terminate whenever reaches a zero byte.The libsodium docs suggest that the returned char* will be terminated with a
\0
character so I'm assuming that would be enough in this instance?Thanks for the lib!