SilcHmac *ret_hmac_receive,
SilcHash *ret_hash)
{
- unsigned char iv[32];
+ unsigned char iv[SILC_HASH_MAXLEN];
SilcBool iv_included = (prop->flags & SILC_SKE_SP_FLAG_IV_INCLUDED);
/* Allocate ciphers to be used in the communication */
silc_hash_make(prop->hash, keymat->receive_iv, 8, iv);
if (!iv_included)
memcpy(iv + 4, keymat->receive_iv, 8);
+ else
+ memset(iv + 4, 0, 12);
}
silc_cipher_set_iv(*ret_send_key, iv);
silc_hash_make(prop->hash, keymat->send_iv, 8, iv);
if (!iv_included)
memcpy(iv + 4, keymat->send_iv, 8);
+ else
+ memset(iv + 4, 0, 12);
}
silc_cipher_set_iv(*ret_receive_key, iv);
silc_hash_make(prop->hash, keymat->send_iv, 8, iv);
if (!iv_included)
memcpy(iv + 4, keymat->send_iv, 8);
+ else
+ memset(iv + 4, 0, 12);
}
silc_cipher_set_iv(*ret_send_key, iv);
silc_hash_make(prop->hash, keymat->receive_iv, 8, iv);
if (!iv_included)
memcpy(iv + 4, keymat->receive_iv, 8);
- }
+ else
+ memset(iv + 4, 0, 12);
+ }
silc_cipher_set_iv(*ret_receive_key, iv);
} else {