diff options
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 5c8c84273028..3447859bdc57 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -66,7 +66,7 @@ | |||
66 | #include <linux/proc_fs.h> | 66 | #include <linux/proc_fs.h> |
67 | #include <linux/seq_file.h> | 67 | #include <linux/seq_file.h> |
68 | 68 | ||
69 | #include <linux/crypto.h> | 69 | #include <crypto/hash.h> |
70 | #include <linux/scatterlist.h> | 70 | #include <linux/scatterlist.h> |
71 | 71 | ||
72 | static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb); | 72 | static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb); |
@@ -541,7 +541,8 @@ static int tcp_v6_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp, | |||
541 | bp->len = cpu_to_be32(nbytes); | 541 | bp->len = cpu_to_be32(nbytes); |
542 | 542 | ||
543 | sg_init_one(&sg, bp, sizeof(*bp)); | 543 | sg_init_one(&sg, bp, sizeof(*bp)); |
544 | return crypto_hash_update(&hp->md5_desc, &sg, sizeof(*bp)); | 544 | ahash_request_set_crypt(hp->md5_req, &sg, NULL, sizeof(*bp)); |
545 | return crypto_ahash_update(hp->md5_req); | ||
545 | } | 546 | } |
546 | 547 | ||
547 | static int tcp_v6_md5_hash_hdr(char *md5_hash, struct tcp_md5sig_key *key, | 548 | static int tcp_v6_md5_hash_hdr(char *md5_hash, struct tcp_md5sig_key *key, |
@@ -549,14 +550,14 @@ static int tcp_v6_md5_hash_hdr(char *md5_hash, struct tcp_md5sig_key *key, | |||
549 | const struct tcphdr *th) | 550 | const struct tcphdr *th) |
550 | { | 551 | { |
551 | struct tcp_md5sig_pool *hp; | 552 | struct tcp_md5sig_pool *hp; |
552 | struct hash_desc *desc; | 553 | struct ahash_request *req; |
553 | 554 | ||
554 | hp = tcp_get_md5sig_pool(); | 555 | hp = tcp_get_md5sig_pool(); |
555 | if (!hp) | 556 | if (!hp) |
556 | goto clear_hash_noput; | 557 | goto clear_hash_noput; |
557 | desc = &hp->md5_desc; | 558 | req = hp->md5_req; |
558 | 559 | ||
559 | if (crypto_hash_init(desc)) | 560 | if (crypto_ahash_init(req)) |
560 | goto clear_hash; | 561 | goto clear_hash; |
561 | if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, th->doff << 2)) | 562 | if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, th->doff << 2)) |
562 | goto clear_hash; | 563 | goto clear_hash; |
@@ -564,7 +565,8 @@ static int tcp_v6_md5_hash_hdr(char *md5_hash, struct tcp_md5sig_key *key, | |||
564 | goto clear_hash; | 565 | goto clear_hash; |
565 | if (tcp_md5_hash_key(hp, key)) | 566 | if (tcp_md5_hash_key(hp, key)) |
566 | goto clear_hash; | 567 | goto clear_hash; |
567 | if (crypto_hash_final(desc, md5_hash)) | 568 | ahash_request_set_crypt(req, NULL, md5_hash, 0); |
569 | if (crypto_ahash_final(req)) | ||
568 | goto clear_hash; | 570 | goto clear_hash; |
569 | 571 | ||
570 | tcp_put_md5sig_pool(); | 572 | tcp_put_md5sig_pool(); |
@@ -584,7 +586,7 @@ static int tcp_v6_md5_hash_skb(char *md5_hash, | |||
584 | { | 586 | { |
585 | const struct in6_addr *saddr, *daddr; | 587 | const struct in6_addr *saddr, *daddr; |
586 | struct tcp_md5sig_pool *hp; | 588 | struct tcp_md5sig_pool *hp; |
587 | struct hash_desc *desc; | 589 | struct ahash_request *req; |
588 | const struct tcphdr *th = tcp_hdr(skb); | 590 | const struct tcphdr *th = tcp_hdr(skb); |
589 | 591 | ||
590 | if (sk) { /* valid for establish/request sockets */ | 592 | if (sk) { /* valid for establish/request sockets */ |
@@ -599,9 +601,9 @@ static int tcp_v6_md5_hash_skb(char *md5_hash, | |||
599 | hp = tcp_get_md5sig_pool(); | 601 | hp = tcp_get_md5sig_pool(); |
600 | if (!hp) | 602 | if (!hp) |
601 | goto clear_hash_noput; | 603 | goto clear_hash_noput; |
602 | desc = &hp->md5_desc; | 604 | req = hp->md5_req; |
603 | 605 | ||
604 | if (crypto_hash_init(desc)) | 606 | if (crypto_ahash_init(req)) |
605 | goto clear_hash; | 607 | goto clear_hash; |
606 | 608 | ||
607 | if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, skb->len)) | 609 | if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, skb->len)) |
@@ -612,7 +614,8 @@ static int tcp_v6_md5_hash_skb(char *md5_hash, | |||
612 | goto clear_hash; | 614 | goto clear_hash; |
613 | if (tcp_md5_hash_key(hp, key)) | 615 | if (tcp_md5_hash_key(hp, key)) |
614 | goto clear_hash; | 616 | goto clear_hash; |
615 | if (crypto_hash_final(desc, md5_hash)) | 617 | ahash_request_set_crypt(req, NULL, md5_hash, 0); |
618 | if (crypto_ahash_final(req)) | ||
616 | goto clear_hash; | 619 | goto clear_hash; |
617 | 620 | ||
618 | tcp_put_md5sig_pool(); | 621 | tcp_put_md5sig_pool(); |