Skip to content

Commit be457e4

Browse files
ardbiesheuvelherbertx
authored andcommitted
crypto: compress_null - drop obsolete 'comp' implementation
The 'comp' API is obsolete and will be removed, so remove this comp implementation. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent bd40bf1 commit be457e4

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

crypto/crypto_null.c

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ static DEFINE_SPINLOCK(crypto_default_null_skcipher_lock);
2424
static struct crypto_sync_skcipher *crypto_default_null_skcipher;
2525
static int crypto_default_null_skcipher_refcnt;
2626

27-
static int null_compress(struct crypto_tfm *tfm, const u8 *src,
28-
unsigned int slen, u8 *dst, unsigned int *dlen)
29-
{
30-
if (slen > *dlen)
31-
return -EINVAL;
32-
memcpy(dst, src, slen);
33-
*dlen = slen;
34-
return 0;
35-
}
36-
3727
static int null_init(struct shash_desc *desc)
3828
{
3929
return 0;
@@ -121,7 +111,7 @@ static struct skcipher_alg skcipher_null = {
121111
.decrypt = null_skcipher_crypt,
122112
};
123113

124-
static struct crypto_alg null_algs[] = { {
114+
static struct crypto_alg cipher_null = {
125115
.cra_name = "cipher_null",
126116
.cra_driver_name = "cipher_null-generic",
127117
.cra_flags = CRYPTO_ALG_TYPE_CIPHER,
@@ -134,19 +124,8 @@ static struct crypto_alg null_algs[] = { {
134124
.cia_setkey = null_setkey,
135125
.cia_encrypt = null_crypt,
136126
.cia_decrypt = null_crypt } }
137-
}, {
138-
.cra_name = "compress_null",
139-
.cra_driver_name = "compress_null-generic",
140-
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
141-
.cra_blocksize = NULL_BLOCK_SIZE,
142-
.cra_ctxsize = 0,
143-
.cra_module = THIS_MODULE,
144-
.cra_u = { .compress = {
145-
.coa_compress = null_compress,
146-
.coa_decompress = null_compress } }
147-
} };
127+
};
148128

149-
MODULE_ALIAS_CRYPTO("compress_null");
150129
MODULE_ALIAS_CRYPTO("digest_null");
151130
MODULE_ALIAS_CRYPTO("cipher_null");
152131

@@ -202,7 +181,7 @@ static int __init crypto_null_mod_init(void)
202181
{
203182
int ret = 0;
204183

205-
ret = crypto_register_algs(null_algs, ARRAY_SIZE(null_algs));
184+
ret = crypto_register_alg(&cipher_null);
206185
if (ret < 0)
207186
goto out;
208187

@@ -219,14 +198,14 @@ static int __init crypto_null_mod_init(void)
219198
out_unregister_shash:
220199
crypto_unregister_shash(&digest_null);
221200
out_unregister_algs:
222-
crypto_unregister_algs(null_algs, ARRAY_SIZE(null_algs));
201+
crypto_unregister_alg(&cipher_null);
223202
out:
224203
return ret;
225204
}
226205

227206
static void __exit crypto_null_mod_fini(void)
228207
{
229-
crypto_unregister_algs(null_algs, ARRAY_SIZE(null_algs));
208+
crypto_unregister_alg(&cipher_null);
230209
crypto_unregister_shash(&digest_null);
231210
crypto_unregister_skcipher(&skcipher_null);
232211
}

crypto/testmgr.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4726,9 +4726,6 @@ static const struct alg_test_desc alg_test_descs[] = {
47264726
.suite = {
47274727
.hash = __VECS(sm4_cmac128_tv_template)
47284728
}
4729-
}, {
4730-
.alg = "compress_null",
4731-
.test = alg_test_null,
47324729
}, {
47334730
.alg = "crc32",
47344731
.test = alg_test_hash,

0 commit comments

Comments
 (0)