Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
d7d85510
Commit
d7d85510
authored
Mar 06, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Fix build when ipsec is disabled.
parent
e2349697
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
108 additions
and
78 deletions
+108
-78
include/net/ah.h
include/net/ah.h
+35
-0
include/net/esp.h
include/net/esp.h
+56
-0
include/net/xfrm.h
include/net/xfrm.h
+1
-78
net/ipv4/ah.c
net/ipv4/ah.c
+1
-0
net/ipv4/esp.c
net/ipv4/esp.c
+1
-0
net/ipv4/xfrm_algo.c
net/ipv4/xfrm_algo.c
+6
-0
net/ipv6/ah6.c
net/ipv6/ah6.c
+1
-0
net/ipv6/esp6.c
net/ipv6/esp6.c
+1
-0
net/netsyms.c
net/netsyms.c
+6
-0
No files found.
include/net/ah.h
0 → 100644
View file @
d7d85510
#ifndef _NET_AH_H
#define _NET_AH_H
#include <net/xfrm.h>
struct
ah_data
{
u8
*
key
;
int
key_len
;
u8
*
work_icv
;
int
icv_full_len
;
int
icv_trunc_len
;
void
(
*
icv
)(
struct
ah_data
*
,
struct
sk_buff
*
skb
,
u8
*
icv
);
struct
crypto_tfm
*
tfm
;
};
extern
void
skb_ah_walk
(
const
struct
sk_buff
*
skb
,
struct
crypto_tfm
*
tfm
,
icv_update_fn_t
icv_update
);
static
inline
void
ah_hmac_digest
(
struct
ah_data
*
ahp
,
struct
sk_buff
*
skb
,
u8
*
auth_data
)
{
struct
crypto_tfm
*
tfm
=
ahp
->
tfm
;
memset
(
auth_data
,
0
,
ahp
->
icv_trunc_len
);
crypto_hmac_init
(
tfm
,
ahp
->
key
,
&
ahp
->
key_len
);
skb_ah_walk
(
skb
,
tfm
,
crypto_hmac_update
);
crypto_hmac_final
(
tfm
,
ahp
->
key
,
&
ahp
->
key_len
,
ahp
->
work_icv
);
memcpy
(
auth_data
,
ahp
->
work_icv
,
ahp
->
icv_trunc_len
);
}
#endif
include/net/esp.h
0 → 100644
View file @
d7d85510
#ifndef _NET_ESP_H
#define _NET_ESP_H
#include <net/xfrm.h>
struct
esp_data
{
/* Confidentiality */
struct
{
u8
*
key
;
/* Key */
int
key_len
;
/* Key length */
u8
*
ivec
;
/* ivec buffer */
/* ivlen is offset from enc_data, where encrypted data start.
* It is logically different of crypto_tfm_alg_ivsize(tfm).
* We assume that it is either zero (no ivec), or
* >= crypto_tfm_alg_ivsize(tfm). */
int
ivlen
;
int
padlen
;
/* 0..255 */
struct
crypto_tfm
*
tfm
;
/* crypto handle */
}
conf
;
/* Integrity. It is active when icv_full_len != 0 */
struct
{
u8
*
key
;
/* Key */
int
key_len
;
/* Length of the key */
u8
*
work_icv
;
int
icv_full_len
;
int
icv_trunc_len
;
void
(
*
icv
)(
struct
esp_data
*
,
struct
sk_buff
*
skb
,
int
offset
,
int
len
,
u8
*
icv
);
struct
crypto_tfm
*
tfm
;
}
auth
;
};
extern
void
skb_icv_walk
(
const
struct
sk_buff
*
skb
,
struct
crypto_tfm
*
tfm
,
int
offset
,
int
len
,
icv_update_fn_t
icv_update
);
extern
int
skb_to_sgvec
(
struct
sk_buff
*
skb
,
struct
scatterlist
*
sg
,
int
offset
,
int
len
);
extern
int
skb_cow_data
(
struct
sk_buff
*
skb
,
int
tailbits
,
struct
sk_buff
**
trailer
);
extern
void
*
pskb_put
(
struct
sk_buff
*
skb
,
struct
sk_buff
*
tail
,
int
len
);
static
inline
void
esp_hmac_digest
(
struct
esp_data
*
esp
,
struct
sk_buff
*
skb
,
int
offset
,
int
len
,
u8
*
auth_data
)
{
struct
crypto_tfm
*
tfm
=
esp
->
auth
.
tfm
;
char
*
icv
=
esp
->
auth
.
work_icv
;
memset
(
auth_data
,
0
,
esp
->
auth
.
icv_trunc_len
);
crypto_hmac_init
(
tfm
,
esp
->
auth
.
key
,
&
esp
->
auth
.
key_len
);
skb_icv_walk
(
skb
,
tfm
,
offset
,
len
,
crypto_hmac_update
);
crypto_hmac_final
(
tfm
,
esp
->
auth
.
key
,
&
esp
->
auth
.
key_len
,
icv
);
memcpy
(
auth_data
,
icv
,
esp
->
auth
.
icv_trunc_len
);
}
#endif
include/net/xfrm.h
View file @
d7d85510
...
...
@@ -492,85 +492,8 @@ extern int xfrm6_register_type(struct xfrm_type *type);
extern
int
xfrm6_unregister_type
(
struct
xfrm_type
*
type
);
extern
struct
xfrm_type
*
xfrm6_get_type
(
u8
proto
);
struct
ah_data
{
u8
*
key
;
int
key_len
;
u8
*
work_icv
;
int
icv_full_len
;
int
icv_trunc_len
;
void
(
*
icv
)(
struct
ah_data
*
,
struct
sk_buff
*
skb
,
u8
*
icv
);
struct
crypto_tfm
*
tfm
;
};
struct
esp_data
{
/* Confidentiality */
struct
{
u8
*
key
;
/* Key */
int
key_len
;
/* Key length */
u8
*
ivec
;
/* ivec buffer */
/* ivlen is offset from enc_data, where encrypted data start.
* It is logically different of crypto_tfm_alg_ivsize(tfm).
* We assume that it is either zero (no ivec), or
* >= crypto_tfm_alg_ivsize(tfm). */
int
ivlen
;
int
padlen
;
/* 0..255 */
struct
crypto_tfm
*
tfm
;
/* crypto handle */
}
conf
;
/* Integrity. It is active when icv_full_len != 0 */
struct
{
u8
*
key
;
/* Key */
int
key_len
;
/* Length of the key */
u8
*
work_icv
;
int
icv_full_len
;
int
icv_trunc_len
;
void
(
*
icv
)(
struct
esp_data
*
,
struct
sk_buff
*
skb
,
int
offset
,
int
len
,
u8
*
icv
);
struct
crypto_tfm
*
tfm
;
}
auth
;
};
struct
crypto_tfm
;
typedef
void
(
icv_update_fn_t
)(
struct
crypto_tfm
*
,
struct
scatterlist
*
,
unsigned
int
);
extern
void
skb_ah_walk
(
const
struct
sk_buff
*
skb
,
struct
crypto_tfm
*
tfm
,
icv_update_fn_t
icv_update
);
extern
void
skb_icv_walk
(
const
struct
sk_buff
*
skb
,
struct
crypto_tfm
*
tfm
,
int
offset
,
int
len
,
icv_update_fn_t
icv_update
);
extern
int
skb_to_sgvec
(
struct
sk_buff
*
skb
,
struct
scatterlist
*
sg
,
int
offset
,
int
len
);
extern
int
skb_cow_data
(
struct
sk_buff
*
skb
,
int
tailbits
,
struct
sk_buff
**
trailer
);
extern
void
*
pskb_put
(
struct
sk_buff
*
skb
,
struct
sk_buff
*
tail
,
int
len
);
static
inline
void
ah_hmac_digest
(
struct
ah_data
*
ahp
,
struct
sk_buff
*
skb
,
u8
*
auth_data
)
{
struct
crypto_tfm
*
tfm
=
ahp
->
tfm
;
memset
(
auth_data
,
0
,
ahp
->
icv_trunc_len
);
crypto_hmac_init
(
tfm
,
ahp
->
key
,
&
ahp
->
key_len
);
skb_ah_walk
(
skb
,
tfm
,
crypto_hmac_update
);
crypto_hmac_final
(
tfm
,
ahp
->
key
,
&
ahp
->
key_len
,
ahp
->
work_icv
);
memcpy
(
auth_data
,
ahp
->
work_icv
,
ahp
->
icv_trunc_len
);
}
static
inline
void
esp_hmac_digest
(
struct
esp_data
*
esp
,
struct
sk_buff
*
skb
,
int
offset
,
int
len
,
u8
*
auth_data
)
{
struct
crypto_tfm
*
tfm
=
esp
->
auth
.
tfm
;
char
*
icv
=
esp
->
auth
.
work_icv
;
memset
(
auth_data
,
0
,
esp
->
auth
.
icv_trunc_len
);
crypto_hmac_init
(
tfm
,
esp
->
auth
.
key
,
&
esp
->
auth
.
key_len
);
skb_icv_walk
(
skb
,
tfm
,
offset
,
len
,
crypto_hmac_update
);
crypto_hmac_final
(
tfm
,
esp
->
auth
.
key
,
&
esp
->
auth
.
key_len
,
icv
);
memcpy
(
auth_data
,
icv
,
esp
->
auth
.
icv_trunc_len
);
}
typedef
int
(
xfrm_dst_lookup_t
)(
struct
xfrm_dst
**
dst
,
struct
flowi
*
fl
);
int
xfrm_dst_lookup_register
(
xfrm_dst_lookup_t
*
dst_lookup
,
unsigned
short
family
);
...
...
net/ipv4/ah.c
View file @
d7d85510
...
...
@@ -2,6 +2,7 @@
#include <linux/module.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/ah.h>
#include <linux/crypto.h>
#include <linux/pfkeyv2.h>
#include <net/icmp.h>
...
...
net/ipv4/esp.c
View file @
d7d85510
...
...
@@ -2,6 +2,7 @@
#include <linux/module.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/esp.h>
#include <asm/scatterlist.h>
#include <linux/crypto.h>
#include <linux/pfkeyv2.h>
...
...
net/ipv4/xfrm_algo.c
View file @
d7d85510
...
...
@@ -12,6 +12,12 @@
#include <linux/kernel.h>
#include <linux/pfkeyv2.h>
#include <net/xfrm.h>
#if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE)
#include <net/ah.h>
#endif
#if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE)
#include <net/esp.h>
#endif
#include <asm/scatterlist.h>
/*
...
...
net/ipv6/ah6.c
View file @
d7d85510
...
...
@@ -28,6 +28,7 @@
#include <linux/module.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/ah.h>
#include <linux/crypto.h>
#include <linux/pfkeyv2.h>
#include <net/icmp.h>
...
...
net/ipv6/esp6.c
View file @
d7d85510
...
...
@@ -28,6 +28,7 @@
#include <linux/module.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/esp.h>
#include <asm/scatterlist.h>
#include <linux/crypto.h>
#include <linux/pfkeyv2.h>
...
...
net/netsyms.c
View file @
d7d85510
...
...
@@ -54,6 +54,12 @@ extern __u32 sysctl_rmem_max;
#include <linux/mroute.h>
#include <linux/igmp.h>
#include <net/xfrm.h>
#if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE)
#include <net/ah.h>
#endif
#if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE)
#include <net/esp.h>
#endif
extern
struct
net_proto_family
inet_family_ops
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment