2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2N/A/*
2N/A * include/krb5/adm.h
2N/A *
2N/A * Copyright 1995,2001,2009 by the Massachusetts Institute of Technology.
2N/A * All Rights Reserved.
2N/A *
2N/A * Export of this software from the United States of America may
2N/A * require a specific license from the United States Government.
2N/A * It is the responsibility of any person or organization contemplating
2N/A * export to obtain such a license before exporting.
2N/A *
2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
2N/A * distribute this software and its documentation for any purpose and
2N/A * without fee is hereby granted, provided that the above copyright
2N/A * notice appear in all copies and that both that copyright notice and
2N/A * this permission notice appear in supporting documentation, and that
2N/A * the name of M.I.T. not be used in advertising or publicity pertaining
2N/A * to distribution of the software without specific, written prior
2N/A * permission. Furthermore if you modify this software you must label
2N/A * your software as modified software and not distribute it in such a
2N/A * fashion that it might be confused with the original M.I.T. software.
2N/A * M.I.T. makes no representations about the suitability of
2N/A * this software for any purpose. It is provided "as is" without express
2N/A * or implied warranty.
2N/A *
2N/A */
2N/A#ifndef KRB5_ADM_H__
2N/A#define KRB5_ADM_H__
2N/A
2N/A/*
2N/A * Kerberos V5 Change Password service name
2N/A */
2N/A#define KRB5_ADM_SERVICE_NAME "kpasswd"
2N/A#define KRB5_ADM_DEFAULT_PORT 464
2N/A
2N/A#define KRB5_ADM_SERVICE_INSTANCE "changepw"
2N/A
2N/A/*
2N/A * Maximum password length.
2N/A */
2N/A#define KRB5_ADM_MAX_PASSWORD_LEN 512
2N/A
2N/A/*
2N/A * Protocol command strings.
2N/A */
2N/A#define KRB5_ADM_QUIT_CMD "QUIT"
2N/A#define KRB5_ADM_CHECKPW_CMD "CHECKPW"
2N/A#define KRB5_ADM_CHANGEPW_CMD "CHANGEPW"
2N/A#define KRB5_ADM_MOTD_CMD "MOTD"
2N/A#define KRB5_ADM_MIME_CMD "MIME"
2N/A#define KRB5_ADM_LANGUAGE_CMD "LANGUAGE"
2N/A
2N/A#define KRB5_ADM_ADD_PRINC_CMD "ADD-PRINCIPAL"
2N/A#define KRB5_ADM_DEL_PRINC_CMD "DELETE-PRINCIPAL"
2N/A#define KRB5_ADM_REN_PRINC_CMD "RENAME-PRINCIPAL"
2N/A#define KRB5_ADM_MOD_PRINC_CMD "MODIFY-PRINCIPAL"
2N/A#define KRB5_ADM_INQ_PRINC_CMD "INQUIRE-PRINCIPAL"
2N/A#define KRB5_ADM_EXT_KEY_CMD "EXTRACT-KEY"
2N/A
2N/A/*
2N/A * Protocol command strings for the current version of the admin
2N/A * server. (Chris had removed them in the version he was working
2N/A * with.)
2N/A *
2N/A * XXX I'm adding them back so the tree works. We need to take care
2N/A * of this eventually.
2N/A */
2N/A#define KRB5_ADM_CHG_OPW_CMD "OTHER-CHANGEPW"
2N/A#define KRB5_ADM_CHG_ORPW_CMD "OTHER-RANDOM-CHANGEPW"
2N/A#define KRB5_ADM_ADD_KEY_CMD "ADD-KEY"
2N/A#define KRB5_ADM_DEL_KEY_CMD "DELETE-KEY"
2N/A
2N/A/*
2N/A * Reply status values.
2N/A */
2N/A#define KRB5_ADM_SUCCESS 0
2N/A#define KRB5_ADM_CMD_UNKNOWN 1
2N/A#define KRB5_ADM_PW_UNACCEPT 2
2N/A#define KRB5_ADM_BAD_PW 3
2N/A#define KRB5_ADM_NOT_IN_TKT 4
2N/A#define KRB5_ADM_CANT_CHANGE 5
2N/A#define KRB5_ADM_LANG_NOT_SUPPORTED 6
2N/A
2N/A#define KRB5_ADM_P_ALREADY_EXISTS 64
2N/A#define KRB5_ADM_P_DOES_NOT_EXIST 65
2N/A#define KRB5_ADM_NOT_AUTHORIZED 66
2N/A#define KRB5_ADM_BAD_OPTION 67
2N/A#define KRB5_ADM_VALUE_REQUIRED 68
2N/A#define KRB5_ADM_SYSTEM_ERROR 69
2N/A#define KRB5_ADM_KEY_DOES_NOT_EXIST 70
2N/A#define KRB5_ADM_KEY_ALREADY_EXISTS 71
2N/A
2N/A/*
2N/A * Principal flag keywords.
2N/A */
2N/A/* Settable only */
2N/A#define KRB5_ADM_KW_PASSWORD "PASSWORD"
2N/A#define KRB5_ADM_KW_APASSWORD "APASSWORD"
2N/A#define KRB5_ADM_KW_RANDOMKEY "RANDOMKEY"
2N/A#define KRB5_ADM_KW_ARANDOMKEY "ARANDOMKEY"
2N/A#define KRB5_ADM_KW_SETFLAGS "SETFLAGS"
2N/A#define KRB5_ADM_KW_UNSETFLAGS "UNSETFLAGS"
2N/A/* Settable and retrievable */
2N/A#define KRB5_ADM_KW_MAXLIFE "MAXLIFE"
2N/A#define KRB5_ADM_KW_MAXRENEWLIFE "MAXRENEWLIFE"
2N/A#define KRB5_ADM_KW_EXPIRATION "EXPIRATION"
2N/A#define KRB5_ADM_KW_PWEXPIRATION "PWEXPIRATION"
2N/A#define KRB5_ADM_KW_FLAGS "FLAGS"
2N/A#define KRB5_ADM_KW_AUXDATA "AUXDATA"
2N/A#define KRB5_ADM_KW_EXTRADATA "EXTRADATA"
2N/A/* Retrievable only */
2N/A#define KRB5_ADM_KW_LASTPWCHANGE "LASTPWCHANGE"
2N/A#define KRB5_ADM_KW_LASTSUCCESS "LASTSUCCESS"
2N/A#define KRB5_ADM_KW_LASTFAILED "LASTFAILED"
2N/A#define KRB5_ADM_KW_FAILCOUNT "FAILCOUNT"
2N/A#define KRB5_ADM_KW_KEYDATA "KEYDATA"
2N/A
2N/A/* Valid mask */
2N/A#define KRB5_ADM_M_PASSWORD 0x00000001
2N/A#define KRB5_ADM_M_MAXLIFE 0x00000002
2N/A#define KRB5_ADM_M_MAXRENEWLIFE 0x00000004
2N/A#define KRB5_ADM_M_EXPIRATION 0x00000008
2N/A#define KRB5_ADM_M_PWEXPIRATION 0x00000010
2N/A#define KRB5_ADM_M_RANDOMKEY 0x00000020
2N/A#define KRB5_ADM_M_FLAGS 0x00000040
2N/A#define KRB5_ADM_M_LASTPWCHANGE 0x00000080
2N/A#define KRB5_ADM_M_LASTSUCCESS 0x00000100
2N/A#define KRB5_ADM_M_LASTFAILED 0x00000200
2N/A#define KRB5_ADM_M_FAILCOUNT 0x00000400
2N/A#define KRB5_ADM_M_AUXDATA 0x00000800
2N/A#define KRB5_ADM_M_KEYDATA 0x00001000
2N/A#define KRB5_ADM_M_APASSWORD 0x00002000
2N/A#define KRB5_ADM_M_ARANDOMKEY 0x00004000
2N/A#define KRB5_ADM_M_UNUSED_15 0x00008000
2N/A#define KRB5_ADM_M_UNUSED_16 0x00010000
2N/A#define KRB5_ADM_M_UNUSED_17 0x00020000
2N/A#define KRB5_ADM_M_UNUSED_18 0x00040000
2N/A#define KRB5_ADM_M_UNUSED_19 0x00080000
2N/A#define KRB5_ADM_M_UNUSED_20 0x00100000
2N/A#define KRB5_ADM_M_UNUSED_21 0x00200000
2N/A#define KRB5_ADM_M_UNUSED_22 0x00400000
2N/A#define KRB5_ADM_M_UNUSED_23 0x00800000
2N/A#define KRB5_ADM_M_UNUSED_24 0x01000000
2N/A#define KRB5_ADM_M_UNUSED_25 0x02000000
2N/A#define KRB5_ADM_M_UNUSED_26 0x04000000
2N/A#define KRB5_ADM_M_UNUSED_27 0x08000000
2N/A#define KRB5_ADM_M_UNUSED_28 0x10000000
2N/A#define KRB5_ADM_M_UNUSED_29 0x20000000
2N/A#define KRB5_ADM_M_GET 0x40000000
2N/A#define KRB5_ADM_M_SET 0x80000000
2N/A
2N/A#define KRB5_ADM_M_EXTRADATA 0x00000000 /* Hack to get */
2N/A /* libkadm to compile */
2N/A
2N/A#define KRB5_ADM_M_SET_VALID (KRB5_ADM_M_SET + \
2N/A KRB5_ADM_M_PASSWORD + \
2N/A KRB5_ADM_M_APASSWORD + \
2N/A KRB5_ADM_M_MAXLIFE + \
2N/A KRB5_ADM_M_MAXRENEWLIFE+ \
2N/A KRB5_ADM_M_EXPIRATION + \
2N/A KRB5_ADM_M_PWEXPIRATION+ \
2N/A KRB5_ADM_M_RANDOMKEY + \
2N/A KRB5_ADM_M_ARANDOMKEY + \
2N/A KRB5_ADM_M_FLAGS + \
2N/A KRB5_ADM_M_AUXDATA)
2N/A#define KRB5_ADM_M_GET_VALID (KRB5_ADM_M_GET + \
2N/A KRB5_ADM_M_MAXLIFE + \
2N/A KRB5_ADM_M_MAXRENEWLIFE+ \
2N/A KRB5_ADM_M_EXPIRATION + \
2N/A KRB5_ADM_M_PWEXPIRATION+ \
2N/A KRB5_ADM_M_FLAGS + \
2N/A KRB5_ADM_M_LASTPWCHANGE+ \
2N/A KRB5_ADM_M_LASTSUCCESS + \
2N/A KRB5_ADM_M_LASTFAILED + \
2N/A KRB5_ADM_M_FAILCOUNT + \
2N/A KRB5_ADM_M_AUXDATA + \
2N/A KRB5_ADM_M_KEYDATA)
2N/A
2N/A/*
2N/A * Keytab reply components.
2N/A */
2N/A#define KRB5_ADM_KT_PRINCIPAL 0
2N/A#define KRB5_ADM_KT_TIMESTAMP 1
2N/A#define KRB5_ADM_KT_VNO 2
2N/A#define KRB5_ADM_KT_KEY_ENCTYPE 3
2N/A#define KRB5_ADM_KT_KEY_KEY 4
2N/A#define KRB5_ADM_KT_NCOMPS 5
2N/A
2N/A/* for krb5_key_salt_tuple */
2N/A#include "kdb.h"
2N/A
2N/A/*
2N/A * Data structure returned by krb5_read_realm_params()
2N/A */
2N/Atypedef struct __krb5_realm_params {
2N/A char * realm_profile;
2N/A char * realm_dbname;
2N/A char * realm_mkey_name;
2N/A char * realm_stash_file;
2N/A char * realm_kdc_ports;
2N/A char * realm_kdc_tcp_ports;
2N/A char * realm_acl_file;
2N/A char * realm_host_based_services;
2N/A char * realm_no_host_referral;
2N/A krb5_int32 realm_kadmind_port;
2N/A krb5_enctype realm_enctype;
2N/A krb5_deltat realm_max_life;
2N/A krb5_deltat realm_max_rlife;
2N/A krb5_timestamp realm_expiration;
2N/A krb5_flags realm_flags;
2N/A krb5_key_salt_tuple *realm_keysalts;
2N/A unsigned int realm_reject_bad_transit:1;
2N/A unsigned int realm_kadmind_port_valid:1;
2N/A unsigned int realm_enctype_valid:1;
2N/A unsigned int realm_max_life_valid:1;
2N/A unsigned int realm_max_rlife_valid:1;
2N/A unsigned int realm_expiration_valid:1;
2N/A unsigned int realm_flags_valid:1;
2N/A unsigned int realm_reject_bad_transit_valid:1;
2N/A krb5_int32 realm_num_keysalts;
2N/A} krb5_realm_params;
2N/A#endif /* KRB5_ADM_H__ */