0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd:Ⓜ️:vm: Fix b64 buffer size calc; minor cleanup.

This commit is contained in:
Jason Volk 2018-03-01 03:42:21 -08:00
parent ebed17d9d0
commit 5a744debe2

View file

@ -114,19 +114,19 @@ ircd::m::vm::commit(json::iov &event,
assert(self::public_key.verify(preimage, sig)); assert(self::public_key.verify(preimage, sig));
} }
char sigb64[64]; char sigb64[size_t(size(sig) * 1.34) + 1];
const json::members sigs const json::members sigs
{ {
{ my_host(), json::members { my_host(), json::members
{ {
json::member { self::public_key_id, b64encode_unpadded(sigb64, sig) } { self::public_key_id, b64encode_unpadded(sigb64, sig) }
}} }}
}; };
const json::iov::push _final[] const json::iov::push _final[]
{ {
{ event, { "content", content }},
{ event, { "signatures", sigs }}, { event, { "signatures", sigs }},
{ event, { "content", content }},
}; };
return commit(event); return commit(event);