~ubuntu-branches/ubuntu/hardy/openswan/hardy-updates

« back to all changes in this revision

Viewing changes to programs/starter/confread.h

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2005-01-27 16:10:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050127161011-idgybmyz3vwhpfiq
Tags: 2.3.0-2
Urgency HIGH due to security issue and problems with build-deps in sarge.
* Fix the security issue. Please see
  http://www.idefense.com/application/poi/display?id=190&
      type=vulnerabilities&flashstatus=false
  for more details. Thanks to Martin Schulze for informing me about
  this issue.
  Closes: #292458: Openswan XAUTH/PAM Buffer Overflow Vulnerability
* Added a Build-Dependency to lynx.
  Closes: #291143: openswan: FTBFS: Missing build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* FreeS/WAN config file parser (confread.h)
 
2
 * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License as published by the
 
6
 * Free Software Foundation; either version 2 of the License, or (at your
 
7
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful, but
 
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
11
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 
12
 * for more details.
 
13
 *
 
14
 * RCSID $Id: confread.h,v 1.14 2004/12/01 07:33:14 ken Exp $
 
15
 */
 
16
 
 
17
#ifndef _IPSEC_CONFREAD_H_
 
18
#define _IPSEC_CONFREAD_H_
 
19
 
 
20
#include "keywords.h"
 
21
 
 
22
#ifndef _OPENSWAN_H
 
23
#include <openswan.h>
 
24
#include "pluto/constants.h"    /* FIXME: ugly include */
 
25
#endif
 
26
 
 
27
 
 
28
/* define an upper limit to number of times also= can be used */
 
29
#define ALSO_LIMIT 32
 
30
 
 
31
typedef char *ksf[KEY_STRINGS_MAX];
 
32
typedef int   knf[KEY_NUMERIC_MAX];
 
33
typedef bool  str_set[KEY_STRINGS_MAX];
 
34
typedef bool  int_set[KEY_NUMERIC_MAX];
 
35
 
 
36
struct starter_end {
 
37
    sa_family_t addr_family;
 
38
    enum keyword_host addrtype; 
 
39
    ip_address addr, nexthop;
 
40
    bool has_client;
 
41
    ip_subnet subnet;
 
42
    char *iface;
 
43
    char *id;
 
44
    unsigned char *rsakey1;
 
45
    unsigned char *rsakey2;
 
46
    u_int16_t port;
 
47
    u_int8_t protocol;
 
48
        bool has_client_wildcard;
 
49
        char *cert;
 
50
#ifdef VIRTUAL_IP
 
51
        char *virt;
 
52
#endif
 
53
    ksf  strings;
 
54
    knf  options;
 
55
 
 
56
    str_set strings_set;
 
57
    int_set options_set;
 
58
};
 
59
 
 
60
struct starter_conn {
 
61
    TAILQ_ENTRY(starter_conn) link;
 
62
    char *name;
 
63
 
 
64
    ksf   strings;
 
65
    knf   options;
 
66
    str_set strings_set;
 
67
    int_set options_set;
 
68
 
 
69
    bool  changed;
 
70
 
 
71
    bool  manualkey;         /* TRUE if this conn is going to be manually keyed */
 
72
    
 
73
    lset_t policy;
 
74
    char **alsos;
 
75
 
 
76
    struct starter_end left, right;
 
77
 
 
78
    unsigned long id;
 
79
 
 
80
    enum keyword_auto desired_state;
 
81
 
 
82
    enum {
 
83
        STATE_INVALID,
 
84
        STATE_LOADED,
 
85
        STATE_TO_ADD,
 
86
        STATE_ADDED,
 
87
        STATE_UP,
 
88
        STATE_REPLACED,
 
89
        STATE_IGNORE
 
90
    } state;
 
91
 
 
92
        char *esp;
 
93
        char *ike;
 
94
};
 
95
 
 
96
struct starter_config {
 
97
    struct {
 
98
        ksf   strings;
 
99
        knf   options;
 
100
        
 
101
        /* derived types */
 
102
        char **interfaces;
 
103
                bool strictcrlpolicy;
 
104
                bool nocrsend;
 
105
#ifdef NAT_TRAVERSAL
 
106
                bool nat_traversal;
 
107
                unsigned int keep_alive;
 
108
#endif
 
109
#ifdef VIRTUAL_IP
 
110
                char *virtual_private;
 
111
#endif
 
112
        
 
113
    } setup;
 
114
 
 
115
    /* conn %default */
 
116
    struct starter_conn conn_default;
 
117
    bool                got_default;
 
118
 
 
119
    /* connections list (without %default) */
 
120
    TAILQ_HEAD(, starter_conn) conns;
 
121
};
 
122
 
 
123
struct starter_config *confread_load(const char *file, char **perr);
 
124
 
 
125
void confread_free(struct starter_config *cfg);
 
126
 
 
127
#endif /* _IPSEC_CONFREAD_H_ */
 
128
 
 
129
/*
 
130
 * Local Variables:
 
131
 * c-basic-offset:4
 
132
 * c-style: pluto
 
133
 * End:
 
134
 */