]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - crypto/heimdal/doc/doxyout/ntlm/man/man3/ntlm_core.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / crypto / heimdal / doc / doxyout / ntlm / man / man3 / ntlm_core.3
1 .TH "Heimdal NTLM library" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalntlmlibrary" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Heimdal NTLM library \- 
6 .SS "Functions"
7
8 .in +1c
9 .ti -1c
10 .RI "void \fBheim_ntlm_free_buf\fP (struct \fBntlm_buf\fP *p)"
11 .br
12 .ti -1c
13 .RI "void \fBheim_ntlm_free_targetinfo\fP (struct ntlm_targetinfo *ti)"
14 .br
15 .ti -1c
16 .RI "int \fBheim_ntlm_encode_targetinfo\fP (const struct ntlm_targetinfo *ti, int ucs2, struct \fBntlm_buf\fP *data)"
17 .br
18 .ti -1c
19 .RI "int \fBheim_ntlm_decode_targetinfo\fP (const struct \fBntlm_buf\fP *data, int ucs2, struct ntlm_targetinfo *ti)"
20 .br
21 .ti -1c
22 .RI "void \fBheim_ntlm_free_type1\fP (struct \fBntlm_type1\fP *data)"
23 .br
24 .ti -1c
25 .RI "int \fBheim_ntlm_encode_type1\fP (const struct \fBntlm_type1\fP *type1, struct \fBntlm_buf\fP *data)"
26 .br
27 .ti -1c
28 .RI "void \fBheim_ntlm_free_type2\fP (struct \fBntlm_type2\fP *data)"
29 .br
30 .ti -1c
31 .RI "int \fBheim_ntlm_encode_type2\fP (const struct \fBntlm_type2\fP *type2, struct \fBntlm_buf\fP *data)"
32 .br
33 .ti -1c
34 .RI "void \fBheim_ntlm_free_type3\fP (struct \fBntlm_type3\fP *data)"
35 .br
36 .ti -1c
37 .RI "int \fBheim_ntlm_encode_type3\fP (const struct \fBntlm_type3\fP *type3, struct \fBntlm_buf\fP *data)"
38 .br
39 .ti -1c
40 .RI "int \fBheim_ntlm_nt_key\fP (const char *password, struct \fBntlm_buf\fP *key)"
41 .br
42 .ti -1c
43 .RI "int \fBheim_ntlm_calculate_ntlm1\fP (void *key, size_t len, unsigned char challenge[8], struct \fBntlm_buf\fP *answer)"
44 .br
45 .ti -1c
46 .RI "int \fBheim_ntlm_build_ntlm1_master\fP (void *key, size_t len, struct \fBntlm_buf\fP *session, struct \fBntlm_buf\fP *master)"
47 .br
48 .ti -1c
49 .RI "int \fBheim_ntlm_build_ntlm2_master\fP (void *key, size_t len, struct \fBntlm_buf\fP *blob, struct \fBntlm_buf\fP *session, struct \fBntlm_buf\fP *master)"
50 .br
51 .ti -1c
52 .RI "int \fBheim_ntlm_keyex_unwrap\fP (struct \fBntlm_buf\fP *baseKey, struct \fBntlm_buf\fP *encryptedSession, struct \fBntlm_buf\fP *session)"
53 .br
54 .ti -1c
55 .RI "int \fBheim_ntlm_ntlmv2_key\fP (const void *key, size_t len, const char *username, const char *target, unsigned char ntlmv2[16])"
56 .br
57 .ti -1c
58 .RI "int \fBheim_ntlm_calculate_lm2\fP (const void *key, size_t len, const char *username, const char *target, const unsigned char serverchallenge[8], unsigned char ntlmv2[16], struct \fBntlm_buf\fP *answer)"
59 .br
60 .ti -1c
61 .RI "int \fBheim_ntlm_calculate_ntlm2\fP (const void *key, size_t len, const char *username, const char *target, const unsigned char serverchallenge[8], const struct \fBntlm_buf\fP *infotarget, unsigned char ntlmv2[16], struct \fBntlm_buf\fP *answer)"
62 .br
63 .ti -1c
64 .RI "int \fBheim_ntlm_verify_ntlm2\fP (const void *key, size_t len, const char *username, const char *target, time_t now, const unsigned char serverchallenge[8], const struct \fBntlm_buf\fP *answer, struct \fBntlm_buf\fP *infotarget, unsigned char ntlmv2[16])"
65 .br
66 .in -1c
67 .SH "Detailed Description"
68 .PP 
69 The NTLM core functions implement the string2key generation function, message encode and decode function, and the hash function functions. 
70 .SH "Function Documentation"
71 .PP 
72 .SS "int heim_ntlm_build_ntlm1_master (void * key, size_t len, struct \fBntlm_buf\fP * session, struct \fBntlm_buf\fP * master)"
73 .PP
74 Generates an NTLMv1 session random with assosited session master key.
75 .PP
76 \fBParameters:\fP
77 .RS 4
78 \fIkey\fP the ntlm v1 key 
79 .br
80 \fIlen\fP length of key 
81 .br
82 \fIsession\fP generated session nonce, should be freed with \fBheim_ntlm_free_buf()\fP. 
83 .br
84 \fImaster\fP calculated session master key, should be freed with \fBheim_ntlm_free_buf()\fP.
85 .RE
86 .PP
87 \fBReturns:\fP
88 .RS 4
89 In case of success 0 is return, an errors, a errno in what went wrong. 
90 .RE
91 .PP
92
93 .SS "int heim_ntlm_build_ntlm2_master (void * key, size_t len, struct \fBntlm_buf\fP * blob, struct \fBntlm_buf\fP * session, struct \fBntlm_buf\fP * master)"
94 .PP
95 Generates an NTLMv2 session random with associated session master key.
96 .PP
97 \fBParameters:\fP
98 .RS 4
99 \fIkey\fP the NTLMv2 key 
100 .br
101 \fIlen\fP length of key 
102 .br
103 \fIblob\fP the NTLMv2 'blob' 
104 .br
105 \fIsession\fP generated session nonce, should be freed with \fBheim_ntlm_free_buf()\fP. 
106 .br
107 \fImaster\fP calculated session master key, should be freed with \fBheim_ntlm_free_buf()\fP.
108 .RE
109 .PP
110 \fBReturns:\fP
111 .RS 4
112 In case of success 0 is return, an errors, a errno in what went wrong. 
113 .RE
114 .PP
115
116 .SS "int heim_ntlm_calculate_lm2 (const void * key, size_t len, const char * username, const char * target, const unsigned char serverchallenge[8], unsigned char ntlmv2[16], struct \fBntlm_buf\fP * answer)"
117 .PP
118 Calculate LMv2 response
119 .PP
120 \fBParameters:\fP
121 .RS 4
122 \fIkey\fP the ntlm key 
123 .br
124 \fIlen\fP length of key 
125 .br
126 \fIusername\fP name of the user, as sent in the message, assumed to be in UTF8. 
127 .br
128 \fItarget\fP the name of the target, assumed to be in UTF8. 
129 .br
130 \fIserverchallenge\fP challenge as sent by the server in the type2 message. 
131 .br
132 \fIntlmv2\fP calculated session key 
133 .br
134 \fIanswer\fP ntlm response answer, should be freed with \fBheim_ntlm_free_buf()\fP.
135 .RE
136 .PP
137 \fBReturns:\fP
138 .RS 4
139 In case of success 0 is return, an errors, a errno in what went wrong. 
140 .RE
141 .PP
142
143 .SS "int heim_ntlm_calculate_ntlm1 (void * key, size_t len, unsigned char challenge[8], struct \fBntlm_buf\fP * answer)"
144 .PP
145 Calculate NTLMv1 response hash
146 .PP
147 \fBParameters:\fP
148 .RS 4
149 \fIkey\fP the ntlm v1 key 
150 .br
151 \fIlen\fP length of key 
152 .br
153 \fIchallenge\fP sent by the server 
154 .br
155 \fIanswer\fP calculated answer, should be freed with \fBheim_ntlm_free_buf()\fP.
156 .RE
157 .PP
158 \fBReturns:\fP
159 .RS 4
160 In case of success 0 is return, an errors, a errno in what went wrong. 
161 .RE
162 .PP
163
164 .SS "int heim_ntlm_calculate_ntlm2 (const void * key, size_t len, const char * username, const char * target, const unsigned char serverchallenge[8], const struct \fBntlm_buf\fP * infotarget, unsigned char ntlmv2[16], struct \fBntlm_buf\fP * answer)"
165 .PP
166 Calculate NTLMv2 response
167 .PP
168 \fBParameters:\fP
169 .RS 4
170 \fIkey\fP the ntlm key 
171 .br
172 \fIlen\fP length of key 
173 .br
174 \fIusername\fP name of the user, as sent in the message, assumed to be in UTF8. 
175 .br
176 \fItarget\fP the name of the target, assumed to be in UTF8. 
177 .br
178 \fIserverchallenge\fP challenge as sent by the server in the type2 message. 
179 .br
180 \fIinfotarget\fP infotarget as sent by the server in the type2 message. 
181 .br
182 \fIntlmv2\fP calculated session key 
183 .br
184 \fIanswer\fP ntlm response answer, should be freed with \fBheim_ntlm_free_buf()\fP.
185 .RE
186 .PP
187 \fBReturns:\fP
188 .RS 4
189 In case of success 0 is return, an errors, a errno in what went wrong. 
190 .RE
191 .PP
192
193 .SS "int heim_ntlm_decode_targetinfo (const struct \fBntlm_buf\fP * data, int ucs2, struct ntlm_targetinfo * ti)"
194 .PP
195 Decodes an NTLM targetinfo message
196 .PP
197 \fBParameters:\fP
198 .RS 4
199 \fIdata\fP input data buffer with the encode NTLM targetinfo message 
200 .br
201 \fIucs2\fP if the strings should be encoded with ucs2 (selected by flag in message). 
202 .br
203 \fIti\fP the decoded target info, should be freed with \fBheim_ntlm_free_targetinfo()\fP.
204 .RE
205 .PP
206 \fBReturns:\fP
207 .RS 4
208 In case of success 0 is return, an errors, a errno in what went wrong. 
209 .RE
210 .PP
211
212 .SS "int heim_ntlm_encode_targetinfo (const struct ntlm_targetinfo * ti, int ucs2, struct \fBntlm_buf\fP * data)"
213 .PP
214 Encodes a ntlm_targetinfo message.
215 .PP
216 \fBParameters:\fP
217 .RS 4
218 \fIti\fP the ntlm_targetinfo message to encode. 
219 .br
220 \fIucs2\fP ignored 
221 .br
222 \fIdata\fP is the return buffer with the encoded message, should be freed with \fBheim_ntlm_free_buf()\fP.
223 .RE
224 .PP
225 \fBReturns:\fP
226 .RS 4
227 In case of success 0 is return, an errors, a errno in what went wrong. 
228 .RE
229 .PP
230
231 .SS "int heim_ntlm_encode_type1 (const struct \fBntlm_type1\fP * type1, struct \fBntlm_buf\fP * data)"
232 .PP
233 Encodes an \fBntlm_type1\fP message.
234 .PP
235 \fBParameters:\fP
236 .RS 4
237 \fItype1\fP the \fBntlm_type1\fP message to encode. 
238 .br
239 \fIdata\fP is the return buffer with the encoded message, should be freed with \fBheim_ntlm_free_buf()\fP.
240 .RE
241 .PP
242 \fBReturns:\fP
243 .RS 4
244 In case of success 0 is return, an errors, a errno in what went wrong. 
245 .RE
246 .PP
247
248 .SS "int heim_ntlm_encode_type2 (const struct \fBntlm_type2\fP * type2, struct \fBntlm_buf\fP * data)"
249 .PP
250 Encodes an \fBntlm_type2\fP message.
251 .PP
252 \fBParameters:\fP
253 .RS 4
254 \fItype2\fP the \fBntlm_type2\fP message to encode. 
255 .br
256 \fIdata\fP is the return buffer with the encoded message, should be freed with \fBheim_ntlm_free_buf()\fP.
257 .RE
258 .PP
259 \fBReturns:\fP
260 .RS 4
261 In case of success 0 is return, an errors, a errno in what went wrong. 
262 .RE
263 .PP
264
265 .SS "int heim_ntlm_encode_type3 (const struct \fBntlm_type3\fP * type3, struct \fBntlm_buf\fP * data)"
266 .PP
267 Encodes an \fBntlm_type3\fP message.
268 .PP
269 \fBParameters:\fP
270 .RS 4
271 \fItype3\fP the \fBntlm_type3\fP message to encode. 
272 .br
273 \fIdata\fP is the return buffer with the encoded message, should be freed with \fBheim_ntlm_free_buf()\fP.
274 .RE
275 .PP
276 \fBReturns:\fP
277 .RS 4
278 In case of success 0 is return, an errors, a errno in what went wrong. 
279 .RE
280 .PP
281
282 .SS "void heim_ntlm_free_buf (struct \fBntlm_buf\fP * p)"
283 .PP
284 heim_ntlm_free_buf frees the ntlm buffer
285 .PP
286 \fBParameters:\fP
287 .RS 4
288 \fIp\fP buffer to be freed 
289 .RE
290 .PP
291
292 .SS "void heim_ntlm_free_targetinfo (struct ntlm_targetinfo * ti)"
293 .PP
294 Frees the ntlm_targetinfo message
295 .PP
296 \fBParameters:\fP
297 .RS 4
298 \fIti\fP targetinfo to be freed 
299 .RE
300 .PP
301
302 .SS "void heim_ntlm_free_type1 (struct \fBntlm_type1\fP * data)"
303 .PP
304 Frees the \fBntlm_type1\fP message
305 .PP
306 \fBParameters:\fP
307 .RS 4
308 \fIdata\fP message to be freed 
309 .RE
310 .PP
311
312 .SS "void heim_ntlm_free_type2 (struct \fBntlm_type2\fP * data)"
313 .PP
314 Frees the \fBntlm_type2\fP message
315 .PP
316 \fBParameters:\fP
317 .RS 4
318 \fIdata\fP message to be freed 
319 .RE
320 .PP
321
322 .SS "void heim_ntlm_free_type3 (struct \fBntlm_type3\fP * data)"
323 .PP
324 Frees the \fBntlm_type3\fP message
325 .PP
326 \fBParameters:\fP
327 .RS 4
328 \fIdata\fP message to be freed 
329 .RE
330 .PP
331
332 .SS "int heim_ntlm_keyex_unwrap (struct \fBntlm_buf\fP * baseKey, struct \fBntlm_buf\fP * encryptedSession, struct \fBntlm_buf\fP * session)"
333 .PP
334 Given a key and encrypted session, unwrap the session key
335 .PP
336 \fBParameters:\fP
337 .RS 4
338 \fIbaseKey\fP the sessionBaseKey 
339 .br
340 \fIencryptedSession\fP encrypted session, type3.session field. 
341 .br
342 \fIsession\fP generated session nonce, should be freed with \fBheim_ntlm_free_buf()\fP.
343 .RE
344 .PP
345 \fBReturns:\fP
346 .RS 4
347 In case of success 0 is return, an errors, a errno in what went wrong. 
348 .RE
349 .PP
350
351 .SS "int heim_ntlm_nt_key (const char * password, struct \fBntlm_buf\fP * key)"
352 .PP
353 Calculate the NTLM key, the password is assumed to be in UTF8.
354 .PP
355 \fBParameters:\fP
356 .RS 4
357 \fIpassword\fP password to calcute the key for. 
358 .br
359 \fIkey\fP calcuted key, should be freed with \fBheim_ntlm_free_buf()\fP.
360 .RE
361 .PP
362 \fBReturns:\fP
363 .RS 4
364 In case of success 0 is return, an errors, a errno in what went wrong. 
365 .RE
366 .PP
367
368 .SS "int heim_ntlm_ntlmv2_key (const void * key, size_t len, const char * username, const char * target, unsigned char ntlmv2[16])"
369 .PP
370 Generates an NTLMv2 session key.
371 .PP
372 \fBParameters:\fP
373 .RS 4
374 \fIkey\fP the ntlm key 
375 .br
376 \fIlen\fP length of key 
377 .br
378 \fIusername\fP name of the user, as sent in the message, assumed to be in UTF8. 
379 .br
380 \fItarget\fP the name of the target, assumed to be in UTF8. 
381 .br
382 \fIntlmv2\fP the ntlmv2 session key
383 .RE
384 .PP
385 \fBReturns:\fP
386 .RS 4
387 0 on success, or an error code on failure. 
388 .RE
389 .PP
390
391 .SS "int heim_ntlm_verify_ntlm2 (const void * key, size_t len, const char * username, const char * target, time_t now, const unsigned char serverchallenge[8], const struct \fBntlm_buf\fP * answer, struct \fBntlm_buf\fP * infotarget, unsigned char ntlmv2[16])"
392 .PP
393 Verify NTLMv2 response.
394 .PP
395 \fBParameters:\fP
396 .RS 4
397 \fIkey\fP the ntlm key 
398 .br
399 \fIlen\fP length of key 
400 .br
401 \fIusername\fP name of the user, as sent in the message, assumed to be in UTF8. 
402 .br
403 \fItarget\fP the name of the target, assumed to be in UTF8. 
404 .br
405 \fInow\fP the time now (0 if the library should pick it up itself) 
406 .br
407 \fIserverchallenge\fP challenge as sent by the server in the type2 message. 
408 .br
409 \fIanswer\fP ntlm response answer, should be freed with \fBheim_ntlm_free_buf()\fP. 
410 .br
411 \fIinfotarget\fP infotarget as sent by the server in the type2 message. 
412 .br
413 \fIntlmv2\fP calculated session key
414 .RE
415 .PP
416 \fBReturns:\fP
417 .RS 4
418 In case of success 0 is return, an errors, a errno in what went wrong. 
419 .RE
420 .PP
421