- memcpy(iv, silc_cipher_get_iv(stream->receive_key), block_len);
- silc_cipher_decrypt(stream->receive_key, stream->inbuf.data,
+
+ if (stream->iv_included) {
+ /* IV is included in the ciphertext */
+ memcpy(iv, stream->inbuf.data, block_len);
+ ivlen = block_len;
+ psnlen = 4;
+ } else
+ memcpy(iv, silc_cipher_get_iv(stream->receive_key), block_len);
+
+ silc_cipher_decrypt(stream->receive_key, stream->inbuf.data + ivlen,