Path: blob/main/crypto/krb5/src/windows/include/leashwin.h
34907 views
#ifndef __LEASHWIN__1#define __LEASHWIN__23////Is this sufficient?4#include <krb5.h>5#define ANAME_SZ 406#define REALM_SZ 407#define SNAME_SZ 408#define INST_SZ 409/* include space for '.' and '@' */10#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2)1112#define DLGTYPE_PASSWD 013#define DLGTYPE_CHPASSWD 114#define DLGTYPE_MASK 0x0000ffff15#define DLGFLAG_READONLYPRINC 0x1000016typedef struct {17int dlgtype;18// Tells whether dialog box is in change pwd more or init ticket mode???19// (verify this):20int dlgstatemax; // What is this???21// The title on the Dialog box - for Renewing or Initializing:22LPSTR title;23LPSTR principal;24} LSH_DLGINFO, FAR *LPLSH_DLGINFO;2526#define LEASH_USERNAME_SZ 6427#define LEASH_REALM_SZ 19228#define LEASH_TITLE_SZ 12829#define LEASH_CCACHE_NAME_SZ 2643031typedef struct {32DWORD size;33int dlgtype;34// Tells whether dialog box is in change pwd mode or init ticket mode35LPSTR title; // in v3, set to in.title36LPSTR username; // in v3, set to in.username37LPSTR realm; // in v3, set to in.realm38int use_defaults;39int forwardable;40int noaddresses;41int lifetime;42int renew_till;43int proxiable;44int publicip;45// Version 1 of this structure ends here46struct {47char username[LEASH_USERNAME_SZ];48char realm[LEASH_REALM_SZ];49// Version 2 of this structure ends here50char ccache[LEASH_CCACHE_NAME_SZ];51} out;52struct {53char title[LEASH_TITLE_SZ];54char username[LEASH_USERNAME_SZ];55char realm[LEASH_REALM_SZ];56char ccache[LEASH_CCACHE_NAME_SZ];57} in;58} LSH_DLGINFO_EX, *LPLSH_DLGINFO_EX;5960#define LSH_DLGINFO_EX_V1_SZ (sizeof(DWORD) + 3 * sizeof(LPSTR) + 8 * sizeof(int))61#define LSH_DLGINFO_EX_V2_SZ (LSH_DLGINFO_EX_V1_SZ + LEASH_USERNAME_SZ + LEASH_REALM_SZ)62#define LSH_DLGINFO_EX_V3_SZ (LSH_DLGINFO_EX_V2_SZ + LEASH_TITLE_SZ + LEASH_USERNAME_SZ + LEASH_REALM_SZ + 2 * LEASH_CCACHE_NAME_SZ)6364#ifndef NETIDMGR65#define NETID_USERNAME_SZ 12866#define NETID_REALM_SZ 19267#define NETID_TITLE_SZ 25668#define NETID_CCACHE_NAME_SZ 2646970#define NETID_DLGTYPE_TGT 071#define NETID_DLGTYPE_CHPASSWD 172typedef struct {73DWORD size;74DWORD dlgtype;75// Tells whether dialog box is in change pwd mode or init ticket mode76struct {77WCHAR title[NETID_TITLE_SZ];78WCHAR username[NETID_USERNAME_SZ];79WCHAR realm[NETID_REALM_SZ];80WCHAR ccache[NETID_CCACHE_NAME_SZ];81DWORD use_defaults;82DWORD forwardable;83DWORD noaddresses;84DWORD lifetime;85DWORD renew_till;86DWORD proxiable;87DWORD publicip;88DWORD must_use_specified_principal;89} in;90struct {91WCHAR username[NETID_USERNAME_SZ];92WCHAR realm[NETID_REALM_SZ];93WCHAR ccache[NETID_CCACHE_NAME_SZ];94} out;95// Version 1 of this structure ends here96} NETID_DLGINFO, *LPNETID_DLGINFO;9798#define NETID_DLGINFO_V1_SZ (10 * sizeof(DWORD) \99+ sizeof(WCHAR) * (NETID_TITLE_SZ + \1002 * NETID_USERNAME_SZ + 2 * NETID_REALM_SZ + \1012 * NETID_CCACHE_NAME_SZ))102#endif /* NETIDMGR */103104typedef struct TicketList TicketList;105struct TicketList {106TicketList *next;107char *service;108char *encTypes;109time_t issued;110time_t valid_until;111time_t renew_until;112unsigned long flags;113};114115typedef struct TICKETINFO TICKETINFO;116struct TICKETINFO {117TICKETINFO *next;118char *principal; /* Principal name/instance@realm */119char *ccache_name;120TicketList *ticket_list;121int btickets; /* Do we have tickets? */122time_t issued; /* The issue time */123time_t valid_until; /* */124time_t renew_until; /* The Renew time (k5 only) */125unsigned long flags;126};127128#ifdef __cplusplus129extern "C" {130#endif131132int FAR Leash_kinit_dlg(HWND hParent, LPLSH_DLGINFO lpdlginfo);133int FAR Leash_kinit_dlg_ex(HWND hParent, LPLSH_DLGINFO_EX lpdlginfoex);134int FAR Leash_changepwd_dlg(HWND hParent, LPLSH_DLGINFO lpdlginfo);135int FAR Leash_changepwd_dlg_ex(HWND hParent, LPLSH_DLGINFO_EX lpdlginfo);136137long FAR Leash_checkpwd(char *principal, char *password);138long FAR Leash_changepwd(char *principal, char *password, char *newpassword, char** result_string);139long FAR Leash_kinit(char *principal, char *password, int lifetime);140long FAR Leash_kinit_ex(char * principal, char * password, int lifetime,141int forwardable, int proxiable, int renew_life,142int addressless, unsigned long publicIP);143144long FAR Leash_klist(HWND hlist, TICKETINFO FAR *ticketinfo);145long FAR Leash_kdestroy(void);146long FAR Leash_get_lsh_errno( LONG FAR *err_val);147148long FAR Leash_renew(void);149long FAR Leash_importable(void);150long FAR Leash_import(void);151152BOOL Leash_set_help_file( char FAR *szHelpFile );153LPSTR Leash_get_help_file(void);154155void Leash_reset_defaults(void);156157#define NO_TICKETS 0158#define EXPD_TICKETS 2159#define GOOD_TICKETS 1160161/* Leash Configuration functions - alters Current User Registry */162DWORD Leash_get_default_lifetime(void);163DWORD Leash_set_default_lifetime(DWORD minutes);164DWORD Leash_reset_default_lifetime(void);165DWORD Leash_get_default_renew_till(void);166DWORD Leash_set_default_renew_till(DWORD minutes);167DWORD Leash_reset_default_renew_till(void);168DWORD Leash_get_default_renewable(void);169DWORD Leash_set_default_renewable(DWORD onoff);170DWORD Leash_reset_default_renewable(void);171DWORD Leash_get_default_forwardable(void);172DWORD Leash_set_default_forwardable(DWORD onoff);173DWORD Leash_reset_default_forwardable(void);174DWORD Leash_get_default_noaddresses(void);175DWORD Leash_set_default_noaddresses(DWORD onoff);176DWORD Leash_reset_default_noaddresses(void);177DWORD Leash_get_default_proxiable(void);178DWORD Leash_set_default_proxiable(DWORD onoff);179DWORD Leash_reset_default_proxiable(void);180DWORD Leash_get_default_publicip(void);181DWORD Leash_set_default_publicip(DWORD ipv4addr);182DWORD Leash_reset_default_publicip(void);183DWORD Leash_get_hide_kinit_options(void);184DWORD Leash_set_hide_kinit_options(DWORD onoff);185DWORD Leash_reset_hide_kinit_options(void);186DWORD Leash_get_default_life_min(void);187DWORD Leash_set_default_life_min(DWORD minutes);188DWORD Leash_reset_default_life_min(void);189DWORD Leash_get_default_life_max(void);190DWORD Leash_set_default_life_max(DWORD minutes);191DWORD Leash_reset_default_life_max(void);192DWORD Leash_get_default_renew_min(void);193DWORD Leash_set_default_renew_min(DWORD minutes);194DWORD Leash_reset_default_renew_min(void);195DWORD Leash_get_default_renew_max(void);196DWORD Leash_set_default_renew_max(DWORD minutes);197DWORD Leash_reset_default_renew_max(void);198DWORD Leash_get_default_uppercaserealm(void);199DWORD Leash_set_default_uppercaserealm(DWORD onoff);200DWORD Leash_reset_default_uppercaserealm(void);201DWORD Leash_get_default_mslsa_import(void);202DWORD Leash_set_default_mslsa_import(DWORD onoffmatch);203DWORD Leash_reset_default_mslsa_import(void);204DWORD Leash_get_default_preserve_kinit_settings(void);205DWORD Leash_set_default_preserve_kinit_settings(DWORD onoff);206DWORD Leash_reset_default_preserve_kinit_settings(void);207#ifdef __cplusplus208}209#endif210211#endif /* LEASHWIN */212213214