pass ARCH down to uClibc
[buildroot.git] / package / openswan / linux-2.6.21.5-openswan-2.4.8.kernel-2.6-zzz00-fixup.patch
blob729befe341fd44bb35962629cd006bf137f12583
1 diff -rduNp linux-2.6.21.5.openswan28/net/ipsec/ipsec_alg_cryptoapi.c linux-2.6.21.5/net/ipsec/ipsec_alg_cryptoapi.c
2 --- linux-2.6.21.5.openswan28/net/ipsec/ipsec_alg_cryptoapi.c 2007-06-21 10:44:07.000000000 +0200
3 +++ linux-2.6.21.5/net/ipsec/ipsec_alg_cryptoapi.c 2007-06-21 23:34:05.000000000 +0200
4 @@ -197,7 +197,7 @@ static struct ipsec_alg_capi_cipher alg_
5 */
6 int setup_cipher(const char *ciphername)
8 - return crypto_alg_available(ciphername, 0);
9 + return crypto_has_alg(ciphername, 0, CRYPTO_ALG_ASYNC);
13 @@ -272,7 +272,7 @@ static __u8 *
14 _capi_new_key (struct ipsec_alg_enc *alg, const __u8 *key, size_t keylen)
16 struct ipsec_alg_capi_cipher *cptr;
17 - struct crypto_tfm *tfm=NULL;
18 + struct crypto_cipher *tfm=NULL;
20 cptr = alg->ixt_common.ixt_data;
21 if (!cptr) {
22 @@ -289,7 +289,7 @@ _capi_new_key (struct ipsec_alg_enc *alg
23 /*
24 * alloc tfm
26 - tfm = crypto_alloc_tfm(cptr->ciphername, CRYPTO_TFM_MODE_CBC);
27 + tfm = crypto_alloc_cipher(cptr->ciphername, 0, CRYPTO_ALG_ASYNC);
28 if (!tfm) {
29 printk(KERN_ERR "_capi_new_key(): "
30 "NULL tfm for \"%s\" cryptoapi (\"%s\") algo\n"
31 @@ -300,7 +300,7 @@ _capi_new_key (struct ipsec_alg_enc *alg
32 printk(KERN_ERR "_capi_new_key(): "
33 "failed new_key() for \"%s\" cryptoapi algo (keylen=%d)\n"
34 , alg->ixt_common.ixt_name, keylen);
35 - crypto_free_tfm(tfm);
36 + crypto_free_cipher(tfm);
37 tfm=NULL;
39 err:
40 @@ -317,23 +317,26 @@ err:
41 static int
42 _capi_cbc_encrypt(struct ipsec_alg_enc *alg, __u8 * key_e, __u8 * in, int ilen, const __u8 * iv, int encrypt) {
43 int error =0;
44 - struct crypto_tfm *tfm=(struct crypto_tfm *)key_e;
45 + struct crypto_blkcipher *tfm=(struct crypto_blkcipher *)key_e;
46 + struct blkcipher_desc desc;
47 struct scatterlist sg = {
48 .page = virt_to_page(in),
49 .offset = (unsigned long)(in) % PAGE_SIZE,
50 .length=ilen,
52 + desc.tfm = tfm;
53 + desc.flags = 0;
54 if (debug_crypto > 1)
55 printk(KERN_DEBUG "klips_debug:_capi_cbc_encrypt:"
56 "key_e=%p "
57 "in=%p out=%p ilen=%d iv=%p encrypt=%d\n"
58 , key_e
59 , in, in, ilen, iv, encrypt);
60 - crypto_cipher_set_iv(tfm, iv, crypto_tfm_alg_ivsize(tfm));
61 + crypto_blkcipher_set_iv(tfm, iv, crypto_blkcipher_ivsize(tfm));
62 if (encrypt)
63 - error = crypto_cipher_encrypt (tfm, &sg, &sg, ilen);
64 + error = crypto_blkcipher_encrypt (&desc, &sg, &sg, ilen);
65 else
66 - error = crypto_cipher_decrypt (tfm, &sg, &sg, ilen);
67 + error = crypto_blkcipher_decrypt (&desc, &sg, &sg, ilen);
68 if (debug_crypto > 1)
69 printk(KERN_DEBUG "klips_debug:_capi_cbc_encrypt:"
70 "error=%d\n"
71 @@ -370,8 +373,9 @@ setup_cipher_list (struct ipsec_alg_capi
72 * use a local ci to avoid touching cptr->ci,
73 * if register ipsec_alg success then bind cipher
75 - if(cptr->alg.ixt_common.ixt_support.ias_name == NULL) {
76 - cptr->alg.ixt_common.ixt_support.ias_name = cptr->ciphername;
77 + if (cptr->alg.ixt_common.ixt_support.ias_name == NULL) {
78 +printk(KERN_DEBUG "klips_debug: ias_name was nil\n");
79 +// cptr->alg.ixt_common.ixt_support.ias_name = cptr->ciphername;
82 if( setup_cipher(cptr->ciphername) ) {
83 diff -rduNp linux-2.6.21.5.openswan28/net/ipsec/sysctl_net_ipsec.c linux-2.6.21.5/net/ipsec/sysctl_net_ipsec.c
84 --- linux-2.6.21.5.openswan28/net/ipsec/sysctl_net_ipsec.c 2007-06-21 10:44:07.000000000 +0200
85 +++ linux-2.6.21.5/net/ipsec/sysctl_net_ipsec.c 2007-06-21 22:33:51.000000000 +0200
86 @@ -74,45 +74,45 @@ enum {
87 static ctl_table ipsec_table[] = {
88 #ifdef CONFIG_KLIPS_DEBUG
89 { NET_IPSEC_DEBUG_AH, "debug_ah", &debug_ah,
90 - sizeof(int), 0644, NULL, &proc_dointvec},
91 + sizeof(int), 0644, &proc_dointvec},
92 { NET_IPSEC_DEBUG_ESP, "debug_esp", &debug_esp,
93 - sizeof(int), 0644, NULL, &proc_dointvec},
94 + sizeof(int), 0644, &proc_dointvec},
95 { NET_IPSEC_DEBUG_TUNNEL, "debug_tunnel", &debug_tunnel,
96 - sizeof(int), 0644, NULL, &proc_dointvec},
97 + sizeof(int), 0644, &proc_dointvec},
98 { NET_IPSEC_DEBUG_EROUTE, "debug_eroute", &debug_eroute,
99 - sizeof(int), 0644, NULL, &proc_dointvec},
100 + sizeof(int), 0644, &proc_dointvec},
101 { NET_IPSEC_DEBUG_SPI, "debug_spi", &debug_spi,
102 - sizeof(int), 0644, NULL, &proc_dointvec},
103 + sizeof(int), 0644, &proc_dointvec},
104 { NET_IPSEC_DEBUG_RADIJ, "debug_radij", &debug_radij,
105 - sizeof(int), 0644, NULL, &proc_dointvec},
106 + sizeof(int), 0644, &proc_dointvec},
107 { NET_IPSEC_DEBUG_NETLINK, "debug_netlink", &debug_netlink,
108 - sizeof(int), 0644, NULL, &proc_dointvec},
109 + sizeof(int), 0644, &proc_dointvec},
110 { NET_IPSEC_DEBUG_XFORM, "debug_xform", &debug_xform,
111 - sizeof(int), 0644, NULL, &proc_dointvec},
112 + sizeof(int), 0644, &proc_dointvec},
113 { NET_IPSEC_DEBUG_RCV, "debug_rcv", &debug_rcv,
114 - sizeof(int), 0644, NULL, &proc_dointvec},
115 + sizeof(int), 0644, &proc_dointvec},
116 { NET_IPSEC_DEBUG_PFKEY, "debug_pfkey", &debug_pfkey,
117 - sizeof(int), 0644, NULL, &proc_dointvec},
118 + sizeof(int), 0644, &proc_dointvec},
119 { NET_IPSEC_DEBUG_VERBOSE, "debug_verbose",&sysctl_ipsec_debug_verbose,
120 - sizeof(int), 0644, NULL, &proc_dointvec},
121 + sizeof(int), 0644, &proc_dointvec},
122 #ifdef CONFIG_KLIPS_IPCOMP
123 { NET_IPSEC_DEBUG_IPCOMP, "debug_ipcomp", &sysctl_ipsec_debug_ipcomp,
124 - sizeof(int), 0644, NULL, &proc_dointvec},
125 + sizeof(int), 0644, &proc_dointvec},
126 #endif /* CONFIG_KLIPS_IPCOMP */
128 #ifdef CONFIG_KLIPS_REGRESS
129 { NET_IPSEC_REGRESS_PFKEY_LOSSAGE, "pfkey_lossage",
130 &sysctl_ipsec_regress_pfkey_lossage,
131 - sizeof(int), 0644, NULL, &proc_dointvec},
132 + sizeof(int), 0644, &proc_dointvec},
133 #endif /* CONFIG_KLIPS_REGRESS */
135 #endif /* CONFIG_KLIPS_DEBUG */
136 { NET_IPSEC_ICMP, "icmp", &sysctl_ipsec_icmp,
137 - sizeof(int), 0644, NULL, &proc_dointvec},
138 + sizeof(int), 0644, &proc_dointvec},
139 { NET_IPSEC_INBOUND_POLICY_CHECK, "inbound_policy_check", &sysctl_ipsec_inbound_policy_check,
140 - sizeof(int), 0644, NULL, &proc_dointvec},
141 + sizeof(int), 0644, &proc_dointvec},
142 { NET_IPSEC_TOS, "tos", &sysctl_ipsec_tos,
143 - sizeof(int), 0644, NULL, &proc_dointvec},
144 + sizeof(int), 0644, &proc_dointvec},
148 @@ -130,7 +130,7 @@ static struct ctl_table_header *ipsec_ta
150 int ipsec_sysctl_register(void)
152 - ipsec_table_header = register_sysctl_table(ipsec_root_table, 0);
153 + ipsec_table_header = register_sysctl_table(ipsec_root_table);
154 if (!ipsec_table_header) {
155 return -ENOMEM;