******************************************************************************/
+#define SILC_PRIVATE_MESSAGE_PAD(__payloadlen) (16 - (__payloadlen) % 16)
+
/* Private Message Payload structure. Contents of this structure is parsed
from SILC packets. */
struct SilcPrivateMessagePayloadStruct {
&new->message_len),
SILC_STR_END);
if (ret == -1) {
- SILC_LOG_ERROR(("Incorrect private message payload"));
+ SILC_LOG_DEBUG(("Incorrect private message payload"));
goto err;
}
if ((new->message_len < 1 || new->message_len > buffer->len)) {
- SILC_LOG_ERROR(("Incorrect private message payload in packet, "
+ SILC_LOG_DEBUG(("Incorrect private message payload in packet, "
"packet dropped"));
goto err;
}
int i;
SilcBuffer buffer;
uint32 len, pad_len = 0;
- unsigned char pad[SILC_PACKET_MAX_PADLEN];
+ unsigned char pad[16];
SILC_LOG_DEBUG(("Encoding private message payload"));
if (cipher) {
/* Calculate length of padding. */
- pad_len = SILC_PACKET_PADLEN((len + 2));
+ pad_len = SILC_PRIVATE_MESSAGE_PAD(len);
len += pad_len;
/* Generate padding */