[crypto] Allow cipher_setiv() to return an error

GCM ciphers can accept initialisation vectors of any length.  Move the
responsibility for checking the initialisation vector length from the
caller into the implementation of cipher_setiv().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-06-19 14:11:46 +01:00
parent 21babfc392
commit 2420211e7f
11 changed files with 71 additions and 37 deletions
+4 -3
View File
@@ -67,10 +67,11 @@ int cipher_null_setkey ( struct cipher_algorithm *cipher __unused,
return 0;
}
void cipher_null_setiv ( struct cipher_algorithm *cipher __unused,
void *ctx __unused, const void *iv __unused,
size_t ivlen __unused ) {
int cipher_null_setiv ( struct cipher_algorithm *cipher __unused,
void *ctx __unused, const void *iv __unused,
size_t ivlen __unused ) {
/* Do nothing */
return 0;
}
void cipher_null_encrypt ( struct cipher_algorithm *cipher __unused,