aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2014-12-03 14:55:42 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2014-12-05 10:56:55 -0500
commitaf8e80731a94ff9de9508b01d9e5d931d538dc6b (patch)
treeab112b5744eeacddf7f749fe640601e55ecacf21 /crypto
parentbc84b94a715f3505f5f5981af0ec0362aa3fe38b (diff)
crypto: af_alg - add user space interface for AEAD
AEAD requires the caller to specify the following information separate from the data stream. This information allows the AEAD interface handler to identify the AAD, ciphertext/plaintext and the authentication tag: * Associated authentication data of arbitrary length and length * Length of authentication tag for encryption Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/af_alg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 6a3ad8011585..68ff1137dd70 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -421,6 +421,12 @@ int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con)
421 con->op = *(u32 *)CMSG_DATA(cmsg); 421 con->op = *(u32 *)CMSG_DATA(cmsg);
422 break; 422 break;
423 423
424 case ALG_SET_AEAD_ASSOCLEN:
425 if (cmsg->cmsg_len < CMSG_LEN(sizeof(u32)))
426 return -EINVAL;
427 con->aead_assoclen = *(u32 *)CMSG_DATA(cmsg);
428 break;
429
424 default: 430 default:
425 return -EINVAL; 431 return -EINVAL;
426 } 432 }