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.
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.