3a16ee5cca3063e2cb736829c789d09be3718fd1
[krb5.git] / src / include / krb5 / preauth.h
1 /*
2  * include/krb5/preauth.h
3  *
4  * (Originally written by Glen Machin at Sandia Labs.)
5  *
6  * Copyright 1992, 1995 by the Massachusetts Institute of Technology.
7  * All Rights Reserved.
8  *
9  * Export of this software from the United States of America may
10  *   require a specific license from the United States Government.
11  *   It is the responsibility of any person or organization contemplating
12  *   export to obtain such a license before exporting.
13  *
14  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
15  * distribute this software and its documentation for any purpose and
16  * without fee is hereby granted, provided that the above copyright
17  * notice appear in all copies and that both that copyright notice and
18  * this permission notice appear in supporting documentation, and that
19  * the name of M.I.T. not be used in advertising or publicity pertaining
20  * to distribution of the software without specific, written prior
21  * permission.  M.I.T. makes no representations about the suitability of
22  * this software for any purpose.  It is provided "as is" without express
23  * or implied warranty.
24  *
25  * Sandia National Laboratories also makes no representations about the 
26  * suitability of the modifications, or additions to this software for 
27  * any purpose.  It is provided "as is" without express or implied warranty.
28  * 
29  */
30 #ifndef KRB5_PREAUTH__
31 #define KRB5_PREAUTH__
32
33 #define MAX_PREAUTH_SIZE 20     /* Maximum size of PreAuthenticator.data */
34
35 /*
36  * Note: these typedefs are subject to change.... [tytso:19920903.1609EDT]
37  */
38 typedef krb5_error_code (INTERFACE krb5_preauth_obtain_proc)
39     PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr,
40                krb5_pa_data *pa_data));
41
42 typedef krb5_error_code (INTERFACE krb5_preauth_verify_proc)
43     PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr,
44                krb5_data *data));
45
46 typedef struct _krb5_preauth_ops {
47     krb5_magic magic;
48     int     type;
49     int flags;
50     krb5_preauth_obtain_proc    *obtain;
51     krb5_preauth_verify_proc    *verify;
52 } krb5_preauth_ops;
53
54 /*
55  * Preauthentication property flags
56  */
57 #define KRB5_PREAUTH_FLAGS_ENCRYPT      0x00000001
58 #define KRB5_PREAUTH_FLAGS_HARDWARE     0x00000002
59
60 #if 0
61 krb5_error_code get_random_padata
62     PROTOTYPE((krb5_principal client, krb5_address **src_addr,
63                krb5_pa_data *data));
64
65 krb5_error_code verify_random_padata
66     PROTOTYPE((krb5_principal client, krb5_address **src_addr,
67                krb5_data *data));
68 #endif
69
70 krb5_error_code INTERFACE get_unixtime_padata
71     PROTOTYPE((krb5_context, krb5_principal client, 
72                krb5_address **src_addr, krb5_pa_data *data));
73
74 krb5_error_code INTERFACE verify_unixtime_padata
75     PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr,
76                krb5_data *data));
77
78 krb5_error_code INTERFACE get_securid_padata
79     PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr,
80                krb5_pa_data *data));
81
82 krb5_error_code INTERFACE verify_securid_padata
83     PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr,
84                krb5_data *data));
85
86 #endif /* KRB5_PREAUTH__ */