mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
7ec0a09d4e
When an algorithm of the new "lskcipher" type is exposed through the
"skcipher" API, calls to crypto_skcipher_setkey() don't pass on the
CRYPTO_TFM_REQ_FORBID_WEAK_KEYS flag to the lskcipher. This causes
self-test failures for ecb(des), as weak keys are not rejected anymore.
Fix this.
Fixes: 31865c4c4d
("crypto: skcipher - Add lskcipher")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
29 lines
741 B
C
29 lines
741 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Cryptographic API.
|
|
*
|
|
* Copyright (c) 2023 Herbert Xu <herbert@gondor.apana.org.au>
|
|
*/
|
|
#ifndef _LOCAL_CRYPTO_SKCIPHER_H
|
|
#define _LOCAL_CRYPTO_SKCIPHER_H
|
|
|
|
#include <crypto/internal/skcipher.h>
|
|
#include "internal.h"
|
|
|
|
static inline struct crypto_istat_cipher *skcipher_get_stat_common(
|
|
struct skcipher_alg_common *alg)
|
|
{
|
|
#ifdef CONFIG_CRYPTO_STATS
|
|
return &alg->stat;
|
|
#else
|
|
return NULL;
|
|
#endif
|
|
}
|
|
|
|
int crypto_lskcipher_encrypt_sg(struct skcipher_request *req);
|
|
int crypto_lskcipher_decrypt_sg(struct skcipher_request *req);
|
|
int crypto_init_lskcipher_ops_sg(struct crypto_tfm *tfm);
|
|
int skcipher_prepare_alg_common(struct skcipher_alg_common *alg);
|
|
|
|
#endif /* _LOCAL_CRYPTO_SKCIPHER_H */
|