typedef krb5_int32 krb5_error_code;
typedef krb5_int32 krb5_deltat;
+typedef krb5_error_code krb5_magic;
+
typedef struct _krb5_data {
+ krb5_magic magic;
int length;
char *data;
} krb5_data;
#endif
typedef struct krb5_principal_data {
+ krb5_magic magic;
krb5_data realm;
krb5_data *data; /* An array of strings */
krb5_int32 length;
typedef krb5_pointer krb5_cc_cursor; /* cursor for sequential lookup */
typedef struct _krb5_ccache {
- struct _krb5_cc_ops *ops;
- krb5_pointer data;
+ krb5_magic magic;
+ struct _krb5_cc_ops *ops;
+ krb5_pointer data;
} *krb5_ccache;
typedef struct _krb5_cc_ops {
- char *prefix;
- char *(*get_name) NPROTOTYPE((krb5_ccache));
- krb5_error_code (*resolve) NPROTOTYPE((krb5_ccache *, char *));
- krb5_error_code (*gen_new) NPROTOTYPE((krb5_ccache *));
- krb5_error_code (*init) NPROTOTYPE((krb5_ccache, krb5_principal));
- krb5_error_code (*destroy) NPROTOTYPE((krb5_ccache));
- krb5_error_code (*close) NPROTOTYPE((krb5_ccache));
- krb5_error_code (*store) NPROTOTYPE((krb5_ccache, krb5_creds *));
- krb5_error_code (*retrieve) NPROTOTYPE((krb5_ccache, krb5_flags,
- krb5_creds *, krb5_creds *));
- krb5_error_code (*get_princ) NPROTOTYPE((krb5_ccache,
- krb5_principal *));
- krb5_error_code (*get_first) NPROTOTYPE((krb5_ccache,
- krb5_cc_cursor *));
- krb5_error_code (*get_next) NPROTOTYPE((krb5_ccache, krb5_cc_cursor *,
- krb5_creds *));
- krb5_error_code (*end_get) NPROTOTYPE((krb5_ccache, krb5_cc_cursor *));
- krb5_error_code (*remove_cred) NPROTOTYPE((krb5_ccache, krb5_flags,
- krb5_creds *));
- krb5_error_code (*set_flags) NPROTOTYPE((krb5_ccache, krb5_flags));
+ krb5_magic magic;
+ char *prefix;
+ char *(*get_name) NPROTOTYPE((krb5_ccache));
+ krb5_error_code (*resolve) NPROTOTYPE((krb5_ccache *, char *));
+ krb5_error_code (*gen_new) NPROTOTYPE((krb5_ccache *));
+ krb5_error_code (*init) NPROTOTYPE((krb5_ccache, krb5_principal));
+ krb5_error_code (*destroy) NPROTOTYPE((krb5_ccache));
+ krb5_error_code (*close) NPROTOTYPE((krb5_ccache));
+ krb5_error_code (*store) NPROTOTYPE((krb5_ccache, krb5_creds *));
+ krb5_error_code (*retrieve) NPROTOTYPE((krb5_ccache, krb5_flags,
+ krb5_creds *, krb5_creds *));
+ krb5_error_code (*get_princ) NPROTOTYPE((krb5_ccache,
+ krb5_principal *));
+ krb5_error_code (*get_first) NPROTOTYPE((krb5_ccache,
+ krb5_cc_cursor *));
+ krb5_error_code (*get_next) NPROTOTYPE((krb5_ccache, krb5_cc_cursor *,
+ krb5_creds *));
+ krb5_error_code (*end_get) NPROTOTYPE((krb5_ccache, krb5_cc_cursor *));
+ krb5_error_code (*remove_cred) NPROTOTYPE((krb5_ccache, krb5_flags,
+ krb5_creds *));
+ krb5_error_code (*set_flags) NPROTOTYPE((krb5_ccache, krb5_flags));
} krb5_cc_ops;
/* for retrieve_cred */
/*
- * Copyright (C) 1989-1992 by the Massachusetts Institute of Technology,
+ * Copyright (C) 1989-1994 by the Massachusetts Institute of Technology,
* Cambridge, MA, USA. All Rights Reserved.
*
* This software is being provided to you, the LICENSEE, by the
decrypted keys in the database */
typedef struct _krb5_encrypted_keyblock {
+ krb5_magic magic;
krb5_keytype keytype;
int length;
krb5_octet *contents;
} krb5_encrypted_keyblock;
+/*
+ * Note --- this structure cannot be modified without changing the
+ * database version number in libkdb.a
+ */
typedef struct _krb5_db_entry {
krb5_principal principal;
krb5_encrypted_keyblock key;
typedef krb5_pointer krb5_kt_cursor; /* XXX */
typedef struct krb5_keytab_entry_st {
+ krb5_magic magic;
krb5_principal principal; /* principal of this key */
krb5_timestamp timestamp; /* time entry written to keytable */
krb5_kvno vno; /* key version number */
typedef struct _krb5_kt {
- struct _krb5_kt_ops *ops;
- krb5_pointer data;
+ krb5_magic magic;
+ struct _krb5_kt_ops *ops;
+ krb5_pointer data;
} *krb5_keytab;
#include <krb5/widen.h>
typedef struct _krb5_kt_ops {
- char *prefix;
- /* routines always present */
- krb5_error_code (*resolve) NPROTOTYPE((char *,
- krb5_keytab *));
- krb5_error_code (*get_name) NPROTOTYPE((krb5_keytab,
- char *,
- int));
- krb5_error_code (*close) NPROTOTYPE((krb5_keytab));
- krb5_error_code (*get) NPROTOTYPE((krb5_keytab,
- krb5_principal,
- krb5_kvno,
+ krb5_magic magic;
+ char *prefix;
+ /* routines always present */
+ krb5_error_code (*resolve) NPROTOTYPE((char *,
+ krb5_keytab *));
+ krb5_error_code (*get_name) NPROTOTYPE((krb5_keytab,
+ char *,
+ int));
+ krb5_error_code (*close) NPROTOTYPE((krb5_keytab));
+ krb5_error_code (*get) NPROTOTYPE((krb5_keytab,
+ krb5_principal,
+ krb5_kvno,
+ krb5_keytab_entry *));
+ krb5_error_code (*start_seq_get) NPROTOTYPE((krb5_keytab,
+ krb5_kt_cursor *));
+ krb5_error_code (*get_next) NPROTOTYPE((krb5_keytab,
+ krb5_keytab_entry *,
+ krb5_kt_cursor *));
+ krb5_error_code (*end_get) NPROTOTYPE((krb5_keytab,
+ krb5_kt_cursor *));
+ /* routines to be included on extended version (write routines) */
+ krb5_error_code (*add) NPROTOTYPE((krb5_keytab,
+ krb5_keytab_entry *));
+ krb5_error_code (*remove) NPROTOTYPE((krb5_keytab,
krb5_keytab_entry *));
- krb5_error_code (*start_seq_get) NPROTOTYPE((krb5_keytab,
- krb5_kt_cursor *));
- krb5_error_code (*get_next) NPROTOTYPE((krb5_keytab,
- krb5_keytab_entry *,
- krb5_kt_cursor *));
- krb5_error_code (*end_get) NPROTOTYPE((krb5_keytab,
- krb5_kt_cursor *));
- /* routines to be included on extended version (write routines) */
- krb5_error_code (*add) NPROTOTYPE((krb5_keytab,
- krb5_keytab_entry *));
- krb5_error_code (*remove) NPROTOTYPE((krb5_keytab,
- krb5_keytab_entry *));
} krb5_kt_ops;
/* and back to narrow */
/* structure for auth data */
typedef struct _krb5_authdata {
+ krb5_magic magic;
krb5_authdatatype ad_type;
int length;
krb5_octet *contents;
/* structure for transited encoding */
typedef struct _krb5_transited {
+ krb5_magic magic;
krb5_octet tr_type;
krb5_data tr_contents;
} krb5_transited;
typedef struct _krb5_enc_tkt_part {
+ krb5_magic magic;
/* to-be-encrypted portion */
krb5_flags flags; /* flags */
krb5_keyblock *session; /* session key: includes keytype */
} krb5_enc_tkt_part;
typedef struct _krb5_ticket {
+ krb5_magic magic;
/* cleartext portion */
krb5_principal server; /* server name/realm */
krb5_enc_data enc_part; /* encryption type, kvno, encrypted
/* the unencrypted version */
typedef struct _krb5_authenticator {
+ krb5_magic magic;
krb5_principal client; /* client name/realm */
krb5_checksum *checksum; /* checksum, includes type, optional */
krb5_int32 cusec; /* client usec portion */
} krb5_authenticator;
typedef struct _krb5_tkt_authent {
+ krb5_magic magic;
krb5_ticket *ticket;
krb5_authenticator *authenticator;
krb5_flags ap_options;
/* credentials: Ticket, session key, etc. */
typedef struct _krb5_creds {
+ krb5_magic magic;
krb5_principal client; /* client's principal identifier */
krb5_principal server; /* server's principal identifier */
krb5_keyblock keyblock; /* session encryption key info */
/* Last request fields */
typedef struct _krb5_last_req_entry {
+ krb5_magic magic;
krb5_octet lr_type;
krb5_timestamp value;
} krb5_last_req_entry;
/* pre-authentication data */
typedef struct _krb5_pa_data {
+ krb5_magic magic;
krb5_ui_2 pa_type;
int length;
krb5_octet *contents;
} krb5_pa_data;
typedef struct _krb5_kdc_req {
+ krb5_magic magic;
krb5_msgtype msg_type; /* AS_REQ or TGS_REQ? */
krb5_pa_data **padata; /* e.g. encoded AP_REQ */
/* real body */
} krb5_kdc_req;
typedef struct _krb5_enc_kdc_rep_part {
+ krb5_magic magic;
/* encrypted part: */
krb5_msgtype msg_type; /* krb5 message type */
krb5_keyblock *session; /* session key */
} krb5_enc_kdc_rep_part;
typedef struct _krb5_kdc_rep {
+ krb5_magic magic;
/* cleartext part: */
krb5_msgtype msg_type; /* AS_REP or KDC_REP? */
krb5_pa_data **padata; /* preauthentication data from KDC */
/* error message structure */
typedef struct _krb5_error {
+ krb5_magic magic;
/* some of these may be meaningless in certain contexts */
krb5_timestamp ctime; /* client sec portion; optional */
krb5_int32 cusec; /* client usec portion; optional */
} krb5_error;
typedef struct _krb5_ap_req {
+ krb5_magic magic;
krb5_flags ap_options; /* requested options */
krb5_ticket *ticket; /* ticket */
krb5_enc_data authenticator; /* authenticator (already encrypted) */
} krb5_ap_req;
typedef struct _krb5_ap_rep {
+ krb5_magic magic;
krb5_enc_data enc_part;
} krb5_ap_rep;
typedef struct _krb5_ap_rep_enc_part {
+ krb5_magic magic;
krb5_timestamp ctime; /* client time, seconds portion */
krb5_int32 cusec; /* client time, microseconds portion */
krb5_keyblock *subkey; /* true session key, optional */
} krb5_ap_rep_enc_part;
typedef struct _krb5_response {
+ krb5_magic magic;
krb5_octet message_type;
krb5_data response;
} krb5_response;
typedef struct _krb5_safe {
+ krb5_magic magic;
krb5_data user_data; /* user data */
krb5_timestamp timestamp; /* client time, optional */
krb5_int32 usec; /* microsecond portion of time,
} krb5_safe;
typedef struct _krb5_priv {
+ krb5_magic magic;
krb5_enc_data enc_part; /* encrypted part */
} krb5_priv;
typedef struct _krb5_priv_enc_part {
+ krb5_magic magic;
krb5_data user_data; /* user data */
krb5_timestamp timestamp; /* client time, optional */
krb5_int32 usec; /* microsecond portion of time, opt. */
} krb5_priv_enc_part;
typedef struct _krb5_cred {
+ krb5_magic magic;
krb5_ticket **tickets; /* tickets */
krb5_enc_data enc_part; /* encrypted part */
} krb5_cred;
typedef struct _krb5_cred_info {
+ krb5_magic magic;
krb5_keyblock* session; /* session key used to encrypt */
/* ticket */
krb5_principal client; /* client name/realm, optional */
} krb5_cred_info;
typedef struct _krb5_cred_enc_part {
+ krb5_magic magic;
krb5_int32 nonce; /* nonce, optional */
krb5_timestamp timestamp; /* client time */
krb5_int32 usec; /* microsecond portion of time */
/* Sandia password generation structures */
typedef struct _passwd_phrase_element {
+ krb5_magic magic;
krb5_data *passwd;
krb5_data *phrase;
} passwd_phrase_element;
typedef struct _krb5_pwd_data {
+ krb5_magic magic;
int sequence_count;
passwd_phrase_element **element;
} krb5_pwd_data;
krb5_data *data));
typedef struct _krb5_preauth_ops {
- int type;
- int flags;
- krb5_preauth_obtain_proc *obtain;
- krb5_preauth_verify_proc *verify;
+ krb5_magic magic;
+ int type;
+ int flags;
+ krb5_preauth_obtain_proc *obtain;
+ krb5_preauth_verify_proc *verify;
} krb5_preauth_ops;
/*
#define KRB5_RCACHE__
typedef struct krb5_rc_st {
+ krb5_magic magic;
struct _krb5_rc_ops *ops;
krb5_pointer data;
} *krb5_rcache;
typedef struct _krb5_donot_replay {
+ krb5_magic magic;
char *server; /* null-terminated */
char *client; /* null-terminated */
krb5_int32 cusec;
} krb5_donot_replay;
typedef struct _krb5_rc_ops {
+ krb5_magic magic;
char *type;
krb5_error_code (*init)NPROTOTYPE((krb5_rcache,krb5_deltat)); /* create */
krb5_error_code (*recover)NPROTOTYPE((krb5_rcache)); /* open */