~ubuntu-branches/ubuntu/oneiric/strongswan/oneiric

« back to all changes in this revision

Viewing changes to src/charon/plugins/uci/uci_config.c

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2009-04-18 20:28:51 UTC
  • mfrom: (1.1.9 upstream) (2.1.15 karmic)
  • Revision ID: james.westby@ubuntu.com-20090418202851-ep722qhmzvpxh6yj
Tags: 4.3.2-1
Urgency high because of security issue and FTBFS.
* New upstream release, fixes security bug.
* Fix padlock handling for i386 in debian/rules.
  Closes: #525652 (FTBFS on i386)
* Acknowledge NMUs by security team.
  Closes: #533837, #531612
* Add "Conflicts: strongswan (< 4.2.12-1)" to libstrongswan, 
  strongswan-starter, strongswan-ikev1, and strongswan-ikev2 to force
  update of the strongswan package on installation and avoid conflicts
  caused by package restructuring.
  Closes: #526037: strongswan-ikev2 and strongswan: error when trying to 
                   install together
  Closes: #526486: strongswan and libstrongswan: error when trying to 
                   install together
  Closes: #526487: strongswan-ikev1 and strongswan: error when trying to 
                   install together
  Closes: #526488: strongswan-starter and strongswan: error when trying to 
                   install together
* Debconf templates and debian/control reviewed by the debian-l10n-
  english team as part of the Smith review project. Closes: #528073
* Debconf translation updates:
  Closes: #525234: [INTL:ja] Update po-debconf template translation (ja.po) 
  Closes: #528323: [INTL:sv] po-debconf file for strongswan 
  Closes: #528370: [INTL:vi] Vietnamese debconf templates translation update 
  Closes: #529027: [INTL:pt] Updated Portuguese translation for debconf messages
  Closes: #529071: [INTL:fr] French debconf templates translation update 
  Closes: #529592: nb translation of debconf PO for strongSWAN 
  Closes: #529638: [INTL:ru] Russian debconf templates translation 
  Closes: #529661: Updated Czech translation of strongswan debconf messages 
  Closes: #529742: [INTL:eu] strongswan debconf basque translation 
  Closes: #530273: [INTL:fi] Finnish translation of the debconf templates
  Closes: #529063: [INTL:gl] strongswan 4.2.14-2 debconf translation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
14
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15
15
 * for more details.
16
 
 *
17
 
 * $Id$
18
16
 */
19
17
 
20
18
#define _GNU_SOURCE
83
81
}
84
82
 
85
83
/**
86
 
 * create an identity, with fallback to %any
87
 
 */
88
 
static identification_t *create_id(char *string)
89
 
{
90
 
        identification_t *id = NULL;
91
 
        
92
 
        if (string)
93
 
        {
94
 
                id = identification_create_from_string(string);
95
 
        }
96
 
        if (!id)
97
 
        {
98
 
                id = identification_create_from_encoding(ID_ANY, chunk_empty);
99
 
        }
100
 
        return id;
101
 
}
102
 
 
103
 
/**
104
84
 * create an traffic selector, fallback to dynamic
105
85
 */
106
86
static traffic_selector_t *create_ts(char *string)
163
143
        char *remote_id, *remote_addr, *remote_net;
164
144
        child_cfg_t *child_cfg;
165
145
        ike_cfg_t *ike_cfg;
166
 
        auth_info_t *auth;
167
 
        auth_class_t class;
 
146
        auth_cfg_t *auth;
168
147
        
169
148
        /* defaults */
170
149
        name = "unnamed";
187
166
                ike_cfg = ike_cfg_create(FALSE, FALSE, local_addr, remote_addr);
188
167
                ike_cfg->add_proposal(ike_cfg, create_proposal(ike_proposal, PROTO_IKE));
189
168
                this->peer_cfg = peer_cfg_create(
190
 
                                        name, 2, ike_cfg, create_id(local_id), create_id(remote_id),
191
 
                                        CERT_SEND_IF_ASKED, UNIQUE_NO,
 
169
                                        name, 2, ike_cfg, CERT_SEND_IF_ASKED, UNIQUE_NO,
192
170
                                        1, create_rekey(ike_rekey), 0,  /* keytries, rekey, reauth */
193
171
                                        1800, 900,                                              /* jitter, overtime */
194
172
                                        TRUE, 60,                                               /* mobike, dpddelay */
195
173
                                        NULL, NULL,                                     /* vip, pool */
196
174
                                        FALSE, NULL, NULL);                     /* mediation, med by, peer id */
197
 
                auth = this->peer_cfg->get_auth(this->peer_cfg);
198
 
                class = AUTH_CLASS_PSK;
199
 
                auth->add_item(auth, AUTHN_AUTH_CLASS, &class);
 
175
                auth = auth_cfg_create();
 
176
                auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PSK);
 
177
                auth->add(auth, AUTH_RULE_IDENTITY,
 
178
                                  identification_create_from_string(local_id));
 
179
                this->peer_cfg->add_auth_cfg(this->peer_cfg, auth, TRUE);
 
180
                
 
181
                auth = auth_cfg_create();
 
182
                auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PSK);
 
183
                if (remote_id)
 
184
                {
 
185
                        auth->add(auth, AUTH_RULE_IDENTITY,
 
186
                                          identification_create_from_string(remote_id));
 
187
                }
 
188
                this->peer_cfg->add_auth_cfg(this->peer_cfg, auth, FALSE);
200
189
                child_cfg = child_cfg_create(name,
201
190
                                        create_rekey(esp_rekey) + 300, create_rekey(ike_rekey), 300,
202
191
                                        NULL, TRUE,     MODE_TUNNEL, ACTION_NONE, ACTION_NONE, FALSE);