14
14
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
15
* for more details.
17
* RCSID $Id: ipsec_sa.c,v 1.22 2003/12/10 01:14:27 mcr Exp $
17
* RCSID $Id: ipsec_sa.c,v 1.25 2004/08/22 20:12:16 mcr Exp $
19
19
* This is the file formerly known as "ipsec_xform.h"
24
24
#include <linux/version.h>
25
25
#include <linux/kernel.h> /* printk() */
27
#include "freeswan/ipsec_param.h"
27
#include "openswan/ipsec_param.h"
30
30
# include <linux/slab.h> /* kmalloc() */
55
55
#include <asm/checksum.h>
56
56
#include <net/ip.h>
58
#include "freeswan/radij.h"
60
#include "freeswan/ipsec_stats.h"
61
#include "freeswan/ipsec_life.h"
62
#include "freeswan/ipsec_sa.h"
63
#include "freeswan/ipsec_xform.h"
65
#include "freeswan/ipsec_encap.h"
66
#include "freeswan/ipsec_radij.h"
67
#include "freeswan/ipsec_xform.h"
68
#include "freeswan/ipsec_ipe4.h"
69
#include "freeswan/ipsec_ah.h"
70
#include "freeswan/ipsec_esp.h"
58
#include "openswan/radij.h"
60
#include "openswan/ipsec_stats.h"
61
#include "openswan/ipsec_life.h"
62
#include "openswan/ipsec_sa.h"
63
#include "openswan/ipsec_xform.h"
65
#include "openswan/ipsec_encap.h"
66
#include "openswan/ipsec_radij.h"
67
#include "openswan/ipsec_xform.h"
68
#include "openswan/ipsec_ipe4.h"
69
#include "openswan/ipsec_ah.h"
70
#include "openswan/ipsec_esp.h"
72
72
#include <pfkeyv2.h>
75
#include "freeswan/ipsec_proto.h"
78
#ifdef CONFIG_IPSEC_DEBUG
75
#include "openswan/ipsec_proto.h"
76
#include "openswan/ipsec_alg.h"
79
#ifdef CONFIG_KLIPS_DEBUG
79
80
int debug_xform = 0;
80
#endif /* CONFIG_IPSEC_DEBUG */
81
#endif /* CONFIG_KLIPS_DEBUG */
82
83
#define SENDERR(_x) do { error = -(_x); goto errlab; } while (0)
983
984
ips->ips_key_a = NULL;
985
986
if(ips->ips_key_e != NULL) {
987
#ifdef CONFIG_KLIPS_ALG
988
if (ips->ips_alg_enc&&ips->ips_alg_enc->ixt_e_destroy_key) {
989
ips->ips_alg_enc->ixt_e_destroy_key(ips->ips_alg_enc,
992
#endif /* CONFIG_KLIPS_ALG */
986
993
memset((caddr_t)(ips->ips_key_e), 0, ips->ips_key_e_size);
987
994
kfree(ips->ips_key_e);
995
#ifdef CONFIG_KLIPS_ALG
997
#endif /* CONFIG_KLIPS_ALG */
989
999
ips->ips_key_e = NULL;
1009
1019
kfree(ips->ips_ident_d.data);
1011
1021
ips->ips_ident_d.data = NULL;
1023
#ifdef CONFIG_KLIPS_ALG
1024
if (ips->ips_alg_enc||ips->ips_alg_auth) {
1025
ipsec_alg_sa_wipe(ips);
1027
#endif /* CONFIG_KLIPS_ALG */
1013
1029
memset((caddr_t)ips, 0, sizeof(*ips));
1021
1037
* $Log: ipsec_sa.c,v $
1038
* Revision 1.25 2004/08/22 20:12:16 mcr
1039
* one more KLIPS_NAT->IPSEC_NAT.
1041
* Revision 1.24 2004/07/10 19:11:18 mcr
1042
* CONFIG_IPSEC -> CONFIG_KLIPS.
1044
* Revision 1.23 2004/04/06 02:49:26 mcr
1045
* pullup of algo code from alg-branch.
1047
* Revision 1.22.2.1 2003/12/22 15:25:52 jjo
1048
* . Merged algo-0.8.1-rc11-test1 into alg-branch
1022
1050
* Revision 1.22 2003/12/10 01:14:27 mcr
1023
1051
* NAT-traversal patches to KLIPS.