aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-17 14:22:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-17 14:22:54 -0400
commit70477371dc350746d10431d74f0f213a8d59924c (patch)
tree6271978b6e4ee4b1e6f22775ad7fc0930c09d3ee /net/ipv4/tcp_ipv4.c
parent09fd671ccb2475436bd5f597f751ca4a7d177aea (diff)
parent34074205bb9f04b416efb3cbedcd90f418c86200 (diff)
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu: "Here is the crypto update for 4.6: API: - Convert remaining crypto_hash users to shash or ahash, also convert blkcipher/ablkcipher users to skcipher. - Remove crypto_hash interface. - Remove crypto_pcomp interface. - Add crypto engine for async cipher drivers. - Add akcipher documentation. - Add skcipher documentation. Algorithms: - Rename crypto/crc32 to avoid name clash with lib/crc32. - Fix bug in keywrap where we zero the wrong pointer. Drivers: - Support T5/M5, T7/M7 SPARC CPUs in n2 hwrng driver. - Add PIC32 hwrng driver. - Support BCM6368 in bcm63xx hwrng driver. - Pack structs for 32-bit compat users in qat. - Use crypto engine in omap-aes. - Add support for sama5d2x SoCs in atmel-sha. - Make atmel-sha available again. - Make sahara hashing available again. - Make ccp hashing available again. - Make sha1-mb available again. - Add support for multiple devices in ccp. - Improve DMA performance in caam. - Add hashing support to rockchip" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (116 commits) crypto: qat - remove redundant arbiter configuration crypto: ux500 - fix checks of error code returned by devm_ioremap_resource() crypto: atmel - fix checks of error code returned by devm_ioremap_resource() crypto: qat - Change the definition of icp_qat_uof_regtype hwrng: exynos - use __maybe_unused to hide pm functions crypto: ccp - Add abstraction for device-specific calls crypto: ccp - CCP versioning support crypto: ccp - Support for multiple CCPs crypto: ccp - Remove check for x86 family and model crypto: ccp - memset request context to zero during import lib/mpi: use "static inline" instead of "extern inline" lib/mpi: avoid assembler warning hwrng: bcm63xx - fix non device tree compatibility crypto: testmgr - allow rfc3686 aes-ctr variants in fips mode. crypto: qat - The AE id should be less than the maximal AE number lib/mpi: Endianness fix crypto: rockchip - add hash support for crypto engine in rk3288 crypto: xts - fix compile errors crypto: doc - add skcipher API documentation crypto: doc - update AEAD AD handling ...
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 487ac67059e2..4fdbf4e56797 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -81,7 +81,7 @@
81#include <linux/proc_fs.h> 81#include <linux/proc_fs.h>
82#include <linux/seq_file.h> 82#include <linux/seq_file.h>
83 83
84#include <linux/crypto.h> 84#include <crypto/hash.h>
85#include <linux/scatterlist.h> 85#include <linux/scatterlist.h>
86 86
87int sysctl_tcp_tw_reuse __read_mostly; 87int sysctl_tcp_tw_reuse __read_mostly;
@@ -1039,21 +1039,22 @@ static int tcp_v4_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp,
1039 bp->len = cpu_to_be16(nbytes); 1039 bp->len = cpu_to_be16(nbytes);
1040 1040
1041 sg_init_one(&sg, bp, sizeof(*bp)); 1041 sg_init_one(&sg, bp, sizeof(*bp));
1042 return crypto_hash_update(&hp->md5_desc, &sg, sizeof(*bp)); 1042 ahash_request_set_crypt(hp->md5_req, &sg, NULL, sizeof(*bp));
1043 return crypto_ahash_update(hp->md5_req);
1043} 1044}
1044 1045
1045static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key, 1046static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key,
1046 __be32 daddr, __be32 saddr, const struct tcphdr *th) 1047 __be32 daddr, __be32 saddr, const struct tcphdr *th)
1047{ 1048{
1048 struct tcp_md5sig_pool *hp; 1049 struct tcp_md5sig_pool *hp;
1049 struct hash_desc *desc; 1050 struct ahash_request *req;
1050 1051
1051 hp = tcp_get_md5sig_pool(); 1052 hp = tcp_get_md5sig_pool();
1052 if (!hp) 1053 if (!hp)
1053 goto clear_hash_noput; 1054 goto clear_hash_noput;
1054 desc = &hp->md5_desc; 1055 req = hp->md5_req;
1055 1056
1056 if (crypto_hash_init(desc)) 1057 if (crypto_ahash_init(req))
1057 goto clear_hash; 1058 goto clear_hash;
1058 if (tcp_v4_md5_hash_pseudoheader(hp, daddr, saddr, th->doff << 2)) 1059 if (tcp_v4_md5_hash_pseudoheader(hp, daddr, saddr, th->doff << 2))
1059 goto clear_hash; 1060 goto clear_hash;
@@ -1061,7 +1062,8 @@ static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key,
1061 goto clear_hash; 1062 goto clear_hash;
1062 if (tcp_md5_hash_key(hp, key)) 1063 if (tcp_md5_hash_key(hp, key))
1063 goto clear_hash; 1064 goto clear_hash;
1064 if (crypto_hash_final(desc, md5_hash)) 1065 ahash_request_set_crypt(req, NULL, md5_hash, 0);
1066 if (crypto_ahash_final(req))
1065 goto clear_hash; 1067 goto clear_hash;
1066 1068
1067 tcp_put_md5sig_pool(); 1069 tcp_put_md5sig_pool();
@@ -1079,7 +1081,7 @@ int tcp_v4_md5_hash_skb(char *md5_hash, const struct tcp_md5sig_key *key,
1079 const struct sk_buff *skb) 1081 const struct sk_buff *skb)
1080{ 1082{
1081 struct tcp_md5sig_pool *hp; 1083 struct tcp_md5sig_pool *hp;
1082 struct hash_desc *desc; 1084 struct ahash_request *req;
1083 const struct tcphdr *th = tcp_hdr(skb); 1085 const struct tcphdr *th = tcp_hdr(skb);
1084 __be32 saddr, daddr; 1086 __be32 saddr, daddr;
1085 1087
@@ -1095,9 +1097,9 @@ int tcp_v4_md5_hash_skb(char *md5_hash, const struct tcp_md5sig_key *key,
1095 hp = tcp_get_md5sig_pool(); 1097 hp = tcp_get_md5sig_pool();
1096 if (!hp) 1098 if (!hp)
1097 goto clear_hash_noput; 1099 goto clear_hash_noput;
1098 desc = &hp->md5_desc; 1100 req = hp->md5_req;
1099 1101
1100 if (crypto_hash_init(desc)) 1102 if (crypto_ahash_init(req))
1101 goto clear_hash; 1103 goto clear_hash;
1102 1104
1103 if (tcp_v4_md5_hash_pseudoheader(hp, daddr, saddr, skb->len)) 1105 if (tcp_v4_md5_hash_pseudoheader(hp, daddr, saddr, skb->len))
@@ -1108,7 +1110,8 @@ int tcp_v4_md5_hash_skb(char *md5_hash, const struct tcp_md5sig_key *key,
1108 goto clear_hash; 1110 goto clear_hash;
1109 if (tcp_md5_hash_key(hp, key)) 1111 if (tcp_md5_hash_key(hp, key))
1110 goto clear_hash; 1112 goto clear_hash;
1111 if (crypto_hash_final(desc, md5_hash)) 1113 ahash_request_set_crypt(req, NULL, md5_hash, 0);
1114 if (crypto_ahash_final(req))
1112 goto clear_hash; 1115 goto clear_hash;
1113 1116
1114 tcp_put_md5sig_pool(); 1117 tcp_put_md5sig_pool();