10Sstevel@tonic-gate /*
20Sstevel@tonic-gate * kdc/policy.c
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * Copyright 1990 by the Massachusetts Institute of Technology.
50Sstevel@tonic-gate *
60Sstevel@tonic-gate * Export of this software from the United States of America may
70Sstevel@tonic-gate * require a specific license from the United States Government.
80Sstevel@tonic-gate * It is the responsibility of any person or organization contemplating
90Sstevel@tonic-gate * export to obtain such a license before exporting.
100Sstevel@tonic-gate *
110Sstevel@tonic-gate * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
120Sstevel@tonic-gate * distribute this software and its documentation for any purpose and
130Sstevel@tonic-gate * without fee is hereby granted, provided that the above copyright
140Sstevel@tonic-gate * notice appear in all copies and that both that copyright notice and
150Sstevel@tonic-gate * this permission notice appear in supporting documentation, and that
160Sstevel@tonic-gate * the name of M.I.T. not be used in advertising or publicity pertaining
170Sstevel@tonic-gate * to distribution of the software without specific, written prior
180Sstevel@tonic-gate * permission. Furthermore if you modify this software you must label
190Sstevel@tonic-gate * your software as modified software and not distribute it in such a
200Sstevel@tonic-gate * fashion that it might be confused with the original M.I.T. software.
210Sstevel@tonic-gate * M.I.T. makes no representations about the suitability of
220Sstevel@tonic-gate * this software for any purpose. It is provided "as is" without express
230Sstevel@tonic-gate * or implied warranty.
240Sstevel@tonic-gate *
250Sstevel@tonic-gate *
260Sstevel@tonic-gate * Policy decision routines for KDC.
270Sstevel@tonic-gate */
280Sstevel@tonic-gate
290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
300Sstevel@tonic-gate
310Sstevel@tonic-gate
320Sstevel@tonic-gate #include "k5-int.h"
330Sstevel@tonic-gate #include "kdc_util.h"
340Sstevel@tonic-gate
350Sstevel@tonic-gate int
against_local_policy_as(register krb5_kdc_req * request,krb5_db_entry client,krb5_db_entry server,krb5_timestamp kdc_time,const char ** status)36*2881Smp153739 against_local_policy_as(register krb5_kdc_req *request, krb5_db_entry client,
37*2881Smp153739 krb5_db_entry server, krb5_timestamp kdc_time,
38*2881Smp153739 const char **status)
390Sstevel@tonic-gate {
400Sstevel@tonic-gate #if 0
410Sstevel@tonic-gate /* An AS request must include the addresses field */
420Sstevel@tonic-gate if (request->addresses == 0) {
430Sstevel@tonic-gate *status = "NO ADDRESS";
440Sstevel@tonic-gate return KRB5KDC_ERR_POLICY;
450Sstevel@tonic-gate }
460Sstevel@tonic-gate #endif
470Sstevel@tonic-gate
480Sstevel@tonic-gate return 0; /* not against policy */
490Sstevel@tonic-gate }
500Sstevel@tonic-gate
510Sstevel@tonic-gate /*
520Sstevel@tonic-gate * This is where local policy restrictions for the TGS should placed.
530Sstevel@tonic-gate */
540Sstevel@tonic-gate krb5_error_code
against_local_policy_tgs(register krb5_kdc_req * request,krb5_db_entry server,krb5_ticket * ticket,const char ** status)55*2881Smp153739 against_local_policy_tgs(register krb5_kdc_req *request, krb5_db_entry server,
56*2881Smp153739 krb5_ticket *ticket, const char **status)
570Sstevel@tonic-gate {
580Sstevel@tonic-gate #if 0
590Sstevel@tonic-gate /*
600Sstevel@tonic-gate * For example, if your site wants to disallow ticket forwarding,
610Sstevel@tonic-gate * you might do something like this:
620Sstevel@tonic-gate */
630Sstevel@tonic-gate
640Sstevel@tonic-gate if (isflagset(request->kdc_options, KDC_OPT_FORWARDED)) {
650Sstevel@tonic-gate *status = "FORWARD POLICY";
660Sstevel@tonic-gate return KRB5KDC_ERR_POLICY;
670Sstevel@tonic-gate }
680Sstevel@tonic-gate #endif
690Sstevel@tonic-gate
700Sstevel@tonic-gate return 0; /* not against policy */
710Sstevel@tonic-gate }
720Sstevel@tonic-gate
730Sstevel@tonic-gate
740Sstevel@tonic-gate
750Sstevel@tonic-gate
760Sstevel@tonic-gate
770Sstevel@tonic-gate
780Sstevel@tonic-gate
79