af_alg.c (a4654e9bde4ecedb4921e6c8fe2088114bdff1b3) | af_alg.c (fcb90d51c375d09a034993cda262b68499e233a4) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * af_alg: User-space algorithm interface 4 * 5 * This file provides the user-space API for algorithms. 6 * 7 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au> 8 */ --- 807 unchanged lines hidden (view full) --- 816 unsigned int ivsize) 817{ 818 struct sock *sk = sock->sk; 819 struct alg_sock *ask = alg_sk(sk); 820 struct af_alg_ctx *ctx = ask->private; 821 struct af_alg_tsgl *sgl; 822 struct af_alg_control con = {}; 823 long copied = 0; | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * af_alg: User-space algorithm interface 4 * 5 * This file provides the user-space API for algorithms. 6 * 7 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au> 8 */ --- 807 unchanged lines hidden (view full) --- 816 unsigned int ivsize) 817{ 818 struct sock *sk = sock->sk; 819 struct alg_sock *ask = alg_sk(sk); 820 struct af_alg_ctx *ctx = ask->private; 821 struct af_alg_tsgl *sgl; 822 struct af_alg_control con = {}; 823 long copied = 0; |
824 bool enc = 0; 825 bool init = 0; | 824 bool enc = false; 825 bool init = false; |
826 int err = 0; 827 828 if (msg->msg_controllen) { 829 err = af_alg_cmsg_send(msg, &con); 830 if (err) 831 return err; 832 | 826 int err = 0; 827 828 if (msg->msg_controllen) { 829 err = af_alg_cmsg_send(msg, &con); 830 if (err) 831 return err; 832 |
833 init = 1; | 833 init = true; |
834 switch (con.op) { 835 case ALG_OP_ENCRYPT: | 834 switch (con.op) { 835 case ALG_OP_ENCRYPT: |
836 enc = 1; | 836 enc = true; |
837 break; 838 case ALG_OP_DECRYPT: | 837 break; 838 case ALG_OP_DECRYPT: |
839 enc = 0; | 839 enc = false; |
840 break; 841 default: 842 return -EINVAL; 843 } 844 845 if (con.iv && con.iv->ivlen != ivsize) 846 return -EINVAL; 847 } --- 349 unchanged lines hidden --- | 840 break; 841 default: 842 return -EINVAL; 843 } 844 845 if (con.iv && con.iv->ivlen != ivsize) 846 return -EINVAL; 847 } --- 349 unchanged lines hidden --- |