xref: /titanic_44/usr/src/cmd/krb5/krb5kdc/policy.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * kdc/policy.c
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * Copyright 1990 by the Massachusetts Institute of Technology.
5*7c478bd9Sstevel@tonic-gate  *
6*7c478bd9Sstevel@tonic-gate  * Export of this software from the United States of America may
7*7c478bd9Sstevel@tonic-gate  *   require a specific license from the United States Government.
8*7c478bd9Sstevel@tonic-gate  *   It is the responsibility of any person or organization contemplating
9*7c478bd9Sstevel@tonic-gate  *   export to obtain such a license before exporting.
10*7c478bd9Sstevel@tonic-gate  *
11*7c478bd9Sstevel@tonic-gate  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
12*7c478bd9Sstevel@tonic-gate  * distribute this software and its documentation for any purpose and
13*7c478bd9Sstevel@tonic-gate  * without fee is hereby granted, provided that the above copyright
14*7c478bd9Sstevel@tonic-gate  * notice appear in all copies and that both that copyright notice and
15*7c478bd9Sstevel@tonic-gate  * this permission notice appear in supporting documentation, and that
16*7c478bd9Sstevel@tonic-gate  * the name of M.I.T. not be used in advertising or publicity pertaining
17*7c478bd9Sstevel@tonic-gate  * to distribution of the software without specific, written prior
18*7c478bd9Sstevel@tonic-gate  * permission.  Furthermore if you modify this software you must label
19*7c478bd9Sstevel@tonic-gate  * your software as modified software and not distribute it in such a
20*7c478bd9Sstevel@tonic-gate  * fashion that it might be confused with the original M.I.T. software.
21*7c478bd9Sstevel@tonic-gate  * M.I.T. makes no representations about the suitability of
22*7c478bd9Sstevel@tonic-gate  * this software for any purpose.  It is provided "as is" without express
23*7c478bd9Sstevel@tonic-gate  * or implied warranty.
24*7c478bd9Sstevel@tonic-gate  *
25*7c478bd9Sstevel@tonic-gate  *
26*7c478bd9Sstevel@tonic-gate  * Policy decision routines for KDC.
27*7c478bd9Sstevel@tonic-gate  */
28*7c478bd9Sstevel@tonic-gate 
29*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #include "k5-int.h"
33*7c478bd9Sstevel@tonic-gate #include "kdc_util.h"
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate int
36*7c478bd9Sstevel@tonic-gate against_local_policy_as(request, client, server, kdc_time, status)
37*7c478bd9Sstevel@tonic-gate register krb5_kdc_req *request;
38*7c478bd9Sstevel@tonic-gate krb5_db_entry client;
39*7c478bd9Sstevel@tonic-gate krb5_db_entry server;
40*7c478bd9Sstevel@tonic-gate krb5_timestamp kdc_time;
41*7c478bd9Sstevel@tonic-gate const char	**status;
42*7c478bd9Sstevel@tonic-gate {
43*7c478bd9Sstevel@tonic-gate #if 0
44*7c478bd9Sstevel@tonic-gate      /* An AS request must include the addresses field */
45*7c478bd9Sstevel@tonic-gate     if (request->addresses == 0) {
46*7c478bd9Sstevel@tonic-gate 	*status = "NO ADDRESS";
47*7c478bd9Sstevel@tonic-gate 	return KRB5KDC_ERR_POLICY;
48*7c478bd9Sstevel@tonic-gate     }
49*7c478bd9Sstevel@tonic-gate #endif
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate     return 0;			/* not against policy */
52*7c478bd9Sstevel@tonic-gate }
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate /*
55*7c478bd9Sstevel@tonic-gate  * This is where local policy restrictions for the TGS should placed.
56*7c478bd9Sstevel@tonic-gate  */
57*7c478bd9Sstevel@tonic-gate krb5_error_code
58*7c478bd9Sstevel@tonic-gate against_local_policy_tgs(request, server, ticket, status)
59*7c478bd9Sstevel@tonic-gate register krb5_kdc_req *request;
60*7c478bd9Sstevel@tonic-gate krb5_db_entry server;
61*7c478bd9Sstevel@tonic-gate krb5_ticket *ticket;
62*7c478bd9Sstevel@tonic-gate const char **status;
63*7c478bd9Sstevel@tonic-gate {
64*7c478bd9Sstevel@tonic-gate #if 0
65*7c478bd9Sstevel@tonic-gate     /*
66*7c478bd9Sstevel@tonic-gate      * For example, if your site wants to disallow ticket forwarding,
67*7c478bd9Sstevel@tonic-gate      * you might do something like this:
68*7c478bd9Sstevel@tonic-gate      */
69*7c478bd9Sstevel@tonic-gate 
70*7c478bd9Sstevel@tonic-gate     if (isflagset(request->kdc_options, KDC_OPT_FORWARDED)) {
71*7c478bd9Sstevel@tonic-gate 	*status = "FORWARD POLICY";
72*7c478bd9Sstevel@tonic-gate 	return KRB5KDC_ERR_POLICY;
73*7c478bd9Sstevel@tonic-gate     }
74*7c478bd9Sstevel@tonic-gate #endif
75*7c478bd9Sstevel@tonic-gate 
76*7c478bd9Sstevel@tonic-gate     return 0;				/* not against policy */
77*7c478bd9Sstevel@tonic-gate }
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate 
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate 
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate 
85