Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170736
b: refs/heads/master
c: 2ad9afb
h: refs/heads/master
v: v3
  • Loading branch information
Steffen Klassert authored and David S. Miller committed Oct 19, 2009
1 parent 72f515a commit 33c0ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8631e9bdfea189b2e5efe3b03825cc24ebb6cfb7
refs/heads/master: 2ad9afbf5ca27482aa275de517261d56fd1e7ba0
29 changes: 3 additions & 26 deletions trunk/include/net/ah.h
Original file line number Diff line number Diff line change
@@ -1,44 +1,21 @@
#ifndef _NET_AH_H
#define _NET_AH_H

#include <linux/crypto.h>
#include <net/xfrm.h>
#include <linux/skbuff.h>

/* This is the maximum truncated ICV length that we know of. */
#define MAX_AH_AUTH_LEN 12

struct crypto_ahash;

struct ah_data
{
u8 *work_icv;
int icv_full_len;
int icv_trunc_len;

struct crypto_hash *tfm;
struct crypto_ahash *ahash;
};

static inline int ah_mac_digest(struct ah_data *ahp, struct sk_buff *skb,
u8 *auth_data)
{
struct hash_desc desc;
int err;

desc.tfm = ahp->tfm;
desc.flags = 0;

memset(auth_data, 0, ahp->icv_trunc_len);
err = crypto_hash_init(&desc);
if (unlikely(err))
goto out;
err = skb_icv_walk(skb, &desc, 0, skb->len, crypto_hash_update);
if (unlikely(err))
goto out;
err = crypto_hash_final(&desc, ahp->work_icv);

out:
return err;
}

struct ip_auth_hdr;

static inline struct ip_auth_hdr *ip_auth_hdr(const struct sk_buff *skb)
Expand Down

0 comments on commit 33c0ec5

Please sign in to comment.