aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_algo.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/xfrm/xfrm_algo.c')
-rw-r--r--net/xfrm/xfrm_algo.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 248f94814dfb..f373a8a7d9c8 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -1,11 +1,11 @@
1/* 1/*
2 * xfrm algorithm interface 2 * xfrm algorithm interface
3 * 3 *
4 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> 4 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free 7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option) 8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version. 9 * any later version.
10 */ 10 */
11 11
@@ -32,14 +32,14 @@ static struct xfrm_algo_desc aalg_list[] = {
32{ 32{
33 .name = "hmac(digest_null)", 33 .name = "hmac(digest_null)",
34 .compat = "digest_null", 34 .compat = "digest_null",
35 35
36 .uinfo = { 36 .uinfo = {
37 .auth = { 37 .auth = {
38 .icv_truncbits = 0, 38 .icv_truncbits = 0,
39 .icv_fullbits = 0, 39 .icv_fullbits = 0,
40 } 40 }
41 }, 41 },
42 42
43 .desc = { 43 .desc = {
44 .sadb_alg_id = SADB_X_AALG_NULL, 44 .sadb_alg_id = SADB_X_AALG_NULL,
45 .sadb_alg_ivlen = 0, 45 .sadb_alg_ivlen = 0,
@@ -57,7 +57,7 @@ static struct xfrm_algo_desc aalg_list[] = {
57 .icv_fullbits = 128, 57 .icv_fullbits = 128,
58 } 58 }
59 }, 59 },
60 60
61 .desc = { 61 .desc = {
62 .sadb_alg_id = SADB_AALG_MD5HMAC, 62 .sadb_alg_id = SADB_AALG_MD5HMAC,
63 .sadb_alg_ivlen = 0, 63 .sadb_alg_ivlen = 0,
@@ -142,14 +142,14 @@ static struct xfrm_algo_desc ealg_list[] = {
142{ 142{
143 .name = "ecb(cipher_null)", 143 .name = "ecb(cipher_null)",
144 .compat = "cipher_null", 144 .compat = "cipher_null",
145 145
146 .uinfo = { 146 .uinfo = {
147 .encr = { 147 .encr = {
148 .blockbits = 8, 148 .blockbits = 8,
149 .defkeybits = 0, 149 .defkeybits = 0,
150 } 150 }
151 }, 151 },
152 152
153 .desc = { 153 .desc = {
154 .sadb_alg_id = SADB_EALG_NULL, 154 .sadb_alg_id = SADB_EALG_NULL,
155 .sadb_alg_ivlen = 0, 155 .sadb_alg_ivlen = 0,
@@ -248,22 +248,22 @@ static struct xfrm_algo_desc ealg_list[] = {
248 } 248 }
249}, 249},
250{ 250{
251 .name = "cbc(serpent)", 251 .name = "cbc(serpent)",
252 .compat = "serpent", 252 .compat = "serpent",
253 253
254 .uinfo = { 254 .uinfo = {
255 .encr = { 255 .encr = {
256 .blockbits = 128, 256 .blockbits = 128,
257 .defkeybits = 128, 257 .defkeybits = 128,
258 } 258 }
259 }, 259 },
260 260
261 .desc = { 261 .desc = {
262 .sadb_alg_id = SADB_X_EALG_SERPENTCBC, 262 .sadb_alg_id = SADB_X_EALG_SERPENTCBC,
263 .sadb_alg_ivlen = 8, 263 .sadb_alg_ivlen = 8,
264 .sadb_alg_minbits = 128, 264 .sadb_alg_minbits = 128,
265 .sadb_alg_maxbits = 256, 265 .sadb_alg_maxbits = 256,
266 } 266 }
267}, 267},
268{ 268{
269 .name = "cbc(camellia)", 269 .name = "cbc(camellia)",
@@ -283,22 +283,22 @@ static struct xfrm_algo_desc ealg_list[] = {
283 } 283 }
284}, 284},
285{ 285{
286 .name = "cbc(twofish)", 286 .name = "cbc(twofish)",
287 .compat = "twofish", 287 .compat = "twofish",
288 288
289 .uinfo = { 289 .uinfo = {
290 .encr = { 290 .encr = {
291 .blockbits = 128, 291 .blockbits = 128,
292 .defkeybits = 128, 292 .defkeybits = 128,
293 } 293 }
294 }, 294 },
295 295
296 .desc = { 296 .desc = {
297 .sadb_alg_id = SADB_X_EALG_TWOFISHCBC, 297 .sadb_alg_id = SADB_X_EALG_TWOFISHCBC,
298 .sadb_alg_ivlen = 8, 298 .sadb_alg_ivlen = 8,
299 .sadb_alg_minbits = 128, 299 .sadb_alg_minbits = 128,
300 .sadb_alg_maxbits = 256 300 .sadb_alg_maxbits = 256
301 } 301 }
302}, 302},
303}; 303};
304 304
@@ -478,7 +478,7 @@ void xfrm_probe_algs(void)
478{ 478{
479#ifdef CONFIG_CRYPTO 479#ifdef CONFIG_CRYPTO
480 int i, status; 480 int i, status;
481 481
482 BUG_ON(in_softirq()); 482 BUG_ON(in_softirq());
483 483
484 for (i = 0; i < aalg_entries(); i++) { 484 for (i = 0; i < aalg_entries(); i++) {
@@ -487,14 +487,14 @@ void xfrm_probe_algs(void)
487 if (aalg_list[i].available != status) 487 if (aalg_list[i].available != status)
488 aalg_list[i].available = status; 488 aalg_list[i].available = status;
489 } 489 }
490 490
491 for (i = 0; i < ealg_entries(); i++) { 491 for (i = 0; i < ealg_entries(); i++) {
492 status = crypto_has_blkcipher(ealg_list[i].name, 0, 492 status = crypto_has_blkcipher(ealg_list[i].name, 0,
493 CRYPTO_ALG_ASYNC); 493 CRYPTO_ALG_ASYNC);
494 if (ealg_list[i].available != status) 494 if (ealg_list[i].available != status)
495 ealg_list[i].available = status; 495 ealg_list[i].available = status;
496 } 496 }
497 497
498 for (i = 0; i < calg_entries(); i++) { 498 for (i = 0; i < calg_entries(); i++) {
499 status = crypto_has_comp(calg_list[i].name, 0, 499 status = crypto_has_comp(calg_list[i].name, 0,
500 CRYPTO_ALG_ASYNC); 500 CRYPTO_ALG_ASYNC);
@@ -541,15 +541,15 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
541 if (copy > 0) { 541 if (copy > 0) {
542 if (copy > len) 542 if (copy > len)
543 copy = len; 543 copy = len;
544 544
545 sg.page = virt_to_page(skb->data + offset); 545 sg.page = virt_to_page(skb->data + offset);
546 sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE; 546 sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
547 sg.length = copy; 547 sg.length = copy;
548 548
549 err = icv_update(desc, &sg, copy); 549 err = icv_update(desc, &sg, copy);
550 if (unlikely(err)) 550 if (unlikely(err))
551 return err; 551 return err;
552 552
553 if ((len -= copy) == 0) 553 if ((len -= copy) == 0)
554 return 0; 554 return 0;
555 offset += copy; 555 offset += copy;
@@ -566,11 +566,11 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
566 566
567 if (copy > len) 567 if (copy > len)
568 copy = len; 568 copy = len;
569 569
570 sg.page = frag->page; 570 sg.page = frag->page;
571 sg.offset = frag->page_offset + offset-start; 571 sg.offset = frag->page_offset + offset-start;
572 sg.length = copy; 572 sg.length = copy;
573 573
574 err = icv_update(desc, &sg, copy); 574 err = icv_update(desc, &sg, copy);
575 if (unlikely(err)) 575 if (unlikely(err))
576 return err; 576 return err;