Reduce the size of the msg chunk to fit header and footer
Reduce the size of the msg chunk to fit header and footer

Before encoding the response into the send buffer space was reserved
for the header, the signature (if applicable) and 2 bytes for the
padding (if applicable). When reserving space for the header, the
end of the buffer was moved out of bounds of the send buffer instead
of reducing the size available for encoded data. 2 bytes padding is
also not enough for worst-case padding scenarios.

With this fix the end buffer position is calculated correctly when
reserving space for the message header and enough space is reserved
for the padding (if the chunk shall be encrypted).

jpfr/open62541,StalderT/open62541,open62541/open62541,jpfr/open62541,JGrothoff/open62541,StalderT/open62541,JGrothoff/open62541,JGrothoff/open62541,open62541/open62541,jpfr/open62541,StalderT/open62541,open62541/open62541,open62541/open62541,JGrothoff/open62541,StalderT/open62541,jpfr/open62541