6 IMPORTS EncryptedData, Principal FROM krb5;
8 DigestTypes ::= BIT STRING {
17 DigestInit ::= SEQUENCE {
18 type UTF8String, -- http, sasl, chap, cram-md5 --
19 channel [0] SEQUENCE {
23 hostname [1] UTF8String OPTIONAL -- for chap/cram-md5
26 DigestInitReply ::= SEQUENCE {
27 nonce UTF8String, -- service nonce/challenge
28 opaque UTF8String, -- server state
29 identifier [0] UTF8String OPTIONAL
33 DigestRequest ::= SEQUENCE {
34 type UTF8String, -- http, sasl-md5, chap, cram-md5 --
35 digest UTF8String, -- http:md5/md5-sess sasl:clear/int/conf --
36 username UTF8String, -- username user used
37 responseData UTF8String, -- client response
38 authid [0] UTF8String OPTIONAL,
39 authentication-user [1] Principal OPTIONAL, -- principal to get key from
40 realm [2] UTF8String OPTIONAL,
41 method [3] UTF8String OPTIONAL,
42 uri [4] UTF8String OPTIONAL,
43 serverNonce UTF8String, -- same as "DigestInitReply.nonce"
44 clientNonce [5] UTF8String OPTIONAL,
45 nonceCount [6] UTF8String OPTIONAL,
46 qop [7] UTF8String OPTIONAL,
47 identifier [8] UTF8String OPTIONAL,
48 hostname [9] UTF8String OPTIONAL,
49 opaque UTF8String -- same as "DigestInitReply.opaque"
51 -- opaque = hex(cksum(type|serverNonce|identifier|hostname,digest-key))
52 -- serverNonce = hex(time[4bytes]random[12bytes])(-cbType:cbBinding)
55 DigestError ::= SEQUENCE {
57 code INTEGER (-2147483648..2147483647)
60 DigestResponse ::= SEQUENCE {
62 rsp [0] UTF8String OPTIONAL,
63 tickets [1] SEQUENCE OF OCTET STRING OPTIONAL,
64 channel [2] SEQUENCE {
68 session-key [3] OCTET STRING OPTIONAL
71 NTLMInit ::= SEQUENCE {
72 flags [0] INTEGER (0..4294967295),
73 hostname [1] UTF8String OPTIONAL,
74 domain [1] UTF8String OPTIONAL
77 NTLMInitReply ::= SEQUENCE {
78 flags [0] INTEGER (0..4294967295),
79 opaque [1] OCTET STRING,
80 targetname [2] UTF8String,
81 challenge [3] OCTET STRING,
82 targetinfo [4] OCTET STRING OPTIONAL
85 NTLMRequest ::= SEQUENCE {
86 flags [0] INTEGER (0..4294967295),
87 opaque [1] OCTET STRING,
88 username [2] UTF8String,
89 targetname [3] UTF8String,
90 targetinfo [4] OCTET STRING OPTIONAL,
92 ntlm [6] OCTET STRING,
93 sessionkey [7] OCTET STRING OPTIONAL
96 NTLMResponse ::= SEQUENCE {
98 flags [1] INTEGER (0..4294967295),
99 sessionkey [2] OCTET STRING OPTIONAL,
100 tickets [3] SEQUENCE OF OCTET STRING OPTIONAL
103 NTLMRequest2 ::= SEQUENCE {
104 loginUserName [0] UTF8String,
105 loginDomainName [1] UTF8String,
106 flags [2] INTEGER (0..4294967295),
107 lmchallenge [3] OCTET STRING SIZE (8),
108 ntChallengeResponce [4] OCTET STRING,
109 lmChallengeResponce [5] OCTET STRING
112 NTLMReply ::= SEQUENCE {
114 flags [1] INTEGER (0..4294967295),
115 sessionkey [2] OCTET STRING OPTIONAL
118 DigestReqInner ::= CHOICE {
120 digestRequest [1] DigestRequest,
121 ntlmInit [2] NTLMInit,
122 ntlmRequest [3] NTLMRequest,
123 supportedMechs [4] NULL
126 DigestREQ ::= [APPLICATION 128] SEQUENCE {
127 apReq [0] OCTET STRING,
128 innerReq [1] EncryptedData
131 DigestRepInner ::= CHOICE {
132 error [0] DigestError,
133 initReply [1] DigestInitReply,
134 response [2] DigestResponse,
135 ntlmInitReply [3] NTLMInitReply,
136 ntlmResponse [4] NTLMResponse,
137 supportedMechs [5] DigestTypes,
141 DigestREP ::= [APPLICATION 129] SEQUENCE {
142 apRep [0] OCTET STRING,
143 innerRep [1] EncryptedData
150 -- A1 = unq(username-value) ":" unq(realm-value) ":" passwd
152 -- A1 = HEX(H(unq(username-value) ":" unq(realm-value) ":" passwd ) ":" unq(nonce-value) ":" unq(cnonce-value))
155 -- A2 = Method ":" digest-uri-value
157 -- A2 = Method ":" digest-uri-value ":" H(entity-body)
159 -- request-digest = HEX(KD(HEX(H(A1)),
160 -- unq(nonce-value) ":" nc-value ":" unq(cnonce-value) ":" unq(qop-value) ":" HEX(H(A2))))
162 -- request-digest = HEX(KD(HEX(H(A1)), unq(nonce-value) ":" HEX(H(A2))))
166 -- SS = H( { unq(username-value), ":", unq(realm-value), ":", password } )
167 -- A1 = { SS, ":", unq(nonce-value), ":", unq(cnonce-value) }
168 -- A1 = { SS, ":", unq(nonce-value), ":", unq(cnonce-value), ":", unq(authzid-value) }
170 -- A2 = "AUTHENTICATE:", ":", digest-uri-value
171 -- qop == auth-int,auth-conf
172 -- A2 = "AUTHENTICATE:", ":", digest-uri-value, ":00000000000000000000000000000000"
174 -- response-value = HEX( KD ( HEX(H(A1)),
175 -- { unq(nonce-value), ":" nc-value, ":",
176 -- unq(cnonce-value), ":", qop-value, ":",