X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/c4490b5a4dd8711bc5ff0c26308a6b39df932023..f385abf518de49b2db10d2d1c756deff3f65eec2:/target/linux/generic-2.6/patches-2.6.26/910-cryptodev_backport.patch diff --git a/target/linux/generic-2.6/patches-2.6.26/910-cryptodev_backport.patch b/target/linux/generic-2.6/patches-2.6.26/910-cryptodev_backport.patch index 297f60e4b..a2d64367c 100644 --- a/target/linux/generic-2.6/patches-2.6.26/910-cryptodev_backport.patch +++ b/target/linux/generic-2.6/patches-2.6.26/910-cryptodev_backport.patch @@ -571,49 +571,14 @@ } while(0) /* max = 24: 128bit encrypt, max = 32: 256bit encrypt */ ---- a/crypto/chainiv.c -+++ b/crypto/chainiv.c -@@ -117,6 +117,7 @@ - static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) - { - int queued; -+ int err = ctx->err; - - if (!ctx->queue.qlen) { - smp_mb__before_clear_bit(); -@@ -131,7 +132,7 @@ - BUG_ON(!queued); - - out: -- return ctx->err; -+ return err; - } - - static int async_chainiv_postpone_request(struct skcipher_givcrypt_request *req) -@@ -227,6 +228,7 @@ - postponed); - struct skcipher_givcrypt_request *req; - struct ablkcipher_request *subreq; -+ int err; - - /* Only handle one request at a time to avoid hogging keventd. */ - spin_lock_bh(&ctx->lock); -@@ -241,7 +243,11 @@ - subreq = skcipher_givcrypt_reqctx(req); - subreq->base.flags |= CRYPTO_TFM_REQ_MAY_SLEEP; - -- async_chainiv_givencrypt_tail(req); -+ err = async_chainiv_givencrypt_tail(req); -+ -+ local_bh_disable(); -+ skcipher_givcrypt_complete(req, err); -+ local_bh_enable(); - } - - static int async_chainiv_init(struct crypto_tfm *tfm) --- a/crypto/crc32c.c +++ b/crypto/crc32c.c -@@ -5,20 +5,23 @@ +@@ -1,24 +1,27 @@ +-/* ++/* + * Cryptographic API. + * + * CRC32C chksum * * This module file is a wrapper to invoke the lib/crc32c routines. * @@ -621,7 +586,8 @@ + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) +- * Software Foundation; either version 2 of the License, or (at your option) ++ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * */ @@ -639,7 +605,21 @@ #define CHKSUM_DIGEST_SIZE 4 struct chksum_ctx { -@@ -71,7 +74,7 @@ +@@ -27,7 +30,7 @@ + }; + + /* +- * Steps through buffer one byte at at time, calculates reflected ++ * Steps through buffer one byte at at time, calculates reflected + * crc using table. + */ + +@@ -67,11 +70,11 @@ + static void chksum_final(struct crypto_tfm *tfm, u8 *out) + { + struct chksum_ctx *mctx = crypto_tfm_ctx(tfm); +- ++ *(__le32 *)out = ~cpu_to_le32(mctx->crc); } @@ -715,7 +695,7 @@ +static int crc32c_final(struct ahash_request *req) +{ + u32 *crcp = ahash_request_ctx(req); -+ ++ + *(__le32 *)req->result = ~cpu_to_le32p(crcp); + return 0; +} @@ -3593,7 +3573,7 @@ j = 0; for (i = 0; i < tcount; i++) { -@@ -602,6 +638,7 @@ +@@ -596,6 +632,7 @@ printk("test %u (%d bit key):\n", j, template[i].klen * 8); @@ -3601,7 +3581,7 @@ crypto_ablkcipher_clear_flags(tfm, ~0); if (template[i].wk) crypto_ablkcipher_set_flags( -@@ -657,14 +694,21 @@ +@@ -649,14 +686,21 @@ temp = 0; for (k = 0; k < template[i].np; k++) { printk("page %u\n", k); @@ -3625,7 +3605,7 @@ } } } -@@ -1180,6 +1224,14 @@ +@@ -1172,6 +1216,14 @@ test_cipher("ecb(des3_ede)", DECRYPT, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS); @@ -3640,7 +3620,7 @@ test_hash("md4", md4_tv_template, MD4_TEST_VECTORS); test_hash("sha224", sha224_tv_template, SHA224_TEST_VECTORS); -@@ -1390,6 +1442,14 @@ +@@ -1382,6 +1434,14 @@ DES3_EDE_ENC_TEST_VECTORS); test_cipher("ecb(des3_ede)", DECRYPT, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS); @@ -3655,7 +3635,7 @@ break; case 5: -@@ -1558,7 +1618,7 @@ +@@ -1550,7 +1610,7 @@ case 29: test_hash("tgr128", tgr128_tv_template, TGR128_TEST_VECTORS); break; @@ -3664,7 +3644,7 @@ case 30: test_cipher("ecb(xeta)", ENCRYPT, xeta_enc_tv_template, XETA_ENC_TEST_VECTORS); -@@ -1623,6 +1683,22 @@ +@@ -1615,6 +1675,22 @@ CTS_MODE_DEC_TEST_VECTORS); break; @@ -3687,7 +3667,7 @@ case 100: test_hash("hmac(md5)", hmac_md5_tv_template, HMAC_MD5_TEST_VECTORS); -@@ -1658,6 +1734,16 @@ +@@ -1650,6 +1726,16 @@ XCBC_AES_TEST_VECTORS); break; @@ -3704,7 +3684,7 @@ case 200: test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); -@@ -1796,6 +1882,22 @@ +@@ -1788,6 +1874,22 @@ test_hash_speed("sha224", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; @@ -6530,7 +6510,7 @@ + --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c -@@ -385,12 +385,12 @@ +@@ -411,12 +411,12 @@ int ret; if (!cpu_has_xcrypt) { @@ -6547,7 +6527,7 @@ --- a/drivers/crypto/padlock-sha.c +++ b/drivers/crypto/padlock-sha.c -@@ -254,12 +254,12 @@ +@@ -263,12 +263,12 @@ int rc = -ENODEV; if (!cpu_has_phe) { @@ -8369,12 +8349,12 @@ @@ -0,0 +1,154 @@ +/* + * Hash: Hash algorithms under the crypto API -+ * ++ * + * Copyright (c) 2008 Herbert Xu + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free -+ * Software Foundation; either version 2 of the License, or (at your option) ++ * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + */ @@ -8526,12 +8506,12 @@ @@ -0,0 +1,78 @@ +/* + * Hash algorithms. -+ * ++ * + * Copyright (c) 2008 Herbert Xu + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free -+ * Software Foundation; either version 2 of the License, or (at your option) ++ * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + */