Commit eabdc320 authored by Stephan Mueller's avatar Stephan Mueller Committed by Herbert Xu

crypto: aesni - mark AES-NI helper ciphers

Flag all AES-NI helper ciphers as internal ciphers to prevent them from
being called by normal users.
Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b0cda2ba
...@@ -797,7 +797,9 @@ static int rfc4106_init(struct crypto_tfm *tfm) ...@@ -797,7 +797,9 @@ static int rfc4106_init(struct crypto_tfm *tfm)
PTR_ALIGN((u8 *)crypto_tfm_ctx(tfm), AESNI_ALIGN); PTR_ALIGN((u8 *)crypto_tfm_ctx(tfm), AESNI_ALIGN);
struct crypto_aead *cryptd_child; struct crypto_aead *cryptd_child;
struct aesni_rfc4106_gcm_ctx *child_ctx; struct aesni_rfc4106_gcm_ctx *child_ctx;
cryptd_tfm = cryptd_alloc_aead("__driver-gcm-aes-aesni", 0, 0); cryptd_tfm = cryptd_alloc_aead("__driver-gcm-aes-aesni",
CRYPTO_ALG_INTERNAL,
CRYPTO_ALG_INTERNAL);
if (IS_ERR(cryptd_tfm)) if (IS_ERR(cryptd_tfm))
return PTR_ERR(cryptd_tfm); return PTR_ERR(cryptd_tfm);
...@@ -1262,7 +1264,7 @@ static struct crypto_alg aesni_algs[] = { { ...@@ -1262,7 +1264,7 @@ static struct crypto_alg aesni_algs[] = { {
.cra_name = "__aes-aesni", .cra_name = "__aes-aesni",
.cra_driver_name = "__driver-aes-aesni", .cra_driver_name = "__driver-aes-aesni",
.cra_priority = 0, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_CIPHER, .cra_flags = CRYPTO_ALG_TYPE_CIPHER | CRYPTO_ALG_INTERNAL,
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) + .cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1, AESNI_ALIGN - 1,
...@@ -1281,7 +1283,8 @@ static struct crypto_alg aesni_algs[] = { { ...@@ -1281,7 +1283,8 @@ static struct crypto_alg aesni_algs[] = { {
.cra_name = "__ecb-aes-aesni", .cra_name = "__ecb-aes-aesni",
.cra_driver_name = "__driver-ecb-aes-aesni", .cra_driver_name = "__driver-ecb-aes-aesni",
.cra_priority = 0, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER, .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER |
CRYPTO_ALG_INTERNAL,
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) + .cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1, AESNI_ALIGN - 1,
...@@ -1301,7 +1304,8 @@ static struct crypto_alg aesni_algs[] = { { ...@@ -1301,7 +1304,8 @@ static struct crypto_alg aesni_algs[] = { {
.cra_name = "__cbc-aes-aesni", .cra_name = "__cbc-aes-aesni",
.cra_driver_name = "__driver-cbc-aes-aesni", .cra_driver_name = "__driver-cbc-aes-aesni",
.cra_priority = 0, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER, .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER |
CRYPTO_ALG_INTERNAL,
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) + .cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1, AESNI_ALIGN - 1,
...@@ -1365,7 +1369,8 @@ static struct crypto_alg aesni_algs[] = { { ...@@ -1365,7 +1369,8 @@ static struct crypto_alg aesni_algs[] = { {
.cra_name = "__ctr-aes-aesni", .cra_name = "__ctr-aes-aesni",
.cra_driver_name = "__driver-ctr-aes-aesni", .cra_driver_name = "__driver-ctr-aes-aesni",
.cra_priority = 0, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER, .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER |
CRYPTO_ALG_INTERNAL,
.cra_blocksize = 1, .cra_blocksize = 1,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) + .cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1, AESNI_ALIGN - 1,
...@@ -1409,7 +1414,7 @@ static struct crypto_alg aesni_algs[] = { { ...@@ -1409,7 +1414,7 @@ static struct crypto_alg aesni_algs[] = { {
.cra_name = "__gcm-aes-aesni", .cra_name = "__gcm-aes-aesni",
.cra_driver_name = "__driver-gcm-aes-aesni", .cra_driver_name = "__driver-gcm-aes-aesni",
.cra_priority = 0, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_AEAD, .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_INTERNAL,
.cra_blocksize = 1, .cra_blocksize = 1,
.cra_ctxsize = sizeof(struct aesni_rfc4106_gcm_ctx) + .cra_ctxsize = sizeof(struct aesni_rfc4106_gcm_ctx) +
AESNI_ALIGN, AESNI_ALIGN,
...@@ -1479,7 +1484,8 @@ static struct crypto_alg aesni_algs[] = { { ...@@ -1479,7 +1484,8 @@ static struct crypto_alg aesni_algs[] = { {
.cra_name = "__lrw-aes-aesni", .cra_name = "__lrw-aes-aesni",
.cra_driver_name = "__driver-lrw-aes-aesni", .cra_driver_name = "__driver-lrw-aes-aesni",
.cra_priority = 0, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER, .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER |
CRYPTO_ALG_INTERNAL,
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct aesni_lrw_ctx), .cra_ctxsize = sizeof(struct aesni_lrw_ctx),
.cra_alignmask = 0, .cra_alignmask = 0,
...@@ -1500,7 +1506,8 @@ static struct crypto_alg aesni_algs[] = { { ...@@ -1500,7 +1506,8 @@ static struct crypto_alg aesni_algs[] = { {
.cra_name = "__xts-aes-aesni", .cra_name = "__xts-aes-aesni",
.cra_driver_name = "__driver-xts-aes-aesni", .cra_driver_name = "__driver-xts-aes-aesni",
.cra_priority = 0, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER, .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER |
CRYPTO_ALG_INTERNAL,
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct aesni_xts_ctx), .cra_ctxsize = sizeof(struct aesni_xts_ctx),
.cra_alignmask = 0, .cra_alignmask = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment