OpenAFS
OpenAFS distributed network file system
|
00001 00002 /* 00003 * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute 00004 * of Technology. 00005 * 00006 * For copying and distribution information, please see the file 00007 * <mit-copyright.h>. 00008 * 00009 * Include file with authentication protocol information. 00010 */ 00011 00012 #ifndef PROT_DEFS 00013 #define PROT_DEFS 00014 00015 #define KRB_PORT 750 /* PC's don't have /etc/services */ 00016 #define KRB5_PORT 88 /* PC's don't have /etc/services */ 00017 #define KRB_PROT_VERSION 4 00018 #define MAX_PKT_LEN 1000 00019 #define MAX_TXT_LEN 1000 00020 #define TICKET_GRANTING_TICKET "krbtgt" 00021 00022 /* Macro's to obtain various fields from a packet */ 00023 00024 #define pkt_version(packet) (unsigned int) *(packet->dat) 00025 #define pkt_msg_type(packet) (unsigned int) *(packet->dat+1) 00026 #define pkt_a_name(packet) (packet->dat+2) 00027 #define pkt_a_inst(packet) \ 00028 (packet->dat+3+strlen((char *)pkt_a_name(packet))) 00029 #define pkt_a_realm(packet) \ 00030 (pkt_a_inst(packet)+1+strlen((char *)pkt_a_inst(packet))) 00031 00032 /* Macro to obtain realm from application request */ 00033 #define apreq_realm(auth) (auth->dat + 3) 00034 00035 #define pkt_time_ws(packet) (char *) \ 00036 (packet->dat+5+strlen((char *)pkt_a_name(packet)) + \ 00037 strlen((char *)pkt_a_inst(packet)) + \ 00038 strlen((char *)pkt_a_realm(packet))) 00039 00040 #define pkt_no_req(packet) (unsigned short) \ 00041 *(packet->dat+9+strlen((char *)pkt_a_name(packet)) + \ 00042 strlen((char *)pkt_a_inst(packet)) + \ 00043 strlen((char *)pkt_a_realm(packet))) 00044 #define pkt_x_date(packet) (char *) \ 00045 (packet->dat+10+strlen((char *)pkt_a_name(packet)) + \ 00046 strlen((char *)pkt_a_inst(packet)) + \ 00047 strlen((char *)pkt_a_realm(packet))) 00048 #define pkt_err_code(packet) ( (char *) \ 00049 (packet->dat+9+strlen((char *)pkt_a_name(packet)) + \ 00050 strlen((char *)pkt_a_inst(packet)) + \ 00051 strlen((char *)pkt_a_realm(packet)))) 00052 #define pkt_err_text(packet) \ 00053 (packet->dat+13+strlen((char *)pkt_a_name(packet)) + \ 00054 strlen((char *)pkt_a_inst(packet)) + \ 00055 strlen((char *)pkt_a_realm(packet))) 00056 00057 /* Routines to create and read packets may be found in prot.c */ 00058 00059 /* KTEXT create_auth_reply(); *//* removed 890221 */ 00060 /* KTEXT create_death_packet(); *//* removed 890221 */ 00061 /* KTEXT pkt_cipher(); *//* removed 890221 */ 00062 00063 /* Message types , always leave lsb for byte order */ 00064 00065 #define AUTH_MSG_KDC_REQUEST 1<<1 00066 #define AUTH_MSG_KDC_REPLY 2<<1 00067 #define AUTH_MSG_APPL_REQUEST 3<<1 00068 #define AUTH_MSG_APPL_REQUEST_MUTUAL 4<<1 00069 #define AUTH_MSG_ERR_REPLY 5<<1 00070 #define AUTH_MSG_PRIVATE 6<<1 00071 #define AUTH_MSG_SAFE 7<<1 00072 #define AUTH_MSG_APPL_ERR 8<<1 00073 #define AUTH_MSG_DIE 63<<1 00074 00075 /* values for kerb error codes */ 00076 /* EXP errors are: Principal expired, Service expired, Auth expired, 00077 * but are not currently used much */ 00078 00079 #define KERB_ERR_OK 0 00080 #define KERB_ERR_NAME_EXP 1 00081 #define KERB_ERR_SERVICE_EXP 2 00082 #define KERB_ERR_AUTH_EXP 3 00083 #define KERB_ERR_PKT_VER 4 00084 #define KERB_ERR_NAME_MAST_KEY_VER 5 00085 #define KERB_ERR_SERV_MAST_KEY_VER 6 00086 #define KERB_ERR_BYTE_ORDER 7 00087 #define KERB_ERR_PRINCIPAL_UNKNOWN 8 00088 #define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9 00089 #define KERB_ERR_NULL_KEY 10 00090 #define KERB_ERR_MAXIMUM 10 00091 00092 #endif /* PROT_DEFS */