mirror of
https://github.com/ipxe/ipxe
synced 2026-02-08 05:48:46 +03:00
[crypto] Allow initialisation vector length to vary from cipher blocksize
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -1033,7 +1033,8 @@ static int peerblk_parse_iv ( struct peerdist_block *peerblk, size_t buf_len,
|
||||
}
|
||||
|
||||
/* Set initialisation vector */
|
||||
cipher_setiv ( peerblk->cipher, peerblk->cipherctx, msg->msg.iv.data );
|
||||
cipher_setiv ( peerblk->cipher, peerblk->cipherctx, msg->msg.iv.data,
|
||||
blksize );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -717,14 +717,14 @@ static int tls_generate_keys ( struct tls_connection *tls ) {
|
||||
|
||||
/* TX initialisation vector */
|
||||
cipher_setiv ( tx_cipherspec->suite->cipher,
|
||||
tx_cipherspec->cipher_ctx, key );
|
||||
tx_cipherspec->cipher_ctx, key, iv_size );
|
||||
DBGC ( tls, "TLS %p TX IV:\n", tls );
|
||||
DBGC_HD ( tls, key, iv_size );
|
||||
key += iv_size;
|
||||
|
||||
/* RX initialisation vector */
|
||||
cipher_setiv ( rx_cipherspec->suite->cipher,
|
||||
rx_cipherspec->cipher_ctx, key );
|
||||
rx_cipherspec->cipher_ctx, key, iv_size );
|
||||
DBGC ( tls, "TLS %p RX IV:\n", tls );
|
||||
DBGC_HD ( tls, key, iv_size );
|
||||
key += iv_size;
|
||||
|
||||
Reference in New Issue
Block a user