.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * algif_hash: User-space interface for hash algorithms |
---|
3 | 4 | * |
---|
4 | 5 | * This file provides the user-space API for hash algorithms. |
---|
5 | 6 | * |
---|
6 | 7 | * 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 | | - * |
---|
13 | 8 | */ |
---|
14 | 9 | |
---|
15 | 10 | #include <crypto/hash.h> |
---|
.. | .. |
---|
88 | 83 | goto unlock; |
---|
89 | 84 | } |
---|
90 | 85 | |
---|
91 | | - ctx->more = 0; |
---|
| 86 | + ctx->more = false; |
---|
92 | 87 | |
---|
93 | 88 | while (msg_data_left(msg)) { |
---|
94 | 89 | int len = msg_data_left(msg); |
---|
.. | .. |
---|
216 | 211 | } |
---|
217 | 212 | |
---|
218 | 213 | if (!result || ctx->more) { |
---|
219 | | - ctx->more = 0; |
---|
| 214 | + ctx->more = false; |
---|
220 | 215 | err = crypto_wait_req(crypto_ahash_final(&ctx->req), |
---|
221 | 216 | &ctx->wait); |
---|
222 | 217 | if (err) |
---|
.. | .. |
---|
239 | 234 | struct alg_sock *ask = alg_sk(sk); |
---|
240 | 235 | struct hash_ctx *ctx = ask->private; |
---|
241 | 236 | struct ahash_request *req = &ctx->req; |
---|
242 | | - char state[crypto_ahash_statesize(crypto_ahash_reqtfm(req)) ? : 1]; |
---|
| 237 | + char state[HASH_MAX_STATESIZE]; |
---|
243 | 238 | struct sock *sk2; |
---|
244 | 239 | struct alg_sock *ask2; |
---|
245 | 240 | struct hash_ctx *ctx2; |
---|
.. | .. |
---|
284 | 279 | .ioctl = sock_no_ioctl, |
---|
285 | 280 | .listen = sock_no_listen, |
---|
286 | 281 | .shutdown = sock_no_shutdown, |
---|
287 | | - .getsockopt = sock_no_getsockopt, |
---|
288 | 282 | .mmap = sock_no_mmap, |
---|
289 | 283 | .bind = sock_no_bind, |
---|
290 | | - .setsockopt = sock_no_setsockopt, |
---|
291 | 284 | |
---|
292 | 285 | .release = af_alg_release, |
---|
293 | 286 | .sendmsg = hash_sendmsg, |
---|
.. | .. |
---|
388 | 381 | .ioctl = sock_no_ioctl, |
---|
389 | 382 | .listen = sock_no_listen, |
---|
390 | 383 | .shutdown = sock_no_shutdown, |
---|
391 | | - .getsockopt = sock_no_getsockopt, |
---|
392 | 384 | .mmap = sock_no_mmap, |
---|
393 | 385 | .bind = sock_no_bind, |
---|
394 | | - .setsockopt = sock_no_setsockopt, |
---|
395 | 386 | |
---|
396 | 387 | .release = af_alg_release, |
---|
397 | 388 | .sendmsg = hash_sendmsg_nokey, |
---|
.. | .. |
---|
438 | 429 | |
---|
439 | 430 | ctx->result = NULL; |
---|
440 | 431 | ctx->len = len; |
---|
441 | | - ctx->more = 0; |
---|
| 432 | + ctx->more = false; |
---|
442 | 433 | crypto_init_wait(&ctx->wait); |
---|
443 | 434 | |
---|
444 | 435 | ask->private = ctx; |
---|