Function silc_message_payload_parse
SYNOPSIS
SilcMessagePayload
silc_message_payload_parse(unsigned char *payload,
SilcUInt32 payload_len,
bool private_message,
bool static_key,
SilcCipher cipher,
SilcHmac hmac);
DESCRIPTION
Parses Message Payload returning new payload structure. This also
decrypts the payload and checks the MAC. If the payload is
channel message then `private_message' is FALSE, and if it is
private message it is TRUE. If the private message key is static
(pre-shared key) then protocol dictates that the IV is present
and `static_key' must be set to TRUE. If the key is not static
(Key Agreement was done for the key) then it MUST be FALSE. For
channel messages the `static_key' is ignored.
If the `hmac' is no provided then the MAC of the channel message is
not verified. If the message is private message and `cipher' is NULL
then this assumes that the packet was decrypted with session keys
(no private message key) and this merely decodes the payload.
|