aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-02-02 17:09:06 +0000
committerMichael Brown <mcb30@ipxe.org>2024-02-02 17:09:06 +0000
commit36a27b22b1c4a587e66cc1eff1193f6c8c927b05 (patch)
treeac01b539f065ca51c1b16b3d12cfd6477606a474
parent0cc0f47443ef9711775a748c2b0fb40e38643733 (diff)
downloadipxe-36a27b22b1c4a587e66cc1eff1193f6c8c927b05.zip
ipxe-36a27b22b1c4a587e66cc1eff1193f6c8c927b05.tar.gz
ipxe-36a27b22b1c4a587e66cc1eff1193f6c8c927b05.tar.bz2
[crypto] Fix stray references to AES
The CBC_CIPHER() macro contains some accidentally hardcoded references to an underlying AES cipher, instead of using the cipher specified in the macro parameters. Fix by using the macro parameter as required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/include/ipxe/cbc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/ipxe/cbc.h b/src/include/ipxe/cbc.h
index 382fc90..f02e519 100644
--- a/src/include/ipxe/cbc.h
+++ b/src/include/ipxe/cbc.h
@@ -77,19 +77,19 @@ static void _cbc_name ## _setiv ( void *ctx, const void *iv, \
size_t ivlen ) { \
struct _cbc_name ## _context * _cbc_name ## _ctx = ctx; \
cbc_setiv ( &_cbc_name ## _ctx->raw_ctx, iv, ivlen, \
- &_raw_cipher, &aes_cbc_ctx->cbc_ctx ); \
+ &_raw_cipher, &_cbc_name ## _ctx->cbc_ctx ); \
} \
static void _cbc_name ## _encrypt ( void *ctx, const void *src, \
void *dst, size_t len ) { \
struct _cbc_name ## _context * _cbc_name ## _ctx = ctx; \
cbc_encrypt ( &_cbc_name ## _ctx->raw_ctx, src, dst, len, \
- &_raw_cipher, &aes_cbc_ctx->cbc_ctx ); \
+ &_raw_cipher, &_cbc_name ## _ctx->cbc_ctx ); \
} \
static void _cbc_name ## _decrypt ( void *ctx, const void *src, \
void *dst, size_t len ) { \
struct _cbc_name ## _context * _cbc_name ## _ctx = ctx; \
cbc_decrypt ( &_cbc_name ## _ctx->raw_ctx, src, dst, len, \
- &_raw_cipher, &aes_cbc_ctx->cbc_ctx ); \
+ &_raw_cipher, &_cbc_name ## _ctx->cbc_ctx ); \
} \
struct cipher_algorithm _cbc_cipher = { \
.name = #_cbc_name, \