~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to util/ntp-keygen-opts.h

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-01-05 21:10:03 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090105211003-mh6zc3um4k1uhsj7
Tags: 1:4.2.4p4+dfsg-8
It did not properly check the return value of EVP_VerifyFinal
which results in an malformed DSA signature being treated as
a good signature rather than as an error.  (CVE-2009-0021)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*   -*- buffer-read-only: t -*- vi: set ro:
 
2
 *  
 
3
 *  DO NOT EDIT THIS FILE   (ntp-keygen-opts.h)
 
4
 *  
 
5
 *  It has been AutoGen-ed  Monday September 10, 2007 at 08:39:19 PM EDT
 
6
 *  From the definitions    ntp-keygen-opts.def
 
7
 *  and the template file   options
 
8
 *
 
9
 * Generated from AutoOpts 29:0:4 templates.
 
10
 */
 
11
 
 
12
/*
 
13
 *  This file was produced by an AutoOpts template.  AutoOpts is a
 
14
 *  copyrighted work.  This header file is not encumbered by AutoOpts
 
15
 *  licensing, but is provided under the licensing terms chosen by the
 
16
 *  ntp-keygen author or copyright holder.  AutoOpts is licensed under
 
17
 *  the terms of the LGPL.  The redistributable library (``libopts'') is
 
18
 *  licensed under the terms of either the LGPL or, at the users discretion,
 
19
 *  the BSD license.  See the AutoOpts and/or libopts sources for details.
 
20
 *
 
21
 * This source file is copyrighted and licensed under the following terms:
 
22
 *
 
23
 * ntp-keygen copyright 1970-2007 David L. Mills and/or others - all rights reserved
 
24
 *
 
25
 * see html/copyright.html
 
26
 */
 
27
/*
 
28
 *  This file contains the programmatic interface to the Automated
 
29
 *  Options generated for the ntp-keygen program.
 
30
 *  These macros are documented in the AutoGen info file in the
 
31
 *  "AutoOpts" chapter.  Please refer to that doc for usage help.
 
32
 */
 
33
#ifndef AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD
 
34
#define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD
 
35
#include "config.h"
 
36
#include <autoopts/options.h>
 
37
 
 
38
/*
 
39
 *  Ensure that the library used for compiling this generated header is at
 
40
 *  least as new as the version current when the header template was released
 
41
 *  (not counting patch version increments).  Also ensure that the oldest
 
42
 *  tolerable version is at least as old as what was current when the header
 
43
 *  template was released.
 
44
 */
 
45
#define AO_TEMPLATE_VERSION 118784
 
46
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
 
47
 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 
48
# error option template version mismatches autoopts/options.h header
 
49
  Choke Me.
 
50
#endif
 
51
 
 
52
/*
 
53
 *  Enumeration of each option:
 
54
 */
 
55
typedef enum {
 
56
        INDEX_OPT_CERTIFICATE      =  0,
 
57
        INDEX_OPT_DEBUG_LEVEL      =  1,
 
58
        INDEX_OPT_SET_DEBUG_LEVEL  =  2,
 
59
        INDEX_OPT_ID_KEY           =  3,
 
60
        INDEX_OPT_GQ_PARAMS        =  4,
 
61
        INDEX_OPT_GQ_KEYS          =  5,
 
62
        INDEX_OPT_HOST_KEY         =  6,
 
63
        INDEX_OPT_IFFKEY           =  7,
 
64
        INDEX_OPT_ISSUER_NAME      =  8,
 
65
        INDEX_OPT_MD5KEY           =  9,
 
66
        INDEX_OPT_MODULUS          = 10,
 
67
        INDEX_OPT_PVT_CERT         = 11,
 
68
        INDEX_OPT_PVT_PASSWD       = 12,
 
69
        INDEX_OPT_GET_PVT_PASSWD   = 13,
 
70
        INDEX_OPT_SIGN_KEY         = 14,
 
71
        INDEX_OPT_SUBJECT_NAME     = 15,
 
72
        INDEX_OPT_TRUSTED_CERT     = 16,
 
73
        INDEX_OPT_MV_PARAMS        = 17,
 
74
        INDEX_OPT_MV_KEYS          = 18,
 
75
        INDEX_OPT_VERSION          = 19,
 
76
        INDEX_OPT_HELP             = 20,
 
77
        INDEX_OPT_MORE_HELP        = 21,
 
78
        INDEX_OPT_SAVE_OPTS        = 22,
 
79
        INDEX_OPT_LOAD_OPTS        = 23
 
80
} teOptIndex;
 
81
 
 
82
#define OPTION_CT    24
 
83
#define NTP_KEYGEN_VERSION       "4.2.4p4"
 
84
#define NTP_KEYGEN_FULL_VERSION  "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.4p4"
 
85
 
 
86
/*
 
87
 *  Interface defines for all options.  Replace "n" with the UPPER_CASED
 
88
 *  option name (as in the teOptIndex enumeration above).
 
89
 *  e.g. HAVE_OPT( CERTIFICATE )
 
90
 */
 
91
#define         DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n])
 
92
#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
 
93
#define      OPT_ARG(n) (DESC(n).optArg.argString)
 
94
#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
 
95
#define    COUNT_OPT(n) (DESC(n).optOccCt)
 
96
#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
 
97
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
 
98
#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
 
99
#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
 
100
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
 
101
#define    CLEAR_OPT(n) STMTS( \
 
102
                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
 
103
                if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
 
104
                    DESC(n).fOptState |= OPTST_DISABLED; \
 
105
                DESC(n).optCookie = NULL )
 
106
 
 
107
/*
 
108
 *  Make sure there are no #define name conflicts with the option names
 
109
 */
 
110
#ifndef     NO_OPTION_NAME_WARNINGS
 
111
# ifdef    CERTIFICATE
 
112
#  warning undefining CERTIFICATE due to option name conflict
 
113
#  undef   CERTIFICATE
 
114
# endif
 
115
# ifdef    DEBUG_LEVEL
 
116
#  warning undefining DEBUG_LEVEL due to option name conflict
 
117
#  undef   DEBUG_LEVEL
 
118
# endif
 
119
# ifdef    SET_DEBUG_LEVEL
 
120
#  warning undefining SET_DEBUG_LEVEL due to option name conflict
 
121
#  undef   SET_DEBUG_LEVEL
 
122
# endif
 
123
# ifdef    ID_KEY
 
124
#  warning undefining ID_KEY due to option name conflict
 
125
#  undef   ID_KEY
 
126
# endif
 
127
# ifdef    GQ_PARAMS
 
128
#  warning undefining GQ_PARAMS due to option name conflict
 
129
#  undef   GQ_PARAMS
 
130
# endif
 
131
# ifdef    GQ_KEYS
 
132
#  warning undefining GQ_KEYS due to option name conflict
 
133
#  undef   GQ_KEYS
 
134
# endif
 
135
# ifdef    HOST_KEY
 
136
#  warning undefining HOST_KEY due to option name conflict
 
137
#  undef   HOST_KEY
 
138
# endif
 
139
# ifdef    IFFKEY
 
140
#  warning undefining IFFKEY due to option name conflict
 
141
#  undef   IFFKEY
 
142
# endif
 
143
# ifdef    ISSUER_NAME
 
144
#  warning undefining ISSUER_NAME due to option name conflict
 
145
#  undef   ISSUER_NAME
 
146
# endif
 
147
# ifdef    MD5KEY
 
148
#  warning undefining MD5KEY due to option name conflict
 
149
#  undef   MD5KEY
 
150
# endif
 
151
# ifdef    MODULUS
 
152
#  warning undefining MODULUS due to option name conflict
 
153
#  undef   MODULUS
 
154
# endif
 
155
# ifdef    PVT_CERT
 
156
#  warning undefining PVT_CERT due to option name conflict
 
157
#  undef   PVT_CERT
 
158
# endif
 
159
# ifdef    PVT_PASSWD
 
160
#  warning undefining PVT_PASSWD due to option name conflict
 
161
#  undef   PVT_PASSWD
 
162
# endif
 
163
# ifdef    GET_PVT_PASSWD
 
164
#  warning undefining GET_PVT_PASSWD due to option name conflict
 
165
#  undef   GET_PVT_PASSWD
 
166
# endif
 
167
# ifdef    SIGN_KEY
 
168
#  warning undefining SIGN_KEY due to option name conflict
 
169
#  undef   SIGN_KEY
 
170
# endif
 
171
# ifdef    SUBJECT_NAME
 
172
#  warning undefining SUBJECT_NAME due to option name conflict
 
173
#  undef   SUBJECT_NAME
 
174
# endif
 
175
# ifdef    TRUSTED_CERT
 
176
#  warning undefining TRUSTED_CERT due to option name conflict
 
177
#  undef   TRUSTED_CERT
 
178
# endif
 
179
# ifdef    MV_PARAMS
 
180
#  warning undefining MV_PARAMS due to option name conflict
 
181
#  undef   MV_PARAMS
 
182
# endif
 
183
# ifdef    MV_KEYS
 
184
#  warning undefining MV_KEYS due to option name conflict
 
185
#  undef   MV_KEYS
 
186
# endif
 
187
#else  /* NO_OPTION_NAME_WARNINGS */
 
188
# undef CERTIFICATE
 
189
# undef DEBUG_LEVEL
 
190
# undef SET_DEBUG_LEVEL
 
191
# undef ID_KEY
 
192
# undef GQ_PARAMS
 
193
# undef GQ_KEYS
 
194
# undef HOST_KEY
 
195
# undef IFFKEY
 
196
# undef ISSUER_NAME
 
197
# undef MD5KEY
 
198
# undef MODULUS
 
199
# undef PVT_CERT
 
200
# undef PVT_PASSWD
 
201
# undef GET_PVT_PASSWD
 
202
# undef SIGN_KEY
 
203
# undef SUBJECT_NAME
 
204
# undef TRUSTED_CERT
 
205
# undef MV_PARAMS
 
206
# undef MV_KEYS
 
207
#endif  /*  NO_OPTION_NAME_WARNINGS */
 
208
 
 
209
/*
 
210
 *  Interface defines for specific options.
 
211
 */
 
212
#ifdef OPENSSL
 
213
#define VALUE_OPT_CERTIFICATE    'c'
 
214
#endif /* OPENSSL */
 
215
#ifdef DEBUG
 
216
#define VALUE_OPT_DEBUG_LEVEL    'd'
 
217
#endif /* DEBUG */
 
218
#ifdef DEBUG
 
219
#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
 
220
#endif /* DEBUG */
 
221
#ifdef OPENSSL
 
222
#define VALUE_OPT_ID_KEY         'e'
 
223
#endif /* OPENSSL */
 
224
#ifdef OPENSSL
 
225
#define VALUE_OPT_GQ_PARAMS      'G'
 
226
#endif /* OPENSSL */
 
227
#ifdef OPENSSL
 
228
#define VALUE_OPT_GQ_KEYS        'g'
 
229
#endif /* OPENSSL */
 
230
#ifdef OPENSSL
 
231
#define VALUE_OPT_HOST_KEY       'H'
 
232
#endif /* OPENSSL */
 
233
#ifdef OPENSSL
 
234
#define VALUE_OPT_IFFKEY         'I'
 
235
#endif /* OPENSSL */
 
236
#ifdef OPENSSL
 
237
#define VALUE_OPT_ISSUER_NAME    'i'
 
238
#endif /* OPENSSL */
 
239
#define VALUE_OPT_MD5KEY         'M'
 
240
#ifdef OPENSSL
 
241
#define VALUE_OPT_MODULUS        'm'
 
242
#define OPT_VALUE_MODULUS        (DESC(MODULUS).optArg.argInt)
 
243
#endif /* OPENSSL */
 
244
#ifdef OPENSSL
 
245
#define VALUE_OPT_PVT_CERT       'P'
 
246
#endif /* OPENSSL */
 
247
#ifdef OPENSSL
 
248
#define VALUE_OPT_PVT_PASSWD     'p'
 
249
#endif /* OPENSSL */
 
250
#ifdef OPENSSL
 
251
#define VALUE_OPT_GET_PVT_PASSWD 'q'
 
252
#endif /* OPENSSL */
 
253
#ifdef OPENSSL
 
254
#define VALUE_OPT_SIGN_KEY       'S'
 
255
#endif /* OPENSSL */
 
256
#ifdef OPENSSL
 
257
#define VALUE_OPT_SUBJECT_NAME   's'
 
258
#endif /* OPENSSL */
 
259
#ifdef OPENSSL
 
260
#define VALUE_OPT_TRUSTED_CERT   'T'
 
261
#endif /* OPENSSL */
 
262
#ifdef OPENSSL
 
263
#define VALUE_OPT_MV_PARAMS      'V'
 
264
#define OPT_VALUE_MV_PARAMS      (DESC(MV_PARAMS).optArg.argInt)
 
265
#endif /* OPENSSL */
 
266
#ifdef OPENSSL
 
267
#define VALUE_OPT_MV_KEYS        'v'
 
268
#define OPT_VALUE_MV_KEYS        (DESC(MV_KEYS).optArg.argInt)
 
269
#endif /* OPENSSL */
 
270
 
 
271
#define VALUE_OPT_VERSION       'v'
 
272
#define VALUE_OPT_HELP          '?'
 
273
#define VALUE_OPT_MORE_HELP     '!'
 
274
#define VALUE_OPT_SAVE_OPTS     '>'
 
275
#define VALUE_OPT_LOAD_OPTS     '<'
 
276
#define SET_OPT_SAVE_OPTS(a)   STMTS( \
 
277
        DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
 
278
        DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
 
279
        DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
 
280
/*
 
281
 *  Interface defines not associated with particular options
 
282
 */
 
283
#define ERRSKIP_OPTERR  STMTS( ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP )
 
284
#define ERRSTOP_OPTERR  STMTS( ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP )
 
285
#define RESTART_OPT(n)  STMTS( \
 
286
                ntp_keygenOptions.curOptIdx = (n); \
 
287
                ntp_keygenOptions.pzCurOpt  = NULL )
 
288
#define START_OPT       RESTART_OPT(1)
 
289
#define USAGE(c)        (*ntp_keygenOptions.pUsageProc)( &ntp_keygenOptions, c )
 
290
/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
291
 
 
292
/* * * * * *
 
293
 *
 
294
 *  Declare the ntp-keygen option descriptor.
 
295
 */
 
296
#ifdef  __cplusplus
 
297
extern "C" {
 
298
#endif
 
299
 
 
300
extern tOptions   ntp_keygenOptions;
 
301
 
 
302
#ifndef _
 
303
#  if ENABLE_NLS
 
304
#    include <stdio.h>
 
305
     static inline char* aoGetsText( char const* pz ) {
 
306
         if (pz == NULL) return NULL;
 
307
         return (char*)gettext( pz );
 
308
     }
 
309
#    define _(s)  aoGetsText(s)
 
310
#  else  /* ENABLE_NLS */
 
311
#    define _(s)  s
 
312
#  endif /* ENABLE_NLS */
 
313
#endif
 
314
 
 
315
#ifdef  __cplusplus
 
316
}
 
317
#endif
 
318
#endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */
 
319
/* ntp-keygen-opts.h ends here */