summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/crypto/ocf/talitos
diff options
context:
space:
mode:
authorhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-07-24 14:17:58 +0000
committerhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-07-24 14:17:58 +0000
commit32dec7075aae5cc6ef1e4394dc94fed1767b848e (patch)
treed7b0162875a7ae451eed4ae42321f3f4d912c788 /target/linux/generic/files/crypto/ocf/talitos
parentc3cc5459ecb9da60a4f90550d9031d7a67478f7a (diff)
ocf-linux: version bump to 20110720
Fixes problem with TFM allocation in cryptosoft.c Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Hauke: * remove ubsec_ssb package and take it from ocf-linux * use patches from ocf-linux package * refresh all patches * readd some build fixes for OpenWrt. * readd CRYPTO_MANAGER dependency git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27753 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/crypto/ocf/talitos')
-rw-r--r--target/linux/generic/files/crypto/ocf/talitos/talitos.c17
-rw-r--r--target/linux/generic/files/crypto/ocf/talitos/talitos_soft.h1
2 files changed, 5 insertions, 13 deletions
diff --git a/target/linux/generic/files/crypto/ocf/talitos/talitos.c b/target/linux/generic/files/crypto/ocf/talitos/talitos.c
index 322f2ea8b..c4bc8c0fd 100644
--- a/target/linux/generic/files/crypto/ocf/talitos/talitos.c
+++ b/target/linux/generic/files/crypto/ocf/talitos/talitos.c
@@ -108,10 +108,8 @@
*/
#include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
-#include <generated/autoconf.h>
-#else
-#include <linux/autoconf.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) && !defined(AUTOCONF_INCLUDED)
+#include <linux/config.h>
#endif
#include <linux/module.h>
#include <linux/init.h>
@@ -123,7 +121,6 @@
#include <linux/dma-mapping.h> /* dma_map_single() */
#include <linux/moduleparam.h>
-#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
#include <linux/platform_device.h>
#endif
@@ -421,10 +418,6 @@ talitos_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
ses->ses_used = 1;
if (encini) {
- /* get an IV */
- /* XXX may read fewer than requested */
- read_random(ses->ses_iv, sizeof(ses->ses_iv));
-
ses->ses_klen = (encini->cri_klen + 7) / 8;
memcpy(ses->ses_key, encini->cri_key, ses->ses_klen);
if (macini) {
@@ -514,6 +507,7 @@ talitos_process(device_t dev, struct cryptop *crp, int hint)
int hmac_key, hmac_data, cipher_iv, cipher_key,
in_fifo, out_fifo, cipher_iv_out;
static int chsel = -1;
+ u_int32_t rand_iv[4];
DPRINTF("%s()\n", __FUNCTION__);
@@ -755,7 +749,7 @@ talitos_process(device_t dev, struct cryptop *crp, int hint)
if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
iv = enccrd->crd_iv;
else
- iv = (caddr_t) ses->ses_iv;
+ read_random((iv = (caddr_t) rand_iv), sizeof(rand_iv));
if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) {
crypto_copyback(crp->crp_flags, crp->crp_buf,
enccrd->crd_inject, ivsize, iv);
@@ -764,9 +758,8 @@ talitos_process(device_t dev, struct cryptop *crp, int hint)
td->hdr |= TALITOS_DIR_INBOUND;
if (enccrd->crd_flags & CRD_F_IV_EXPLICIT) {
iv = enccrd->crd_iv;
- bcopy(enccrd->crd_iv, iv, ivsize);
} else {
- iv = (caddr_t) ses->ses_iv;
+ iv = (caddr_t) rand_iv;
crypto_copydata(crp->crp_flags, crp->crp_buf,
enccrd->crd_inject, ivsize, iv);
}
diff --git a/target/linux/generic/files/crypto/ocf/talitos/talitos_soft.h b/target/linux/generic/files/crypto/ocf/talitos/talitos_soft.h
index 79efdbd31..eda9c2efe 100644
--- a/target/linux/generic/files/crypto/ocf/talitos/talitos_soft.h
+++ b/target/linux/generic/files/crypto/ocf/talitos/talitos_soft.h
@@ -69,7 +69,6 @@ struct talitos_session {
u_int32_t ses_key[8]; /* DES/3DES/AES key */
u_int32_t ses_hmac[5]; /* hmac inner state */
u_int32_t ses_hmac_len; /* hmac length */
- u_int32_t ses_iv[4]; /* DES/3DES/AES iv */
u_int32_t ses_mlen; /* desired hash result len (12=ipsec or 16) */
};