Skip to content

Commit 42a0ddc

Browse files
committed
Merge git://github.com/herbertx/crypto
* git://github.com/herbertx/crypto: crypto: algapi - Fix build problem with NET disabled crypto: user - Fix rwsem leak in crypto_user
2 parents 53e3ccf + 3acc847 commit 42a0ddc

File tree

8 files changed

+63
-3
lines changed

8 files changed

+63
-3
lines changed

crypto/ablkcipher.c

+14
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ static int crypto_init_ablkcipher_ops(struct crypto_tfm *tfm, u32 type,
383383
return 0;
384384
}
385385

386+
#ifdef CONFIG_NET
386387
static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
387388
{
388389
struct crypto_report_blkcipher rblkcipher;
@@ -404,6 +405,12 @@ static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
404405
nla_put_failure:
405406
return -EMSGSIZE;
406407
}
408+
#else
409+
static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
410+
{
411+
return -ENOSYS;
412+
}
413+
#endif
407414

408415
static void crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg)
409416
__attribute__ ((unused));
@@ -457,6 +464,7 @@ static int crypto_init_givcipher_ops(struct crypto_tfm *tfm, u32 type,
457464
return 0;
458465
}
459466

467+
#ifdef CONFIG_NET
460468
static int crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
461469
{
462470
struct crypto_report_blkcipher rblkcipher;
@@ -478,6 +486,12 @@ static int crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
478486
nla_put_failure:
479487
return -EMSGSIZE;
480488
}
489+
#else
490+
static int crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
491+
{
492+
return -ENOSYS;
493+
}
494+
#endif
481495

482496
static void crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg)
483497
__attribute__ ((unused));

crypto/aead.c

+14
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static int crypto_init_aead_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
111111
return 0;
112112
}
113113

114+
#ifdef CONFIG_NET
114115
static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)
115116
{
116117
struct crypto_report_aead raead;
@@ -132,6 +133,12 @@ static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)
132133
nla_put_failure:
133134
return -EMSGSIZE;
134135
}
136+
#else
137+
static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)
138+
{
139+
return -ENOSYS;
140+
}
141+
#endif
135142

136143
static void crypto_aead_show(struct seq_file *m, struct crypto_alg *alg)
137144
__attribute__ ((unused));
@@ -190,6 +197,7 @@ static int crypto_init_nivaead_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
190197
return 0;
191198
}
192199

200+
#ifdef CONFIG_NET
193201
static int crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg)
194202
{
195203
struct crypto_report_aead raead;
@@ -210,6 +218,12 @@ static int crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg)
210218
nla_put_failure:
211219
return -EMSGSIZE;
212220
}
221+
#else
222+
static int crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg)
223+
{
224+
return -ENOSYS;
225+
}
226+
#endif
213227

214228

215229
static void crypto_nivaead_show(struct seq_file *m, struct crypto_alg *alg)

crypto/ahash.c

+7
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ static unsigned int crypto_ahash_extsize(struct crypto_alg *alg)
399399
return sizeof(struct crypto_shash *);
400400
}
401401

402+
#ifdef CONFIG_NET
402403
static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg)
403404
{
404405
struct crypto_report_hash rhash;
@@ -416,6 +417,12 @@ static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg)
416417
nla_put_failure:
417418
return -EMSGSIZE;
418419
}
420+
#else
421+
static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg)
422+
{
423+
return -ENOSYS;
424+
}
425+
#endif
419426

420427
static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
421428
__attribute__ ((unused));

crypto/blkcipher.c

+7
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
494494
return crypto_init_blkcipher_ops_async(tfm);
495495
}
496496

497+
#ifdef CONFIG_NET
497498
static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
498499
{
499500
struct crypto_report_blkcipher rblkcipher;
@@ -515,6 +516,12 @@ static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
515516
nla_put_failure:
516517
return -EMSGSIZE;
517518
}
519+
#else
520+
static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
521+
{
522+
return -ENOSYS;
523+
}
524+
#endif
518525

519526
static void crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg)
520527
__attribute__ ((unused));

crypto/crypto_user.c

-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact)
4444

4545
down_read(&crypto_alg_sem);
4646

47-
if (list_empty(&crypto_alg_list))
48-
return NULL;
49-
5047
list_for_each_entry(q, &crypto_alg_list, cra_list) {
5148
int match = 0;
5249

crypto/pcompress.c

+7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static int crypto_pcomp_init_tfm(struct crypto_tfm *tfm)
4848
return 0;
4949
}
5050

51+
#ifdef CONFIG_NET
5152
static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg)
5253
{
5354
struct crypto_report_comp rpcomp;
@@ -62,6 +63,12 @@ static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg)
6263
nla_put_failure:
6364
return -EMSGSIZE;
6465
}
66+
#else
67+
static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg)
68+
{
69+
return -ENOSYS;
70+
}
71+
#endif
6572

6673
static void crypto_pcomp_show(struct seq_file *m, struct crypto_alg *alg)
6774
__attribute__ ((unused));

crypto/rng.c

+7
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static int crypto_init_rng_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
6060
return 0;
6161
}
6262

63+
#ifdef CONFIG_NET
6364
static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg)
6465
{
6566
struct crypto_report_rng rrng;
@@ -76,6 +77,12 @@ static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg)
7677
nla_put_failure:
7778
return -EMSGSIZE;
7879
}
80+
#else
81+
static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg)
82+
{
83+
return -ENOSYS;
84+
}
85+
#endif
7986

8087
static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg)
8188
__attribute__ ((unused));

crypto/shash.c

+7
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ static unsigned int crypto_shash_extsize(struct crypto_alg *alg)
524524
return alg->cra_ctxsize;
525525
}
526526

527+
#ifdef CONFIG_NET
527528
static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
528529
{
529530
struct crypto_report_hash rhash;
@@ -541,6 +542,12 @@ static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
541542
nla_put_failure:
542543
return -EMSGSIZE;
543544
}
545+
#else
546+
static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
547+
{
548+
return -ENOSYS;
549+
}
550+
#endif
544551

545552
static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg)
546553
__attribute__ ((unused));

0 commit comments

Comments
 (0)