aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/af_alg.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/af_alg.c')
-rw-r--r--crypto/af_alg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 3e80d8b8be45..7f8b7edcadca 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -188,7 +188,7 @@ static int alg_setkey(struct sock *sk, char __user *ukey,
188 err = type->setkey(ask->private, key, keylen); 188 err = type->setkey(ask->private, key, keylen);
189 189
190out: 190out:
191 sock_kfree_s(sk, key, keylen); 191 sock_kzfree_s(sk, key, keylen);
192 192
193 return err; 193 return err;
194} 194}
@@ -215,6 +215,13 @@ static int alg_setsockopt(struct socket *sock, int level, int optname,
215 goto unlock; 215 goto unlock;
216 216
217 err = alg_setkey(sk, optval, optlen); 217 err = alg_setkey(sk, optval, optlen);
218 break;
219 case ALG_SET_AEAD_AUTHSIZE:
220 if (sock->state == SS_CONNECTED)
221 goto unlock;
222 if (!type->setauthsize)
223 goto unlock;
224 err = type->setauthsize(ask->private, optlen);
218 } 225 }
219 226
220unlock: 227unlock:
@@ -387,7 +394,7 @@ int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con)
387 if (cmsg->cmsg_level != SOL_ALG) 394 if (cmsg->cmsg_level != SOL_ALG)
388 continue; 395 continue;
389 396
390 switch(cmsg->cmsg_type) { 397 switch (cmsg->cmsg_type) {
391 case ALG_SET_IV: 398 case ALG_SET_IV:
392 if (cmsg->cmsg_len < CMSG_LEN(sizeof(*con->iv))) 399 if (cmsg->cmsg_len < CMSG_LEN(sizeof(*con->iv)))
393 return -EINVAL; 400 return -EINVAL;