Skip to content

Commit 585cfbf

Browse files
jallisonciqbmastbergen
authored andcommitted
Add fips_approved indicator to struct crypto_aes_ctx.
Requested by lab. Signed-off-by: Jeremy Allison <jallison@ciq.com>
1 parent d9afdba commit 585cfbf

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

include/crypto/aes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct crypto_aes_ctx {
2626
u32 key_enc[AES_MAX_KEYLENGTH_U32];
2727
u32 key_dec[AES_MAX_KEYLENGTH_U32];
2828
u32 key_length;
29+
bool fips_approved;
2930
};
3031

3132
extern const u32 crypto_ft_tab[4][256] ____cacheline_aligned;

lib/crypto/aes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <crypto/aes.h>
77
#include <linux/crypto.h>
88
#include <linux/export.h>
9+
#include <linux/fips.h>
910
#include <linux/module.h>
1011
#include <linux/unaligned.h>
1112

@@ -246,6 +247,7 @@ int aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key,
246247
ctx->key_dec[i + 2] = ctx->key_enc[2];
247248
ctx->key_dec[i + 3] = ctx->key_enc[3];
248249

250+
ctx->fips_approved = fips_enabled;
249251
return 0;
250252
}
251253
EXPORT_SYMBOL(aes_expandkey);

0 commit comments

Comments
 (0)