aboutsummaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-10-24 16:52:24 +0100
committerMichael Brown <mcb30@ipxe.org>2022-10-25 13:21:28 +0100
commit8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5 (patch)
tree59d27d4c71ed6c92b24d7fd6e007ed16e6379399 /src/net
parent52f72d298abd81a6102ddddf2fff4918e4b077ce (diff)
downloadipxe-8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5.tar.gz
[crypto] Allow initialisation vector length to vary from cipher blocksize
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/peerblk.c3
-rw-r--r--src/net/tls.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/net/peerblk.c b/src/net/peerblk.c
index f8994f42c..bbd5f16ed 100644
--- a/src/net/peerblk.c
+++ b/src/net/peerblk.c
@@ -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;
}
diff --git a/src/net/tls.c b/src/net/tls.c
index 4aa4d9e29..3545f12db 100644
--- a/src/net/tls.c
+++ b/src/net/tls.c
@@ -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;