跳到主要内容

8. 常量与其他定义值

8.1. 主机地址类型​

主机地址类型的所有负值保留供本地使用. 所有非负值保留用于正式分配的类型字段和解释.

以下地址的类型值选择为与 Berkeley Standard Distributions of Unix 中定义的地址族常量匹配. 它们可以在 <sys/socket.h> 中找到, 符号名为 AF_xxx (其中 xxx 是地址族名称的缩写).

Internet 地址

  Internet 地址是 32 位 (4 个八位字节) 的量, 按 MSB 顺序编码. Internet 地址的类型是二 (2).

CHAOSnet 地址

  CHAOSnet 地址是 16 位 (2 个八位字节) 的量, 按 MSB 顺序编码. CHAOSnet 地址的类型是五 (5).

ISO 地址

  ISO 地址是变长的. ISO 地址的类型是七 (7).

Xerox Network Services (XNS) 地址

  XNS 地址是 48 位 (6 个八位字节) 的量, 按 MSB 顺序编码. XNS 地址的类型是六 (6).

AppleTalk Datagram Delivery Protocol (DDP) 地址

  AppleTalk DDP 地址由一个 8 位节点号和一个 16 位网络号组成. 地址的第一个八位字节是节点号; 其余两个八位字节按 MSB 顺序编码网络号. AppleTalk DDP 地址的类型是十六 (16).

DECnet Phase IV 地址

  DECnet Phase IV 地址是 16 位地址, 按 LSB 顺序编码. DECnet Phase IV 地址的类型是十二 (12).

8.2. KDC 消息​

8.2.1. IP 传输​

当使用 IP 传输联系 Kerberos 服务器 (KDC) 发出 KRB_KDC_REQ 请求时, 客户端应发送一个 UDP 数据报, 其中仅包含请求的编码, 发往 KDC IP 地址上的 88 号端口 (十进制); KDC 将以一个回复数据报响应, 其中仅包含回复消息的编码 (KRB_ERROR 或 KRB_KDC_REP), 发往发送方 IP 地址上的发送端口.

8.2.2. OSI 传输​

在 OSI 客户端向 OSI 服务器认证期间, OSI 服务器向 OSI 客户端的双向认证期间, 凭证从 OSI 客户端传送到 OSI 服务器期间, 或私有消息或完整性检查消息的交换期间, Kerberos 协议消息可被视为不透明对象, 认证机制的类型将为:

   OBJECT IDENTIFIER ::= {iso (1), org(3), dod(5),internet(1),
security(5), kerberosv5(2)}

视情况而定, 该不透明对象将是认证头部 (KRB_AP_REQ), 认证回复 (KRB_AP_REP), 安全消息 (KRB_SAFE), 私有消息 (KRB_PRIV), 或凭证消息 (KRB_CRED). 不透明数据包含每条消息的 ASN.1 描述中规定的 application code. Kerberos 可以使用该 application code 来确定消息类型.

8.2.3. TGS 的名称​

票据授予服务的 principal 标识符应由三部分组成: (1) 签发 TGS 票据的 KDC 的 realm; (2) 一个 NT-SRVINST 类型的两部分名称, 第一部分为 "krbtgt", 第二部分为将接受该票据授予票据的 realm 名称. 例如, 由 ATHENA.MIT.EDU realm 签发,用于从 ATHENA.MIT.EDU KDC 获取票据的票据授予票据, 其 principal 标识符为 "ATHENA.MIT.EDU" (realm), ("krbtgt", "ATHENA.MIT.EDU") (名称). 由 ATHENA.MIT.EDU realm 签发,用于从 MIT.EDU realm 获取票据的票据授予票据, 其 principal 标识符为 "ATHENA.MIT.EDU" (realm), ("krbtgt", "MIT.EDU") (名称).

8.3. 协议常量和相关值​

下表列出协议中使用的常量并定义其含义.

---------------+-----------+----------+----------------+---------------
Encryption type|etype value|block size|minimum pad size|confounder size
---------------+-----------+----------+----------------+---------------
NULL 0 1 0 0
des-cbc-crc 1 8 4 8
des-cbc-md4 2 8 0 8
des-cbc-md5 3 8 0 8
-------------------------------+-------------------+-------------
Checksum type |sumtype value |checksum size
-------------------------------+-------------------+-------------
CRC32 1 4
rsa-md4 2 16
rsa-md4-des 3 24
des-mac 4 16
des-mac-k 5 8
rsa-md4-des-k 6 16
rsa-md5 7 16
rsa-md5-des 8 24
-------------------------------+-----------------
padata type |padata-type value
-------------------------------+-----------------
PA-TGS-REQ 1
PA-ENC-TIMESTAMP 2
PA-PW-SALT 3
-------------------------------+-------------
authorization data type |ad-type value
-------------------------------+-------------
reserved values 0-63
OSF-DCE 64
SESAME 65
-------------------------------+-----------------
alternate authentication type |method-type value
-------------------------------+-----------------
reserved values 0-63
ATT-CHALLENGE-RESPONSE 64
-------------------------------+-------------
transited encoding type |tr-type value
-------------------------------+-------------
DOMAIN-X500-COMPRESS 1
reserved values all others
--------------+-------+-----------------------------------------
Label |Value |Meaning or MIT code
--------------+-------+-----------------------------------------

pvno 5 current Kerberos protocol version number

message types

KRB_AS_REQ      10     Request for initial authentication
KRB_AS_REP 11 Response to KRB_AS_REQ request
KRB_TGS_REQ 12 Request for authentication based on TGT
KRB_TGS_REP 13 Response to KRB_TGS_REQ request
KRB_AP_REQ 14 application request to server
KRB_AP_REP 15 Response to KRB_AP_REQ_MUTUAL
KRB_SAFE 20 Safe (checksummed) application message
KRB_PRIV 21 Private (encrypted) application message
KRB_CRED 22 Private (encrypted) message to forward
credentials
KRB_ERROR 30 Error response

name types

KRB_NT_UNKNOWN   0   Name type not known
KRB_NT_PRINCIPAL 1 Just the name of the principal as in DCE, or
for users
KRB_NT_SRV_INST 2 Service and other unique instance (krbtgt)
KRB_NT_SRV_HST 3 Service with host name as instance (telnet,
rcommands)
KRB_NT_SRV_XHST 4 Service with host as remaining components
KRB_NT_UID 5 Unique ID

error codes

KDC_ERR_NONE                   0   No error
KDC_ERR_NAME_EXP 1 Client's entry in database has
expired
KDC_ERR_SERVICE_EXP 2 Server's entry in database has
expired
KDC_ERR_BAD_PVNO 3 Requested protocol version number
not supported
KDC_ERR_C_OLD_MAST_KVNO 4 Client's key encrypted in old
master key
KDC_ERR_S_OLD_MAST_KVNO 5 Server's key encrypted in old
master key
KDC_ERR_C_PRINCIPAL_UNKNOWN 6 Client not found in Kerberos database
KDC_ERR_S_PRINCIPAL_UNKNOWN 7 Server not found in Kerberos database
KDC_ERR_PRINCIPAL_NOT_UNIQUE 8 Multiple principal entries in
database
KDC_ERR_NULL_KEY               9   The client or server has a null key
KDC_ERR_CANNOT_POSTDATE       10   Ticket not eligible for postdating
KDC_ERR_NEVER_VALID           11   Requested start time is later than
                                   end time
KDC_ERR_POLICY                12   KDC policy rejects request
KDC_ERR_BADOPTION             13   KDC cannot accommodate requested
                                   option
KDC_ERR_ETYPE_NOSUPP          14   KDC has no support for encryption
                                   type
KDC_ERR_SUMTYPE_NOSUPP        15   KDC has no support for checksum type
KDC_ERR_PADATA_TYPE_NOSUPP    16   KDC has no support for padata type
KDC_ERR_TRTYPE_NOSUPP         17   KDC has no support for transited type
KDC_ERR_CLIENT_REVOKED        18   Clients credentials have been revoked
KDC_ERR_SERVICE_REVOKED       19   Credentials for server have been
                                   revoked
KDC_ERR_TGT_REVOKED           20   TGT has been revoked
KDC_ERR_CLIENT_NOTYET         21   Client not yet valid - try again
                                   later
KDC_ERR_SERVICE_NOTYET        22   Server not yet valid - try again
                                   later
KDC_ERR_KEY_EXPIRED           23   Password has expired - change
                                   password to reset
KDC_ERR_PREAUTH_FAILED        24   Pre-authentication information
                                   was invalid
KDC_ERR_PREAUTH_REQUIRED      25   Additional pre-authentication
                                   required*
KRB_AP_ERR_BAD_INTEGRITY      31   Integrity check on decrypted field
                                   failed
KRB_AP_ERR_TKT_EXPIRED        32   Ticket expired
KRB_AP_ERR_TKT_NYV            33   Ticket not yet valid
KRB_AP_ERR_REPEAT             34   Request is a replay
KRB_AP_ERR_NOT_US             35   The ticket isn't for us
KRB_AP_ERR_BADMATCH           36   Ticket and authenticator don't match
KRB_AP_ERR_SKEW               37   Clock skew too great
KRB_AP_ERR_BADADDR            38   Incorrect net address
KRB_AP_ERR_BADVERSION         39   Protocol version mismatch
KRB_AP_ERR_MSG_TYPE           40   Invalid msg type
KRB_AP_ERR_MODIFIED           41   Message stream modified
KRB_AP_ERR_BADORDER           42   Message out of order
KRB_AP_ERR_BADKEYVER          44   Specified version of key is not
                                   available
KRB_AP_ERR_NOKEY              45   Service key not available
KRB_AP_ERR_MUT_FAIL           46   Mutual authentication failed
KRB_AP_ERR_BADDIRECTION       47   Incorrect message direction
KRB_AP_ERR_METHOD             48   Alternative authentication method
                                   required*
KRB_AP_ERR_BADSEQ             49   Incorrect sequence number in message
KRB_AP_ERR_INAPP_CKSUM        50   Inappropriate type of checksum in
                              message
KRB_ERR_GENERIC               60   Generic error (description in e-text)
KRB_ERR_FIELD_TOOLONG 61 Field is too long for this
implementation

*该错误在 e-data 字段中携带附加信息. 该消息 e-data 字段的内容在第 5.9.1 节中描述.