Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Authenc: Simple AEAD wrapper for IPsec |
| 4 | * |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 5 | * Copyright (c) 2007-2015 Herbert Xu <herbert@gondor.apana.org.au> |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 6 | */ |
| 7 | |
Herbert Xu | 68acbf8 | 2015-05-11 17:47:41 +0800 | [diff] [blame] | 8 | #include <crypto/internal/aead.h> |
Herbert Xu | 5f7082e | 2008-08-31 22:21:09 +1000 | [diff] [blame] | 9 | #include <crypto/internal/hash.h> |
Herbert Xu | 9ffde35a | 2007-12-17 20:12:49 +0800 | [diff] [blame] | 10 | #include <crypto/internal/skcipher.h> |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 11 | #include <crypto/authenc.h> |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 12 | #include <crypto/null.h> |
Herbert Xu | 42c271c | 2007-12-07 18:52:49 +0800 | [diff] [blame] | 13 | #include <crypto/scatterwalk.h> |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 14 | #include <linux/err.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/module.h> |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 18 | #include <linux/rtnetlink.h> |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 19 | #include <linux/slab.h> |
| 20 | #include <linux/spinlock.h> |
| 21 | |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 22 | struct authenc_instance_ctx { |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 23 | struct crypto_ahash_spawn auth; |
Herbert Xu | 9ffde35a | 2007-12-17 20:12:49 +0800 | [diff] [blame] | 24 | struct crypto_skcipher_spawn enc; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 25 | unsigned int reqoff; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | struct crypto_authenc_ctx { |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 29 | struct crypto_ahash *auth; |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 30 | struct crypto_skcipher *enc; |
Kees Cook | 8d60539 | 2018-09-18 19:10:51 -0700 | [diff] [blame] | 31 | struct crypto_sync_skcipher *null; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 32 | }; |
| 33 | |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 34 | struct authenc_request_ctx { |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 35 | struct scatterlist src[2]; |
| 36 | struct scatterlist dst[2]; |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 37 | char tail[]; |
| 38 | }; |
| 39 | |
Herbert Xu | 180ce7e | 2010-04-26 09:14:05 +0800 | [diff] [blame] | 40 | static void authenc_request_complete(struct aead_request *req, int err) |
| 41 | { |
| 42 | if (err != -EINPROGRESS) |
| 43 | aead_request_complete(req, err); |
| 44 | } |
| 45 | |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 46 | int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key, |
| 47 | unsigned int keylen) |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 48 | { |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 49 | struct rtattr *rta = (struct rtattr *)key; |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 50 | struct crypto_authenc_key_param *param; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 51 | |
Herbert Xu | 12dc5e6 | 2007-12-10 10:55:21 +0800 | [diff] [blame] | 52 | if (!RTA_OK(rta, keylen)) |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 53 | return -EINVAL; |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 54 | if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 55 | return -EINVAL; |
Eric Biggers | 8f9c469 | 2018-12-16 23:23:22 -0800 | [diff] [blame] | 56 | |
| 57 | /* |
| 58 | * RTA_OK() didn't align the rtattr's payload when validating that it |
| 59 | * fits in the buffer. Yet, the keys should start on the next 4-byte |
| 60 | * aligned boundary. To avoid confusion, require that the rtattr |
| 61 | * payload be exactly the param struct, which has a 4-byte aligned size. |
| 62 | */ |
| 63 | if (RTA_PAYLOAD(rta) != sizeof(*param)) |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 64 | return -EINVAL; |
Eric Biggers | 8f9c469 | 2018-12-16 23:23:22 -0800 | [diff] [blame] | 65 | BUILD_BUG_ON(sizeof(*param) % RTA_ALIGNTO); |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 66 | |
| 67 | param = RTA_DATA(rta); |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 68 | keys->enckeylen = be32_to_cpu(param->enckeylen); |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 69 | |
Eric Biggers | 8f9c469 | 2018-12-16 23:23:22 -0800 | [diff] [blame] | 70 | key += rta->rta_len; |
| 71 | keylen -= rta->rta_len; |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 72 | |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 73 | if (keylen < keys->enckeylen) |
| 74 | return -EINVAL; |
Herbert Xu | e236d4a | 2007-11-22 23:11:53 +0800 | [diff] [blame] | 75 | |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 76 | keys->authkeylen = keylen - keys->enckeylen; |
| 77 | keys->authkey = key; |
| 78 | keys->enckey = key + keys->authkeylen; |
| 79 | |
| 80 | return 0; |
| 81 | } |
| 82 | EXPORT_SYMBOL_GPL(crypto_authenc_extractkeys); |
| 83 | |
| 84 | static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, |
| 85 | unsigned int keylen) |
| 86 | { |
| 87 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
| 88 | struct crypto_ahash *auth = ctx->auth; |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 89 | struct crypto_skcipher *enc = ctx->enc; |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 90 | struct crypto_authenc_keys keys; |
| 91 | int err = -EINVAL; |
| 92 | |
| 93 | if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) |
Eric Biggers | 674f368 | 2019-12-30 21:19:36 -0600 | [diff] [blame] | 94 | goto out; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 95 | |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 96 | crypto_ahash_clear_flags(auth, CRYPTO_TFM_REQ_MASK); |
| 97 | crypto_ahash_set_flags(auth, crypto_aead_get_flags(authenc) & |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 98 | CRYPTO_TFM_REQ_MASK); |
Mathias Krause | bc6e2bd | 2013-10-15 13:49:30 +0200 | [diff] [blame] | 99 | err = crypto_ahash_setkey(auth, keys.authkey, keys.authkeylen); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 100 | if (err) |
| 101 | goto out; |
| 102 | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 103 | crypto_skcipher_clear_flags(enc, CRYPTO_TFM_REQ_MASK); |
| 104 | crypto_skcipher_set_flags(enc, crypto_aead_get_flags(authenc) & |
| 105 | CRYPTO_TFM_REQ_MASK); |
| 106 | err = crypto_skcipher_setkey(enc, keys.enckey, keys.enckeylen); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 107 | out: |
Tudor-Dan Ambarus | ad2fdcd | 2018-04-03 09:39:00 +0300 | [diff] [blame] | 108 | memzero_explicit(&keys, sizeof(keys)); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 109 | return err; |
| 110 | } |
| 111 | |
Herbert Xu | 255e48e | 2023-02-08 13:58:44 +0800 | [diff] [blame] | 112 | static void authenc_geniv_ahash_done(void *data, int err) |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 113 | { |
Herbert Xu | 255e48e | 2023-02-08 13:58:44 +0800 | [diff] [blame] | 114 | struct aead_request *req = data; |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 115 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 116 | struct aead_instance *inst = aead_alg_instance(authenc); |
| 117 | struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 118 | struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 119 | struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 120 | |
| 121 | if (err) |
| 122 | goto out; |
| 123 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 124 | scatterwalk_map_and_copy(ahreq->result, req->dst, |
| 125 | req->assoclen + req->cryptlen, |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 126 | crypto_aead_authsize(authenc), 1); |
| 127 | |
| 128 | out: |
| 129 | aead_request_complete(req, err); |
| 130 | } |
| 131 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 132 | static int crypto_authenc_genicv(struct aead_request *req, unsigned int flags) |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 133 | { |
| 134 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 135 | struct aead_instance *inst = aead_alg_instance(authenc); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 136 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 137 | struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 138 | struct crypto_ahash *auth = ctx->auth; |
| 139 | struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 140 | struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 141 | u8 *hash = areq_ctx->tail; |
| 142 | int err; |
| 143 | |
| 144 | hash = (u8 *)ALIGN((unsigned long)hash + crypto_ahash_alignmask(auth), |
| 145 | crypto_ahash_alignmask(auth) + 1); |
| 146 | |
| 147 | ahash_request_set_tfm(ahreq, auth); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 148 | ahash_request_set_crypt(ahreq, req->dst, hash, |
| 149 | req->assoclen + req->cryptlen); |
| 150 | ahash_request_set_callback(ahreq, flags, |
| 151 | authenc_geniv_ahash_done, req); |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 152 | |
| 153 | err = crypto_ahash_digest(ahreq); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 154 | if (err) |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 155 | return err; |
Herbert Xu | 7c3d703 | 2007-12-10 16:15:41 +0800 | [diff] [blame] | 156 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 157 | scatterwalk_map_and_copy(hash, req->dst, req->assoclen + req->cryptlen, |
Herbert Xu | 7ba683a | 2007-12-02 18:49:21 +1100 | [diff] [blame] | 158 | crypto_aead_authsize(authenc), 1); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 159 | |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 160 | return 0; |
| 161 | } |
| 162 | |
Herbert Xu | 255e48e | 2023-02-08 13:58:44 +0800 | [diff] [blame] | 163 | static void crypto_authenc_encrypt_done(void *data, int err) |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 164 | { |
Herbert Xu | 255e48e | 2023-02-08 13:58:44 +0800 | [diff] [blame] | 165 | struct aead_request *areq = data; |
Herbert Xu | a697690 | 2008-08-23 01:04:06 +1000 | [diff] [blame] | 166 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 167 | if (err) |
| 168 | goto out; |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 169 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 170 | err = crypto_authenc_genicv(areq, 0); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 171 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 172 | out: |
Herbert Xu | 180ce7e | 2010-04-26 09:14:05 +0800 | [diff] [blame] | 173 | authenc_request_complete(areq, err); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 174 | } |
| 175 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 176 | static int crypto_authenc_copy_assoc(struct aead_request *req) |
| 177 | { |
| 178 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); |
| 179 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
Kees Cook | 8d60539 | 2018-09-18 19:10:51 -0700 | [diff] [blame] | 180 | SYNC_SKCIPHER_REQUEST_ON_STACK(skreq, ctx->null); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 181 | |
Kees Cook | 8d60539 | 2018-09-18 19:10:51 -0700 | [diff] [blame] | 182 | skcipher_request_set_sync_tfm(skreq, ctx->null); |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 183 | skcipher_request_set_callback(skreq, aead_request_flags(req), |
| 184 | NULL, NULL); |
| 185 | skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen, |
| 186 | NULL); |
| 187 | |
| 188 | return crypto_skcipher_encrypt(skreq); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 189 | } |
| 190 | |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 191 | static int crypto_authenc_encrypt(struct aead_request *req) |
| 192 | { |
| 193 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 194 | struct aead_instance *inst = aead_alg_instance(authenc); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 195 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 196 | struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); |
Steffen Klassert | 50beceb | 2010-03-03 22:41:08 +0800 | [diff] [blame] | 197 | struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 198 | struct crypto_skcipher *enc = ctx->enc; |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 199 | unsigned int cryptlen = req->cryptlen; |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 200 | struct skcipher_request *skreq = (void *)(areq_ctx->tail + |
| 201 | ictx->reqoff); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 202 | struct scatterlist *src, *dst; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 203 | int err; |
| 204 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 205 | src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); |
| 206 | dst = src; |
| 207 | |
| 208 | if (req->src != req->dst) { |
| 209 | err = crypto_authenc_copy_assoc(req); |
| 210 | if (err) |
| 211 | return err; |
| 212 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 213 | dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); |
| 214 | } |
| 215 | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 216 | skcipher_request_set_tfm(skreq, enc); |
| 217 | skcipher_request_set_callback(skreq, aead_request_flags(req), |
| 218 | crypto_authenc_encrypt_done, req); |
| 219 | skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 220 | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 221 | err = crypto_skcipher_encrypt(skreq); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 222 | if (err) |
| 223 | return err; |
| 224 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 225 | return crypto_authenc_genicv(req, aead_request_flags(req)); |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 226 | } |
| 227 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 228 | static int crypto_authenc_decrypt_tail(struct aead_request *req, |
| 229 | unsigned int flags) |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 230 | { |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 231 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); |
| 232 | struct aead_instance *inst = aead_alg_instance(authenc); |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 233 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 234 | struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); |
| 235 | struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); |
| 236 | struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 237 | struct skcipher_request *skreq = (void *)(areq_ctx->tail + |
| 238 | ictx->reqoff); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 239 | unsigned int authsize = crypto_aead_authsize(authenc); |
| 240 | u8 *ihash = ahreq->result + authsize; |
| 241 | struct scatterlist *src, *dst; |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 242 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 243 | scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0); |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 244 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 245 | if (crypto_memneq(ihash, ahreq->result, authsize)) |
| 246 | return -EBADMSG; |
| 247 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 248 | src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); |
| 249 | dst = src; |
| 250 | |
Harsh Jain | c34252f | 2016-06-29 00:24:43 +0530 | [diff] [blame] | 251 | if (req->src != req->dst) |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 252 | dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 253 | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 254 | skcipher_request_set_tfm(skreq, ctx->enc); |
Herbert Xu | 66eae85 | 2022-01-19 17:58:40 +1100 | [diff] [blame] | 255 | skcipher_request_set_callback(skreq, flags, |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 256 | req->base.complete, req->base.data); |
| 257 | skcipher_request_set_crypt(skreq, src, dst, |
| 258 | req->cryptlen - authsize, req->iv); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 259 | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 260 | return crypto_skcipher_decrypt(skreq); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 261 | } |
| 262 | |
Herbert Xu | 255e48e | 2023-02-08 13:58:44 +0800 | [diff] [blame] | 263 | static void authenc_verify_ahash_done(void *data, int err) |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 264 | { |
Herbert Xu | 255e48e | 2023-02-08 13:58:44 +0800 | [diff] [blame] | 265 | struct aead_request *req = data; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 266 | |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 267 | if (err) |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 268 | goto out; |
Herbert Xu | e56dd56 | 2007-12-10 16:20:24 +0800 | [diff] [blame] | 269 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 270 | err = crypto_authenc_decrypt_tail(req, 0); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 271 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 272 | out: |
| 273 | authenc_request_complete(req, err); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 274 | } |
| 275 | |
| 276 | static int crypto_authenc_decrypt(struct aead_request *req) |
| 277 | { |
| 278 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); |
Herbert Xu | 481f34a | 2007-12-04 20:04:21 +1100 | [diff] [blame] | 279 | unsigned int authsize = crypto_aead_authsize(authenc); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 280 | struct aead_instance *inst = aead_alg_instance(authenc); |
| 281 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
| 282 | struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); |
| 283 | struct crypto_ahash *auth = ctx->auth; |
| 284 | struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); |
| 285 | struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); |
| 286 | u8 *hash = areq_ctx->tail; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 287 | int err; |
| 288 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 289 | hash = (u8 *)ALIGN((unsigned long)hash + crypto_ahash_alignmask(auth), |
| 290 | crypto_ahash_alignmask(auth) + 1); |
Herbert Xu | 481f34a | 2007-12-04 20:04:21 +1100 | [diff] [blame] | 291 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 292 | ahash_request_set_tfm(ahreq, auth); |
| 293 | ahash_request_set_crypt(ahreq, req->src, hash, |
| 294 | req->assoclen + req->cryptlen - authsize); |
| 295 | ahash_request_set_callback(ahreq, aead_request_flags(req), |
| 296 | authenc_verify_ahash_done, req); |
| 297 | |
| 298 | err = crypto_ahash_digest(ahreq); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 299 | if (err) |
| 300 | return err; |
| 301 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 302 | return crypto_authenc_decrypt_tail(req, aead_request_flags(req)); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 303 | } |
| 304 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 305 | static int crypto_authenc_init_tfm(struct crypto_aead *tfm) |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 306 | { |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 307 | struct aead_instance *inst = aead_alg_instance(tfm); |
| 308 | struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); |
| 309 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(tfm); |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 310 | struct crypto_ahash *auth; |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 311 | struct crypto_skcipher *enc; |
Kees Cook | 8d60539 | 2018-09-18 19:10:51 -0700 | [diff] [blame] | 312 | struct crypto_sync_skcipher *null; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 313 | int err; |
| 314 | |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 315 | auth = crypto_spawn_ahash(&ictx->auth); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 316 | if (IS_ERR(auth)) |
| 317 | return PTR_ERR(auth); |
| 318 | |
Eric Biggers | 60425a8 | 2016-10-28 09:52:19 -0700 | [diff] [blame] | 319 | enc = crypto_spawn_skcipher(&ictx->enc); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 320 | err = PTR_ERR(enc); |
| 321 | if (IS_ERR(enc)) |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 322 | goto err_free_ahash; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 323 | |
Eric Biggers | 3a2d4fb | 2017-12-07 10:56:34 -0800 | [diff] [blame] | 324 | null = crypto_get_default_null_skcipher(); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 325 | err = PTR_ERR(null); |
| 326 | if (IS_ERR(null)) |
| 327 | goto err_free_skcipher; |
| 328 | |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 329 | ctx->auth = auth; |
| 330 | ctx->enc = enc; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 331 | ctx->null = null; |
Richard Hartmann | f3542e6 | 2010-02-16 20:27:20 +0800 | [diff] [blame] | 332 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 333 | crypto_aead_set_reqsize( |
| 334 | tfm, |
Herbert Xu | 25df919 | 2015-05-11 17:47:53 +0800 | [diff] [blame] | 335 | sizeof(struct authenc_request_ctx) + |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 336 | ictx->reqoff + |
Herbert Xu | 25df919 | 2015-05-11 17:47:53 +0800 | [diff] [blame] | 337 | max_t(unsigned int, |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 338 | crypto_ahash_reqsize(auth) + |
| 339 | sizeof(struct ahash_request), |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 340 | sizeof(struct skcipher_request) + |
| 341 | crypto_skcipher_reqsize(enc))); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 342 | |
| 343 | return 0; |
| 344 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 345 | err_free_skcipher: |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 346 | crypto_free_skcipher(enc); |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 347 | err_free_ahash: |
| 348 | crypto_free_ahash(auth); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 349 | return err; |
| 350 | } |
| 351 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 352 | static void crypto_authenc_exit_tfm(struct crypto_aead *tfm) |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 353 | { |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 354 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(tfm); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 355 | |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 356 | crypto_free_ahash(ctx->auth); |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 357 | crypto_free_skcipher(ctx->enc); |
Eric Biggers | 3a2d4fb | 2017-12-07 10:56:34 -0800 | [diff] [blame] | 358 | crypto_put_default_null_skcipher(); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 359 | } |
| 360 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 361 | static void crypto_authenc_free(struct aead_instance *inst) |
| 362 | { |
| 363 | struct authenc_instance_ctx *ctx = aead_instance_ctx(inst); |
| 364 | |
| 365 | crypto_drop_skcipher(&ctx->enc); |
| 366 | crypto_drop_ahash(&ctx->auth); |
| 367 | kfree(inst); |
| 368 | } |
| 369 | |
| 370 | static int crypto_authenc_create(struct crypto_template *tmpl, |
| 371 | struct rtattr **tb) |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 372 | { |
Eric Biggers | b9f76dd | 2020-01-02 19:58:45 -0800 | [diff] [blame] | 373 | u32 mask; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 374 | struct aead_instance *inst; |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 375 | struct authenc_instance_ctx *ctx; |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 376 | struct hash_alg_common *auth; |
| 377 | struct crypto_alg *auth_base; |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 378 | struct skcipher_alg *enc; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 379 | int err; |
| 380 | |
Eric Biggers | 7bcb2c9 | 2020-07-09 23:20:38 -0700 | [diff] [blame] | 381 | err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask); |
| 382 | if (err) |
| 383 | return err; |
Eric Biggers | b9f76dd | 2020-01-02 19:58:45 -0800 | [diff] [blame] | 384 | |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 385 | inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 386 | if (!inst) |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 387 | return -ENOMEM; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 388 | ctx = aead_instance_ctx(inst); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 389 | |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 390 | err = crypto_grab_ahash(&ctx->auth, aead_crypto_instance(inst), |
| 391 | crypto_attr_alg_name(tb[1]), 0, mask); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 392 | if (err) |
| 393 | goto err_free_inst; |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 394 | auth = crypto_spawn_ahash_alg(&ctx->auth); |
| 395 | auth_base = &auth->base; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 396 | |
Eric Biggers | b9f76dd | 2020-01-02 19:58:45 -0800 | [diff] [blame] | 397 | err = crypto_grab_skcipher(&ctx->enc, aead_crypto_instance(inst), |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 398 | crypto_attr_alg_name(tb[2]), 0, mask); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 399 | if (err) |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 400 | goto err_free_inst; |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 401 | enc = crypto_spawn_skcipher_alg(&ctx->enc); |
Herbert Xu | 9ffde35a | 2007-12-17 20:12:49 +0800 | [diff] [blame] | 402 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 403 | ctx->reqoff = ALIGN(2 * auth->digestsize + auth_base->cra_alignmask, |
| 404 | auth_base->cra_alignmask + 1); |
| 405 | |
Herbert Xu | 9ffde35a | 2007-12-17 20:12:49 +0800 | [diff] [blame] | 406 | err = -ENAMETOOLONG; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 407 | if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 408 | "authenc(%s,%s)", auth_base->cra_name, |
| 409 | enc->base.cra_name) >= |
Herbert Xu | 9ffde35a | 2007-12-17 20:12:49 +0800 | [diff] [blame] | 410 | CRYPTO_MAX_ALG_NAME) |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 411 | goto err_free_inst; |
Herbert Xu | 9ffde35a | 2007-12-17 20:12:49 +0800 | [diff] [blame] | 412 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 413 | if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, |
Steffen Klassert | cbdcf80 | 2009-08-05 19:35:34 +1000 | [diff] [blame] | 414 | "authenc(%s,%s)", auth_base->cra_driver_name, |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 415 | enc->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME) |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 416 | goto err_free_inst; |
Herbert Xu | 9ffde35a | 2007-12-17 20:12:49 +0800 | [diff] [blame] | 417 | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 418 | inst->alg.base.cra_priority = enc->base.cra_priority * 10 + |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 419 | auth_base->cra_priority; |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 420 | inst->alg.base.cra_blocksize = enc->base.cra_blocksize; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 421 | inst->alg.base.cra_alignmask = auth_base->cra_alignmask | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 422 | enc->base.cra_alignmask; |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 423 | inst->alg.base.cra_ctxsize = sizeof(struct crypto_authenc_ctx); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 424 | |
Herbert Xu | 7217d49 | 2016-07-12 13:17:34 +0800 | [diff] [blame] | 425 | inst->alg.ivsize = crypto_skcipher_alg_ivsize(enc); |
| 426 | inst->alg.chunksize = crypto_skcipher_alg_chunksize(enc); |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 427 | inst->alg.maxauthsize = auth->digestsize; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 428 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 429 | inst->alg.init = crypto_authenc_init_tfm; |
| 430 | inst->alg.exit = crypto_authenc_exit_tfm; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 431 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 432 | inst->alg.setkey = crypto_authenc_setkey; |
| 433 | inst->alg.encrypt = crypto_authenc_encrypt; |
| 434 | inst->alg.decrypt = crypto_authenc_decrypt; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 435 | |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 436 | inst->free = crypto_authenc_free; |
| 437 | |
| 438 | err = aead_register_instance(tmpl, inst); |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 439 | if (err) { |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 440 | err_free_inst: |
Eric Biggers | 37a861a | 2020-01-02 19:58:55 -0800 | [diff] [blame] | 441 | crypto_authenc_free(inst); |
| 442 | } |
| 443 | return err; |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 444 | } |
| 445 | |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 446 | static struct crypto_template crypto_authenc_tmpl = { |
| 447 | .name = "authenc", |
Herbert Xu | 92d95ba | 2015-07-30 17:53:16 +0800 | [diff] [blame] | 448 | .create = crypto_authenc_create, |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 449 | .module = THIS_MODULE, |
| 450 | }; |
| 451 | |
| 452 | static int __init crypto_authenc_module_init(void) |
| 453 | { |
| 454 | return crypto_register_template(&crypto_authenc_tmpl); |
| 455 | } |
| 456 | |
| 457 | static void __exit crypto_authenc_module_exit(void) |
| 458 | { |
| 459 | crypto_unregister_template(&crypto_authenc_tmpl); |
| 460 | } |
| 461 | |
Eric Biggers | c4741b2 | 2019-04-11 21:57:42 -0700 | [diff] [blame] | 462 | subsys_initcall(crypto_authenc_module_init); |
Herbert Xu | 3c09f17 | 2007-08-30 16:24:15 +0800 | [diff] [blame] | 463 | module_exit(crypto_authenc_module_exit); |
| 464 | |
| 465 | MODULE_LICENSE("GPL"); |
| 466 | MODULE_DESCRIPTION("Simple AEAD wrapper for IPsec"); |
Kees Cook | 4943ba1 | 2014-11-24 16:32:38 -0800 | [diff] [blame] | 467 | MODULE_ALIAS_CRYPTO("authenc"); |