summaryrefslogtreecommitdiff
path: root/crypto/af_alg.c
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2014-12-03 20:55:42 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2014-12-05 23:56:55 +0800
commit204444147a40d4aa44da07f510fba6098ea85434 (patch)
tree10c2bb59062715002f29d569fa382a3e7acbf5b2 /crypto/af_alg.c
parent06c75e42fcd4c40cc4aebd666f2c5ef86cc576e7 (diff)
downloadlinux-crypto-204444147a40d4aa44da07f510fba6098ea85434.tar.gz
linux-crypto-204444147a40d4aa44da07f510fba6098ea85434.zip
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/af_alg.c')
-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 6a3ad801..68ff1137 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)
con->op = *(u32 *)CMSG_DATA(cmsg);
break;
+ case ALG_SET_AEAD_ASSOCLEN:
+ if (cmsg->cmsg_len < CMSG_LEN(sizeof(u32)))
+ return -EINVAL;
+ con->aead_assoclen = *(u32 *)CMSG_DATA(cmsg);
+ break;
+
default:
return -EINVAL;
}