Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
[CRYPTO] xcbc: Fix crash with IPsec
[CRYPTO] xts: Use proper alignment
[CRYPTO] digest: Include internal.h for prototypes
[CRYPTO] authenc: Add missing Kconfig dependency on BLKCIPHER
[CRYPTO] skcipher: Move chainiv/seqiv into crypto_blkcipher module

+59 -29
+1
crypto/Kconfig
··· 575 575 config CRYPTO_AUTHENC 576 576 tristate "Authenc support" 577 577 select CRYPTO_AEAD 578 + select CRYPTO_BLKCIPHER 578 579 select CRYPTO_MANAGER 579 580 select CRYPTO_HASH 580 581 help
+2 -2
crypto/Makefile
··· 12 12 13 13 crypto_blkcipher-objs := ablkcipher.o 14 14 crypto_blkcipher-objs += blkcipher.o 15 + crypto_blkcipher-objs += chainiv.o 16 + crypto_blkcipher-objs += eseqiv.o 15 17 obj-$(CONFIG_CRYPTO_BLKCIPHER) += crypto_blkcipher.o 16 - obj-$(CONFIG_CRYPTO_BLKCIPHER) += chainiv.o 17 - obj-$(CONFIG_CRYPTO_BLKCIPHER) += eseqiv.o 18 18 obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o 19 19 20 20 crypto_hash-objs := hash.o
-3
crypto/ablkcipher.c
··· 341 341 return ERR_PTR(err); 342 342 } 343 343 EXPORT_SYMBOL_GPL(crypto_alloc_ablkcipher); 344 - 345 - MODULE_LICENSE("GPL"); 346 - MODULE_DESCRIPTION("Asynchronous block chaining cipher type");
+29
crypto/blkcipher.c
··· 696 696 } 697 697 EXPORT_SYMBOL_GPL(skcipher_geniv_exit); 698 698 699 + static int __init blkcipher_module_init(void) 700 + { 701 + int err; 702 + 703 + err = chainiv_module_init(); 704 + if (err) 705 + goto out; 706 + 707 + err = eseqiv_module_init(); 708 + if (err) 709 + goto eseqiv_err; 710 + 711 + out: 712 + return err; 713 + 714 + eseqiv_err: 715 + chainiv_module_exit(); 716 + goto out; 717 + } 718 + 719 + static void __exit blkcipher_module_exit(void) 720 + { 721 + eseqiv_module_exit(); 722 + chainiv_module_exit(); 723 + } 724 + 725 + module_init(blkcipher_module_init); 726 + module_exit(blkcipher_module_exit); 727 + 699 728 MODULE_LICENSE("GPL"); 700 729 MODULE_DESCRIPTION("Generic block chaining cipher type");
+4 -8
crypto/chainiv.c
··· 314 314 .module = THIS_MODULE, 315 315 }; 316 316 317 - static int __init chainiv_module_init(void) 317 + int __init chainiv_module_init(void) 318 318 { 319 319 return crypto_register_template(&chainiv_tmpl); 320 320 } 321 + EXPORT_SYMBOL_GPL(chainiv_module_init); 321 322 322 - static void __exit chainiv_module_exit(void) 323 + void __exit chainiv_module_exit(void) 323 324 { 324 325 crypto_unregister_template(&chainiv_tmpl); 325 326 } 326 - 327 - module_init(chainiv_module_init); 328 - module_exit(chainiv_module_exit); 329 - 330 - MODULE_LICENSE("GPL"); 331 - MODULE_DESCRIPTION("Chain IV Generator"); 327 + EXPORT_SYMBOL_GPL(chainiv_module_exit);
+2
crypto/digest.c
··· 21 21 #include <linux/module.h> 22 22 #include <linux/scatterlist.h> 23 23 24 + #include "internal.h" 25 + 24 26 static int init(struct hash_desc *desc) 25 27 { 26 28 struct crypto_tfm *tfm = crypto_hash_tfm(desc->tfm);
+4 -8
crypto/eseqiv.c
··· 247 247 .module = THIS_MODULE, 248 248 }; 249 249 250 - static int __init eseqiv_module_init(void) 250 + int __init eseqiv_module_init(void) 251 251 { 252 252 return crypto_register_template(&eseqiv_tmpl); 253 253 } 254 + EXPORT_SYMBOL_GPL(eseqiv_module_init); 254 255 255 - static void __exit eseqiv_module_exit(void) 256 + void __exit eseqiv_module_exit(void) 256 257 { 257 258 crypto_unregister_template(&eseqiv_tmpl); 258 259 } 259 - 260 - module_init(eseqiv_module_init); 261 - module_exit(eseqiv_module_exit); 262 - 263 - MODULE_LICENSE("GPL"); 264 - MODULE_DESCRIPTION("Encrypted Sequence Number IV Generator"); 260 + EXPORT_SYMBOL_GPL(eseqiv_module_exit);
+5 -1
crypto/xcbc.c
··· 124 124 unsigned int offset = sg[i].offset; 125 125 unsigned int slen = sg[i].length; 126 126 127 + if (unlikely(slen > nbytes)) 128 + slen = nbytes; 129 + 130 + nbytes -= slen; 131 + 127 132 while (slen > 0) { 128 133 unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset); 129 134 char *p = crypto_kmap(pg, 0) + offset; ··· 182 177 offset = 0; 183 178 pg++; 184 179 } 185 - nbytes-=sg[i].length; 186 180 i++; 187 181 } while (nbytes>0); 188 182
+6 -7
crypto/xts.c
··· 77 77 } 78 78 79 79 struct sinfo { 80 - be128 t; 80 + be128 *t; 81 81 struct crypto_tfm *tfm; 82 82 void (*fn)(struct crypto_tfm *, u8 *, const u8 *); 83 83 }; 84 84 85 85 static inline void xts_round(struct sinfo *s, void *dst, const void *src) 86 86 { 87 - be128_xor(dst, &s->t, src); /* PP <- T xor P */ 87 + be128_xor(dst, s->t, src); /* PP <- T xor P */ 88 88 s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */ 89 - be128_xor(dst, dst, &s->t); /* C <- T xor CC */ 89 + be128_xor(dst, dst, s->t); /* C <- T xor CC */ 90 90 } 91 91 92 92 static int crypt(struct blkcipher_desc *d, ··· 101 101 .tfm = crypto_cipher_tfm(ctx->child), 102 102 .fn = fn 103 103 }; 104 - be128 *iv; 105 104 u8 *wsrc; 106 105 u8 *wdst; 107 106 ··· 108 109 if (!w->nbytes) 109 110 return err; 110 111 112 + s.t = (be128 *)w->iv; 111 113 avail = w->nbytes; 112 114 113 115 wsrc = w->src.virt.addr; 114 116 wdst = w->dst.virt.addr; 115 117 116 118 /* calculate first value of T */ 117 - iv = (be128 *)w->iv; 118 - tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv); 119 + tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv); 119 120 120 121 goto first; 121 122 122 123 for (;;) { 123 124 do { 124 - gf128mul_x_ble(&s.t, &s.t); 125 + gf128mul_x_ble(s.t, s.t); 125 126 126 127 first: 127 128 xts_round(&s, wdst, wsrc);
+6
include/crypto/internal/skcipher.h
··· 15 15 16 16 #include <crypto/algapi.h> 17 17 #include <crypto/skcipher.h> 18 + #include <linux/init.h> 18 19 #include <linux/types.h> 19 20 20 21 struct rtattr; ··· 64 63 void skcipher_geniv_free(struct crypto_instance *inst); 65 64 int skcipher_geniv_init(struct crypto_tfm *tfm); 66 65 void skcipher_geniv_exit(struct crypto_tfm *tfm); 66 + 67 + int __init eseqiv_module_init(void); 68 + void __exit eseqiv_module_exit(void); 69 + int __init chainiv_module_init(void); 70 + void __exit chainiv_module_exit(void); 67 71 68 72 static inline struct crypto_ablkcipher *skcipher_geniv_cipher( 69 73 struct crypto_ablkcipher *geniv)