Shouldn't this return the untrimmed `msg`?  As currently written, any non-signed packets will be overwritten with a boolean true, since we take any truthy values from this function as the new message.