Closed unkaktus closed 7 years ago
There may be other related bugs.
Great, thanks!
MessagePlaintext is []byte because otr3 can send arbitrary messages, including binary data. string doesn't really suit this well.
Hm, this doesn't sound right to me. According to the specs plaintext is not arbitrary:
The plaintext message (either before encryption, or after decryption) consists of a human-readable message (encoded in UTF-8, optionally with HTML markup), optionally followed by: a single NUL (a BYTE with value 0x00), and ...
It should be in UTF-8 and must not contain NUL
byte - it will corrupt TLV data otherwise (e.g. it did so due to this bug).
So to conform the specs API should accept string
for plaintext message and then encode it into UTF-8 to put it into Data Message
.
Not doing so led to sending of zero-filled messages. This bug was introduced in 0f024454fd8a29bb7b59ca00515b67f8328a6151.
btw, what's the reason for
MessagePlaintext
being[]byte
and notstring
?