17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate * kdc/policy.c
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * Copyright 1990 by the Massachusetts Institute of Technology.
57c478bd9Sstevel@tonic-gate *
67c478bd9Sstevel@tonic-gate * Export of this software from the United States of America may
77c478bd9Sstevel@tonic-gate * require a specific license from the United States Government.
87c478bd9Sstevel@tonic-gate * It is the responsibility of any person or organization contemplating
97c478bd9Sstevel@tonic-gate * export to obtain such a license before exporting.
107c478bd9Sstevel@tonic-gate *
117c478bd9Sstevel@tonic-gate * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
127c478bd9Sstevel@tonic-gate * distribute this software and its documentation for any purpose and
137c478bd9Sstevel@tonic-gate * without fee is hereby granted, provided that the above copyright
147c478bd9Sstevel@tonic-gate * notice appear in all copies and that both that copyright notice and
157c478bd9Sstevel@tonic-gate * this permission notice appear in supporting documentation, and that
167c478bd9Sstevel@tonic-gate * the name of M.I.T. not be used in advertising or publicity pertaining
177c478bd9Sstevel@tonic-gate * to distribution of the software without specific, written prior
187c478bd9Sstevel@tonic-gate * permission. Furthermore if you modify this software you must label
197c478bd9Sstevel@tonic-gate * your software as modified software and not distribute it in such a
207c478bd9Sstevel@tonic-gate * fashion that it might be confused with the original M.I.T. software.
217c478bd9Sstevel@tonic-gate * M.I.T. makes no representations about the suitability of
227c478bd9Sstevel@tonic-gate * this software for any purpose. It is provided "as is" without express
237c478bd9Sstevel@tonic-gate * or implied warranty.
247c478bd9Sstevel@tonic-gate *
257c478bd9Sstevel@tonic-gate *
267c478bd9Sstevel@tonic-gate * Policy decision routines for KDC.
277c478bd9Sstevel@tonic-gate */
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gate #include "k5-int.h"
337c478bd9Sstevel@tonic-gate #include "kdc_util.h"
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@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*56a424ccSmp153739 against_local_policy_as(register krb5_kdc_req *request, krb5_db_entry client,
37*56a424ccSmp153739 krb5_db_entry server, krb5_timestamp kdc_time,
38*56a424ccSmp153739 const char **status)
397c478bd9Sstevel@tonic-gate {
407c478bd9Sstevel@tonic-gate #if 0
417c478bd9Sstevel@tonic-gate /* An AS request must include the addresses field */
427c478bd9Sstevel@tonic-gate if (request->addresses == 0) {
437c478bd9Sstevel@tonic-gate *status = "NO ADDRESS";
447c478bd9Sstevel@tonic-gate return KRB5KDC_ERR_POLICY;
457c478bd9Sstevel@tonic-gate }
467c478bd9Sstevel@tonic-gate #endif
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gate return 0; /* not against policy */
497c478bd9Sstevel@tonic-gate }
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gate /*
527c478bd9Sstevel@tonic-gate * This is where local policy restrictions for the TGS should placed.
537c478bd9Sstevel@tonic-gate */
547c478bd9Sstevel@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*56a424ccSmp153739 against_local_policy_tgs(register krb5_kdc_req *request, krb5_db_entry server,
56*56a424ccSmp153739 krb5_ticket *ticket, const char **status)
577c478bd9Sstevel@tonic-gate {
587c478bd9Sstevel@tonic-gate #if 0
597c478bd9Sstevel@tonic-gate /*
607c478bd9Sstevel@tonic-gate * For example, if your site wants to disallow ticket forwarding,
617c478bd9Sstevel@tonic-gate * you might do something like this:
627c478bd9Sstevel@tonic-gate */
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate if (isflagset(request->kdc_options, KDC_OPT_FORWARDED)) {
657c478bd9Sstevel@tonic-gate *status = "FORWARD POLICY";
667c478bd9Sstevel@tonic-gate return KRB5KDC_ERR_POLICY;
677c478bd9Sstevel@tonic-gate }
687c478bd9Sstevel@tonic-gate #endif
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate return 0; /* not against policy */
717c478bd9Sstevel@tonic-gate }
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gate
79