paragonie / paseto

Platform-Agnostic Security Tokens
https://paseto.io
Other
3.25k stars 108 forks source link

Fix bug where footer of value of "0" would not be included in message #61

Closed aidantwoods closed 6 years ago

aidantwoods commented 6 years ago

if ($footer) will fail when the string is falsey (I think the only non-empty possibility is the string "0"). The signed/encrypted payload would account for the footer in the signature/mac/additional data, but the footer would not be included in the message format – which would cause verification of messages to fail (since a parser would not have a footer to read).


I also took this opportunity to move building of the message from its components into a centralised location.