policy.h revision 1.11
1/*	$OpenBSD: policy.h,v 1.11 2003/05/14 18:10:30 ho Exp $	*/
2/*	$EOM: policy.h,v 1.12 2000/09/28 12:53:27 niklas Exp $ */
3
4/*
5 * Copyright (c) 1999, 2000 Angelos D. Keromytis.  All rights reserved.
6 * Copyright (c) 2000 Niklas Hallqvist.  All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 *    must display the following acknowledgement:
18 *	This product includes software developed by Ericsson Radio Systems.
19 * 4. The name of the author may not be used to endorse or promote products
20 *    derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/*
35 * This code was written under funding by Ericsson Radio Systems.
36 */
37
38#ifndef _POLICY_H_
39#define _POLICY_H_
40
41#if defined (USE_KEYNOTE)
42#define CREDENTIAL_FILE "credentials"
43#define PRIVATE_KEY_FILE "private_key"
44#endif
45
46extern int keynote_sessid;
47extern int keynote_policy_asserts_num;
48extern int x509_policy_asserts_num;
49extern int x509_policy_asserts_num_alloc;
50extern char **keynote_policy_asserts;
51extern char **x509_policy_asserts;
52extern struct exchange *policy_exchange;
53extern struct sa *policy_sa;
54extern struct sa *policy_isakmp_sa;
55
56extern void policy_init (void);
57extern char *policy_callback (char *);
58extern int keynote_cert_init (void);
59extern void *keynote_cert_get (u_int8_t *, u_int32_t);
60extern int keynote_cert_validate (void *);
61extern int keynote_cert_insert (int, void *);
62extern void keynote_cert_free (void *);
63extern int keynote_certreq_validate (u_int8_t *, u_int32_t);
64extern void *keynote_certreq_decode (u_int8_t *, u_int32_t);
65extern void keynote_free_aca (void *);
66extern int keynote_cert_obtain (u_int8_t *, size_t, void *,
67				u_int8_t **, u_int32_t *);
68extern int keynote_cert_get_subjects (void *, int *, u_int8_t ***,
69				      u_int32_t **);
70extern int keynote_cert_get_key (void *, void *);
71extern void *keynote_cert_dup (void *);
72extern void keynote_serialize (void *, u_int8_t **, u_int32_t *);
73extern char *keynote_printable (void *);
74extern void *keynote_from_printable (char *);
75#endif /* _POLICY_H_ */
76