hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/crypto/algif_hash.c
....@@ -1,15 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * algif_hash: User-space interface for hash algorithms
34 *
45 * This file provides the user-space API for hash algorithms.
56 *
67 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the Free
10
- * Software Foundation; either version 2 of the License, or (at your option)
11
- * any later version.
12
- *
138 */
149
1510 #include <crypto/hash.h>
....@@ -88,7 +83,7 @@
8883 goto unlock;
8984 }
9085
91
- ctx->more = 0;
86
+ ctx->more = false;
9287
9388 while (msg_data_left(msg)) {
9489 int len = msg_data_left(msg);
....@@ -216,7 +211,7 @@
216211 }
217212
218213 if (!result || ctx->more) {
219
- ctx->more = 0;
214
+ ctx->more = false;
220215 err = crypto_wait_req(crypto_ahash_final(&ctx->req),
221216 &ctx->wait);
222217 if (err)
....@@ -239,7 +234,7 @@
239234 struct alg_sock *ask = alg_sk(sk);
240235 struct hash_ctx *ctx = ask->private;
241236 struct ahash_request *req = &ctx->req;
242
- char state[crypto_ahash_statesize(crypto_ahash_reqtfm(req)) ? : 1];
237
+ char state[HASH_MAX_STATESIZE];
243238 struct sock *sk2;
244239 struct alg_sock *ask2;
245240 struct hash_ctx *ctx2;
....@@ -284,10 +279,8 @@
284279 .ioctl = sock_no_ioctl,
285280 .listen = sock_no_listen,
286281 .shutdown = sock_no_shutdown,
287
- .getsockopt = sock_no_getsockopt,
288282 .mmap = sock_no_mmap,
289283 .bind = sock_no_bind,
290
- .setsockopt = sock_no_setsockopt,
291284
292285 .release = af_alg_release,
293286 .sendmsg = hash_sendmsg,
....@@ -388,10 +381,8 @@
388381 .ioctl = sock_no_ioctl,
389382 .listen = sock_no_listen,
390383 .shutdown = sock_no_shutdown,
391
- .getsockopt = sock_no_getsockopt,
392384 .mmap = sock_no_mmap,
393385 .bind = sock_no_bind,
394
- .setsockopt = sock_no_setsockopt,
395386
396387 .release = af_alg_release,
397388 .sendmsg = hash_sendmsg_nokey,
....@@ -438,7 +429,7 @@
438429
439430 ctx->result = NULL;
440431 ctx->len = len;
441
- ctx->more = 0;
432
+ ctx->more = false;
442433 crypto_init_wait(&ctx->wait);
443434
444435 ask->private = ctx;