1226031Sstas<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2226031Sstas<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 3226031Sstas<title>Heimdalntlmlibrary: Heimdal NTLM library</title> 4226031Sstas<link href="doxygen.css" rel="stylesheet" type="text/css"> 5226031Sstas<link href="tabs.css" rel="stylesheet" type="text/css"> 6226031Sstas</head><body> 7226031Sstas<p> 8226031Sstas<a href="http://www.h5l.org/"><img src="http://www.h5l.org/keyhole-heimdal.png" alt="keyhole logo"/></a> 9226031Sstas</p> 10226031Sstas<!-- end of header marker --> 11226031Sstas<!-- Generated by Doxygen 1.5.6 --> 12226031Sstas<div class="navigation" id="top"> 13226031Sstas <div class="tabs"> 14226031Sstas <ul> 15226031Sstas <li><a href="index.html"><span>Main Page</span></a></li> 16226031Sstas <li><a href="modules.html"><span>Modules</span></a></li> 17226031Sstas <li><a href="annotated.html"><span>Data Structures</span></a></li> 18226031Sstas <li><a href="examples.html"><span>Examples</span></a></li> 19226031Sstas </ul> 20226031Sstas </div> 21226031Sstas</div> 22226031Sstas<div class="contents"> 23226031Sstas<h1>Heimdal NTLM library</h1><table border="0" cellpadding="0" cellspacing="0"> 24226031Sstas<tr><td></td></tr> 25226031Sstas<tr><td colspan="2"><br><h2>Functions</h2></td></tr> 26226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf</a> (struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *p)</td></tr> 27226031Sstas 28226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g704ec8c5dba05ef57186d242ff165565">heim_ntlm_free_targetinfo</a> (struct ntlm_targetinfo *ti)</td></tr> 29226031Sstas 30226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g2881747fad2ac2979a28d3bd050b0fa8">heim_ntlm_encode_targetinfo</a> (const struct ntlm_targetinfo *ti, int ucs2, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *data)</td></tr> 31226031Sstas 32226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#gf1d4de2faec8b1c1070a55fd2e6e630f">heim_ntlm_decode_targetinfo</a> (const struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *data, int ucs2, struct ntlm_targetinfo *ti)</td></tr> 33226031Sstas 34226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g76fa6caf3f539e24008e31613f5eb663">heim_ntlm_free_type1</a> (struct <a class="el" href="structntlm__type1.html">ntlm_type1</a> *data)</td></tr> 35226031Sstas 36226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g0107727234287ac61a8801b0faff9dff">heim_ntlm_encode_type1</a> (const struct <a class="el" href="structntlm__type1.html">ntlm_type1</a> *type1, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *data)</td></tr> 37226031Sstas 38226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g8fde84c86f1c7c9f730f7fb4acedcb43">heim_ntlm_free_type2</a> (struct <a class="el" href="structntlm__type2.html">ntlm_type2</a> *data)</td></tr> 39226031Sstas 40226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g2860c6f6d497255eb433adc8cacc49dd">heim_ntlm_encode_type2</a> (const struct <a class="el" href="structntlm__type2.html">ntlm_type2</a> *type2, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *data)</td></tr> 41226031Sstas 42226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#gc4e6d01e5247b8540d41ccbbf1031319">heim_ntlm_free_type3</a> (struct <a class="el" href="structntlm__type3.html">ntlm_type3</a> *data)</td></tr> 43226031Sstas 44226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g9cf026be6e602c22d62aa9e47e85c7c2">heim_ntlm_encode_type3</a> (const struct <a class="el" href="structntlm__type3.html">ntlm_type3</a> *type3, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *data)</td></tr> 45226031Sstas 46226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g254ee0a4d5a2594833e36697ad575d7e">heim_ntlm_nt_key</a> (const char *password, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *key)</td></tr> 47226031Sstas 48226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#ge3b634802ef94233a175291abd2ea14d">heim_ntlm_calculate_ntlm1</a> (void *key, size_t len, unsigned char challenge[8], struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *answer)</td></tr> 49226031Sstas 50226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#gd09935f9ccecb9fb2917d68fb82ec3d6">heim_ntlm_build_ntlm1_master</a> (void *key, size_t len, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *session, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *master)</td></tr> 51226031Sstas 52226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#gd189a009fcac6cba44678b6a0aef81e0">heim_ntlm_build_ntlm2_master</a> (void *key, size_t len, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *blob, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *session, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *master)</td></tr> 53226031Sstas 54226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g6ef0049af05a83d73b7a3d962e679c2a">heim_ntlm_keyex_unwrap</a> (struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *baseKey, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *encryptedSession, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *session)</td></tr> 55226031Sstas 56226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g4c4c32652527acead6848052615ae284">heim_ntlm_ntlmv2_key</a> (const void *key, size_t len, const char *username, const char *target, unsigned char ntlmv2[16])</td></tr> 57226031Sstas 58226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g9bc09732da698d0f2d8c9d41e60d764d">heim_ntlm_calculate_lm2</a> (const void *key, size_t len, const char *username, const char *target, const unsigned char serverchallenge[8], unsigned char ntlmv2[16], struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *answer)</td></tr> 59226031Sstas 60226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#ga8f07fb71a0d5f095cde3fb9fb40d10c">heim_ntlm_calculate_ntlm2</a> (const void *key, size_t len, const char *username, const char *target, const unsigned char serverchallenge[8], const struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *infotarget, unsigned char ntlmv2[16], struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *answer)</td></tr> 61226031Sstas 62226031Sstas<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ntlm__core.html#g3b3d6a5187cab6bfe656afa7a8273ca6">heim_ntlm_verify_ntlm2</a> (const void *key, size_t len, const char *username, const char *target, time_t now, const unsigned char serverchallenge[8], const struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *answer, struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> *infotarget, unsigned char ntlmv2[16])</td></tr> 63226031Sstas 64226031Sstas</table> 65226031Sstas<hr><a name="_details"></a><h2>Detailed Description</h2> 66226031SstasThe NTLM core functions implement the string2key generation function, message encode and decode function, and the hash function functions. <hr><h2>Function Documentation</h2> 67226031Sstas<a class="anchor" name="gd09935f9ccecb9fb2917d68fb82ec3d6"></a><!-- doxytag: member="ntlm.c::heim_ntlm_build_ntlm1_master" ref="gd09935f9ccecb9fb2917d68fb82ec3d6" args="(void *key, size_t len, struct ntlm_buf *session, struct ntlm_buf *master)" --> 68226031Sstas<div class="memitem"> 69226031Sstas<div class="memproto"> 70226031Sstas <table class="memname"> 71226031Sstas <tr> 72226031Sstas <td class="memname">int heim_ntlm_build_ntlm1_master </td> 73226031Sstas <td>(</td> 74226031Sstas <td class="paramtype">void * </td> 75226031Sstas <td class="paramname"> <em>key</em>, </td> 76226031Sstas </tr> 77226031Sstas <tr> 78226031Sstas <td class="paramkey"></td> 79226031Sstas <td></td> 80226031Sstas <td class="paramtype">size_t </td> 81226031Sstas <td class="paramname"> <em>len</em>, </td> 82226031Sstas </tr> 83226031Sstas <tr> 84226031Sstas <td class="paramkey"></td> 85226031Sstas <td></td> 86226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 87226031Sstas <td class="paramname"> <em>session</em>, </td> 88226031Sstas </tr> 89226031Sstas <tr> 90226031Sstas <td class="paramkey"></td> 91226031Sstas <td></td> 92226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 93226031Sstas <td class="paramname"> <em>master</em></td><td> </td> 94226031Sstas </tr> 95226031Sstas <tr> 96226031Sstas <td></td> 97226031Sstas <td>)</td> 98226031Sstas <td></td><td></td><td></td> 99226031Sstas </tr> 100226031Sstas </table> 101226031Sstas</div> 102226031Sstas<div class="memdoc"> 103226031Sstas 104226031Sstas<p> 105226031SstasGenerates an NTLMv1 session random with assosited session master key.<p> 106226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 107226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 108226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>the ntlm v1 key </td></tr> 109226031Sstas <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of key </td></tr> 110226031Sstas <tr><td valign="top"></td><td valign="top"><em>session</em> </td><td>generated session nonce, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>. </td></tr> 111226031Sstas <tr><td valign="top"></td><td valign="top"><em>master</em> </td><td>calculated session master key, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 112226031Sstas </table> 113226031Sstas</dl> 114226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 115226031Sstas 116226031Sstas</div> 117226031Sstas</div><p> 118226031Sstas<a class="anchor" name="gd189a009fcac6cba44678b6a0aef81e0"></a><!-- doxytag: member="ntlm.c::heim_ntlm_build_ntlm2_master" ref="gd189a009fcac6cba44678b6a0aef81e0" args="(void *key, size_t len, struct ntlm_buf *blob, struct ntlm_buf *session, struct ntlm_buf *master)" --> 119226031Sstas<div class="memitem"> 120226031Sstas<div class="memproto"> 121226031Sstas <table class="memname"> 122226031Sstas <tr> 123226031Sstas <td class="memname">int heim_ntlm_build_ntlm2_master </td> 124226031Sstas <td>(</td> 125226031Sstas <td class="paramtype">void * </td> 126226031Sstas <td class="paramname"> <em>key</em>, </td> 127226031Sstas </tr> 128226031Sstas <tr> 129226031Sstas <td class="paramkey"></td> 130226031Sstas <td></td> 131226031Sstas <td class="paramtype">size_t </td> 132226031Sstas <td class="paramname"> <em>len</em>, </td> 133226031Sstas </tr> 134226031Sstas <tr> 135226031Sstas <td class="paramkey"></td> 136226031Sstas <td></td> 137226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 138226031Sstas <td class="paramname"> <em>blob</em>, </td> 139226031Sstas </tr> 140226031Sstas <tr> 141226031Sstas <td class="paramkey"></td> 142226031Sstas <td></td> 143226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 144226031Sstas <td class="paramname"> <em>session</em>, </td> 145226031Sstas </tr> 146226031Sstas <tr> 147226031Sstas <td class="paramkey"></td> 148226031Sstas <td></td> 149226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 150226031Sstas <td class="paramname"> <em>master</em></td><td> </td> 151226031Sstas </tr> 152226031Sstas <tr> 153226031Sstas <td></td> 154226031Sstas <td>)</td> 155226031Sstas <td></td><td></td><td></td> 156226031Sstas </tr> 157226031Sstas </table> 158226031Sstas</div> 159226031Sstas<div class="memdoc"> 160226031Sstas 161226031Sstas<p> 162226031SstasGenerates an NTLMv2 session random with associated session master key.<p> 163226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 164226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 165226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>the NTLMv2 key </td></tr> 166226031Sstas <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of key </td></tr> 167226031Sstas <tr><td valign="top"></td><td valign="top"><em>blob</em> </td><td>the NTLMv2 "blob" </td></tr> 168226031Sstas <tr><td valign="top"></td><td valign="top"><em>session</em> </td><td>generated session nonce, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>. </td></tr> 169226031Sstas <tr><td valign="top"></td><td valign="top"><em>master</em> </td><td>calculated session master key, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 170226031Sstas </table> 171226031Sstas</dl> 172226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 173226031Sstas 174226031Sstas</div> 175226031Sstas</div><p> 176226031Sstas<a class="anchor" name="g9bc09732da698d0f2d8c9d41e60d764d"></a><!-- doxytag: member="ntlm.c::heim_ntlm_calculate_lm2" ref="g9bc09732da698d0f2d8c9d41e60d764d" args="(const void *key, size_t len, const char *username, const char *target, const unsigned char serverchallenge[8], unsigned char ntlmv2[16], struct ntlm_buf *answer)" --> 177226031Sstas<div class="memitem"> 178226031Sstas<div class="memproto"> 179226031Sstas <table class="memname"> 180226031Sstas <tr> 181226031Sstas <td class="memname">int heim_ntlm_calculate_lm2 </td> 182226031Sstas <td>(</td> 183226031Sstas <td class="paramtype">const void * </td> 184226031Sstas <td class="paramname"> <em>key</em>, </td> 185226031Sstas </tr> 186226031Sstas <tr> 187226031Sstas <td class="paramkey"></td> 188226031Sstas <td></td> 189226031Sstas <td class="paramtype">size_t </td> 190226031Sstas <td class="paramname"> <em>len</em>, </td> 191226031Sstas </tr> 192226031Sstas <tr> 193226031Sstas <td class="paramkey"></td> 194226031Sstas <td></td> 195226031Sstas <td class="paramtype">const char * </td> 196226031Sstas <td class="paramname"> <em>username</em>, </td> 197226031Sstas </tr> 198226031Sstas <tr> 199226031Sstas <td class="paramkey"></td> 200226031Sstas <td></td> 201226031Sstas <td class="paramtype">const char * </td> 202226031Sstas <td class="paramname"> <em>target</em>, </td> 203226031Sstas </tr> 204226031Sstas <tr> 205226031Sstas <td class="paramkey"></td> 206226031Sstas <td></td> 207226031Sstas <td class="paramtype">const unsigned char </td> 208226031Sstas <td class="paramname"> <em>serverchallenge</em>[8], </td> 209226031Sstas </tr> 210226031Sstas <tr> 211226031Sstas <td class="paramkey"></td> 212226031Sstas <td></td> 213226031Sstas <td class="paramtype">unsigned char </td> 214226031Sstas <td class="paramname"> <em>ntlmv2</em>[16], </td> 215226031Sstas </tr> 216226031Sstas <tr> 217226031Sstas <td class="paramkey"></td> 218226031Sstas <td></td> 219226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 220226031Sstas <td class="paramname"> <em>answer</em></td><td> </td> 221226031Sstas </tr> 222226031Sstas <tr> 223226031Sstas <td></td> 224226031Sstas <td>)</td> 225226031Sstas <td></td><td></td><td></td> 226226031Sstas </tr> 227226031Sstas </table> 228226031Sstas</div> 229226031Sstas<div class="memdoc"> 230226031Sstas 231226031Sstas<p> 232226031SstasCalculate LMv2 response<p> 233226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 234226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 235226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>the ntlm key </td></tr> 236226031Sstas <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of key </td></tr> 237226031Sstas <tr><td valign="top"></td><td valign="top"><em>username</em> </td><td>name of the user, as sent in the message, assumed to be in UTF8. </td></tr> 238226031Sstas <tr><td valign="top"></td><td valign="top"><em>target</em> </td><td>the name of the target, assumed to be in UTF8. </td></tr> 239226031Sstas <tr><td valign="top"></td><td valign="top"><em>serverchallenge</em> </td><td>challenge as sent by the server in the type2 message. </td></tr> 240226031Sstas <tr><td valign="top"></td><td valign="top"><em>ntlmv2</em> </td><td>calculated session key </td></tr> 241226031Sstas <tr><td valign="top"></td><td valign="top"><em>answer</em> </td><td>ntlm response answer, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 242226031Sstas </table> 243226031Sstas</dl> 244226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 245226031Sstas 246226031Sstas</div> 247226031Sstas</div><p> 248226031Sstas<a class="anchor" name="ge3b634802ef94233a175291abd2ea14d"></a><!-- doxytag: member="ntlm.c::heim_ntlm_calculate_ntlm1" ref="ge3b634802ef94233a175291abd2ea14d" args="(void *key, size_t len, unsigned char challenge[8], struct ntlm_buf *answer)" --> 249226031Sstas<div class="memitem"> 250226031Sstas<div class="memproto"> 251226031Sstas <table class="memname"> 252226031Sstas <tr> 253226031Sstas <td class="memname">int heim_ntlm_calculate_ntlm1 </td> 254226031Sstas <td>(</td> 255226031Sstas <td class="paramtype">void * </td> 256226031Sstas <td class="paramname"> <em>key</em>, </td> 257226031Sstas </tr> 258226031Sstas <tr> 259226031Sstas <td class="paramkey"></td> 260226031Sstas <td></td> 261226031Sstas <td class="paramtype">size_t </td> 262226031Sstas <td class="paramname"> <em>len</em>, </td> 263226031Sstas </tr> 264226031Sstas <tr> 265226031Sstas <td class="paramkey"></td> 266226031Sstas <td></td> 267226031Sstas <td class="paramtype">unsigned char </td> 268226031Sstas <td class="paramname"> <em>challenge</em>[8], </td> 269226031Sstas </tr> 270226031Sstas <tr> 271226031Sstas <td class="paramkey"></td> 272226031Sstas <td></td> 273226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 274226031Sstas <td class="paramname"> <em>answer</em></td><td> </td> 275226031Sstas </tr> 276226031Sstas <tr> 277226031Sstas <td></td> 278226031Sstas <td>)</td> 279226031Sstas <td></td><td></td><td></td> 280226031Sstas </tr> 281226031Sstas </table> 282226031Sstas</div> 283226031Sstas<div class="memdoc"> 284226031Sstas 285226031Sstas<p> 286226031SstasCalculate NTLMv1 response hash<p> 287226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 288226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 289226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>the ntlm v1 key </td></tr> 290226031Sstas <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of key </td></tr> 291226031Sstas <tr><td valign="top"></td><td valign="top"><em>challenge</em> </td><td>sent by the server </td></tr> 292226031Sstas <tr><td valign="top"></td><td valign="top"><em>answer</em> </td><td>calculated answer, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 293226031Sstas </table> 294226031Sstas</dl> 295226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 296226031Sstas 297226031Sstas</div> 298226031Sstas</div><p> 299226031Sstas<a class="anchor" name="ga8f07fb71a0d5f095cde3fb9fb40d10c"></a><!-- doxytag: member="ntlm.c::heim_ntlm_calculate_ntlm2" ref="ga8f07fb71a0d5f095cde3fb9fb40d10c" args="(const void *key, size_t len, const char *username, const char *target, const unsigned char serverchallenge[8], const struct ntlm_buf *infotarget, unsigned char ntlmv2[16], struct ntlm_buf *answer)" --> 300226031Sstas<div class="memitem"> 301226031Sstas<div class="memproto"> 302226031Sstas <table class="memname"> 303226031Sstas <tr> 304226031Sstas <td class="memname">int heim_ntlm_calculate_ntlm2 </td> 305226031Sstas <td>(</td> 306226031Sstas <td class="paramtype">const void * </td> 307226031Sstas <td class="paramname"> <em>key</em>, </td> 308226031Sstas </tr> 309226031Sstas <tr> 310226031Sstas <td class="paramkey"></td> 311226031Sstas <td></td> 312226031Sstas <td class="paramtype">size_t </td> 313226031Sstas <td class="paramname"> <em>len</em>, </td> 314226031Sstas </tr> 315226031Sstas <tr> 316226031Sstas <td class="paramkey"></td> 317226031Sstas <td></td> 318226031Sstas <td class="paramtype">const char * </td> 319226031Sstas <td class="paramname"> <em>username</em>, </td> 320226031Sstas </tr> 321226031Sstas <tr> 322226031Sstas <td class="paramkey"></td> 323226031Sstas <td></td> 324226031Sstas <td class="paramtype">const char * </td> 325226031Sstas <td class="paramname"> <em>target</em>, </td> 326226031Sstas </tr> 327226031Sstas <tr> 328226031Sstas <td class="paramkey"></td> 329226031Sstas <td></td> 330226031Sstas <td class="paramtype">const unsigned char </td> 331226031Sstas <td class="paramname"> <em>serverchallenge</em>[8], </td> 332226031Sstas </tr> 333226031Sstas <tr> 334226031Sstas <td class="paramkey"></td> 335226031Sstas <td></td> 336226031Sstas <td class="paramtype">const struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 337226031Sstas <td class="paramname"> <em>infotarget</em>, </td> 338226031Sstas </tr> 339226031Sstas <tr> 340226031Sstas <td class="paramkey"></td> 341226031Sstas <td></td> 342226031Sstas <td class="paramtype">unsigned char </td> 343226031Sstas <td class="paramname"> <em>ntlmv2</em>[16], </td> 344226031Sstas </tr> 345226031Sstas <tr> 346226031Sstas <td class="paramkey"></td> 347226031Sstas <td></td> 348226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 349226031Sstas <td class="paramname"> <em>answer</em></td><td> </td> 350226031Sstas </tr> 351226031Sstas <tr> 352226031Sstas <td></td> 353226031Sstas <td>)</td> 354226031Sstas <td></td><td></td><td></td> 355226031Sstas </tr> 356226031Sstas </table> 357226031Sstas</div> 358226031Sstas<div class="memdoc"> 359226031Sstas 360226031Sstas<p> 361226031SstasCalculate NTLMv2 response<p> 362226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 363226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 364226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>the ntlm key </td></tr> 365226031Sstas <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of key </td></tr> 366226031Sstas <tr><td valign="top"></td><td valign="top"><em>username</em> </td><td>name of the user, as sent in the message, assumed to be in UTF8. </td></tr> 367226031Sstas <tr><td valign="top"></td><td valign="top"><em>target</em> </td><td>the name of the target, assumed to be in UTF8. </td></tr> 368226031Sstas <tr><td valign="top"></td><td valign="top"><em>serverchallenge</em> </td><td>challenge as sent by the server in the type2 message. </td></tr> 369226031Sstas <tr><td valign="top"></td><td valign="top"><em>infotarget</em> </td><td>infotarget as sent by the server in the type2 message. </td></tr> 370226031Sstas <tr><td valign="top"></td><td valign="top"><em>ntlmv2</em> </td><td>calculated session key </td></tr> 371226031Sstas <tr><td valign="top"></td><td valign="top"><em>answer</em> </td><td>ntlm response answer, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 372226031Sstas </table> 373226031Sstas</dl> 374226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 375226031Sstas 376226031Sstas</div> 377226031Sstas</div><p> 378226031Sstas<a class="anchor" name="gf1d4de2faec8b1c1070a55fd2e6e630f"></a><!-- doxytag: member="ntlm.c::heim_ntlm_decode_targetinfo" ref="gf1d4de2faec8b1c1070a55fd2e6e630f" args="(const struct ntlm_buf *data, int ucs2, struct ntlm_targetinfo *ti)" --> 379226031Sstas<div class="memitem"> 380226031Sstas<div class="memproto"> 381226031Sstas <table class="memname"> 382226031Sstas <tr> 383226031Sstas <td class="memname">int heim_ntlm_decode_targetinfo </td> 384226031Sstas <td>(</td> 385226031Sstas <td class="paramtype">const struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 386226031Sstas <td class="paramname"> <em>data</em>, </td> 387226031Sstas </tr> 388226031Sstas <tr> 389226031Sstas <td class="paramkey"></td> 390226031Sstas <td></td> 391226031Sstas <td class="paramtype">int </td> 392226031Sstas <td class="paramname"> <em>ucs2</em>, </td> 393226031Sstas </tr> 394226031Sstas <tr> 395226031Sstas <td class="paramkey"></td> 396226031Sstas <td></td> 397226031Sstas <td class="paramtype">struct ntlm_targetinfo * </td> 398226031Sstas <td class="paramname"> <em>ti</em></td><td> </td> 399226031Sstas </tr> 400226031Sstas <tr> 401226031Sstas <td></td> 402226031Sstas <td>)</td> 403226031Sstas <td></td><td></td><td></td> 404226031Sstas </tr> 405226031Sstas </table> 406226031Sstas</div> 407226031Sstas<div class="memdoc"> 408226031Sstas 409226031Sstas<p> 410226031SstasDecodes an NTLM targetinfo message<p> 411226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 412226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 413226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>input data buffer with the encode NTLM targetinfo message </td></tr> 414226031Sstas <tr><td valign="top"></td><td valign="top"><em>ucs2</em> </td><td>if the strings should be encoded with ucs2 (selected by flag in message). </td></tr> 415226031Sstas <tr><td valign="top"></td><td valign="top"><em>ti</em> </td><td>the decoded target info, should be freed with <a class="el" href="group__ntlm__core.html#g704ec8c5dba05ef57186d242ff165565">heim_ntlm_free_targetinfo()</a>.</td></tr> 416226031Sstas </table> 417226031Sstas</dl> 418226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 419226031Sstas 420226031Sstas</div> 421226031Sstas</div><p> 422226031Sstas<a class="anchor" name="g2881747fad2ac2979a28d3bd050b0fa8"></a><!-- doxytag: member="ntlm.c::heim_ntlm_encode_targetinfo" ref="g2881747fad2ac2979a28d3bd050b0fa8" args="(const struct ntlm_targetinfo *ti, int ucs2, struct ntlm_buf *data)" --> 423226031Sstas<div class="memitem"> 424226031Sstas<div class="memproto"> 425226031Sstas <table class="memname"> 426226031Sstas <tr> 427226031Sstas <td class="memname">int heim_ntlm_encode_targetinfo </td> 428226031Sstas <td>(</td> 429226031Sstas <td class="paramtype">const struct ntlm_targetinfo * </td> 430226031Sstas <td class="paramname"> <em>ti</em>, </td> 431226031Sstas </tr> 432226031Sstas <tr> 433226031Sstas <td class="paramkey"></td> 434226031Sstas <td></td> 435226031Sstas <td class="paramtype">int </td> 436226031Sstas <td class="paramname"> <em>ucs2</em>, </td> 437226031Sstas </tr> 438226031Sstas <tr> 439226031Sstas <td class="paramkey"></td> 440226031Sstas <td></td> 441226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 442226031Sstas <td class="paramname"> <em>data</em></td><td> </td> 443226031Sstas </tr> 444226031Sstas <tr> 445226031Sstas <td></td> 446226031Sstas <td>)</td> 447226031Sstas <td></td><td></td><td></td> 448226031Sstas </tr> 449226031Sstas </table> 450226031Sstas</div> 451226031Sstas<div class="memdoc"> 452226031Sstas 453226031Sstas<p> 454226031SstasEncodes a ntlm_targetinfo message.<p> 455226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 456226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 457226031Sstas <tr><td valign="top"></td><td valign="top"><em>ti</em> </td><td>the ntlm_targetinfo message to encode. </td></tr> 458226031Sstas <tr><td valign="top"></td><td valign="top"><em>ucs2</em> </td><td>ignored </td></tr> 459226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>is the return buffer with the encoded message, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 460226031Sstas </table> 461226031Sstas</dl> 462226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 463226031Sstas 464226031Sstas</div> 465226031Sstas</div><p> 466226031Sstas<a class="anchor" name="g0107727234287ac61a8801b0faff9dff"></a><!-- doxytag: member="ntlm.c::heim_ntlm_encode_type1" ref="g0107727234287ac61a8801b0faff9dff" args="(const struct ntlm_type1 *type1, struct ntlm_buf *data)" --> 467226031Sstas<div class="memitem"> 468226031Sstas<div class="memproto"> 469226031Sstas <table class="memname"> 470226031Sstas <tr> 471226031Sstas <td class="memname">int heim_ntlm_encode_type1 </td> 472226031Sstas <td>(</td> 473226031Sstas <td class="paramtype">const struct <a class="el" href="structntlm__type1.html">ntlm_type1</a> * </td> 474226031Sstas <td class="paramname"> <em>type1</em>, </td> 475226031Sstas </tr> 476226031Sstas <tr> 477226031Sstas <td class="paramkey"></td> 478226031Sstas <td></td> 479226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 480226031Sstas <td class="paramname"> <em>data</em></td><td> </td> 481226031Sstas </tr> 482226031Sstas <tr> 483226031Sstas <td></td> 484226031Sstas <td>)</td> 485226031Sstas <td></td><td></td><td></td> 486226031Sstas </tr> 487226031Sstas </table> 488226031Sstas</div> 489226031Sstas<div class="memdoc"> 490226031Sstas 491226031Sstas<p> 492226031SstasEncodes an <a class="el" href="structntlm__type1.html">ntlm_type1</a> message.<p> 493226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 494226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 495226031Sstas <tr><td valign="top"></td><td valign="top"><em>type1</em> </td><td>the <a class="el" href="structntlm__type1.html">ntlm_type1</a> message to encode. </td></tr> 496226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>is the return buffer with the encoded message, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 497226031Sstas </table> 498226031Sstas</dl> 499226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 500226031Sstas 501226031Sstas</div> 502226031Sstas</div><p> 503226031Sstas<a class="anchor" name="g2860c6f6d497255eb433adc8cacc49dd"></a><!-- doxytag: member="ntlm.c::heim_ntlm_encode_type2" ref="g2860c6f6d497255eb433adc8cacc49dd" args="(const struct ntlm_type2 *type2, struct ntlm_buf *data)" --> 504226031Sstas<div class="memitem"> 505226031Sstas<div class="memproto"> 506226031Sstas <table class="memname"> 507226031Sstas <tr> 508226031Sstas <td class="memname">int heim_ntlm_encode_type2 </td> 509226031Sstas <td>(</td> 510226031Sstas <td class="paramtype">const struct <a class="el" href="structntlm__type2.html">ntlm_type2</a> * </td> 511226031Sstas <td class="paramname"> <em>type2</em>, </td> 512226031Sstas </tr> 513226031Sstas <tr> 514226031Sstas <td class="paramkey"></td> 515226031Sstas <td></td> 516226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 517226031Sstas <td class="paramname"> <em>data</em></td><td> </td> 518226031Sstas </tr> 519226031Sstas <tr> 520226031Sstas <td></td> 521226031Sstas <td>)</td> 522226031Sstas <td></td><td></td><td></td> 523226031Sstas </tr> 524226031Sstas </table> 525226031Sstas</div> 526226031Sstas<div class="memdoc"> 527226031Sstas 528226031Sstas<p> 529226031SstasEncodes an <a class="el" href="structntlm__type2.html">ntlm_type2</a> message.<p> 530226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 531226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 532226031Sstas <tr><td valign="top"></td><td valign="top"><em>type2</em> </td><td>the <a class="el" href="structntlm__type2.html">ntlm_type2</a> message to encode. </td></tr> 533226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>is the return buffer with the encoded message, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 534226031Sstas </table> 535226031Sstas</dl> 536226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 537226031Sstas 538226031Sstas</div> 539226031Sstas</div><p> 540226031Sstas<a class="anchor" name="g9cf026be6e602c22d62aa9e47e85c7c2"></a><!-- doxytag: member="ntlm.c::heim_ntlm_encode_type3" ref="g9cf026be6e602c22d62aa9e47e85c7c2" args="(const struct ntlm_type3 *type3, struct ntlm_buf *data)" --> 541226031Sstas<div class="memitem"> 542226031Sstas<div class="memproto"> 543226031Sstas <table class="memname"> 544226031Sstas <tr> 545226031Sstas <td class="memname">int heim_ntlm_encode_type3 </td> 546226031Sstas <td>(</td> 547226031Sstas <td class="paramtype">const struct <a class="el" href="structntlm__type3.html">ntlm_type3</a> * </td> 548226031Sstas <td class="paramname"> <em>type3</em>, </td> 549226031Sstas </tr> 550226031Sstas <tr> 551226031Sstas <td class="paramkey"></td> 552226031Sstas <td></td> 553226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 554226031Sstas <td class="paramname"> <em>data</em></td><td> </td> 555226031Sstas </tr> 556226031Sstas <tr> 557226031Sstas <td></td> 558226031Sstas <td>)</td> 559226031Sstas <td></td><td></td><td></td> 560226031Sstas </tr> 561226031Sstas </table> 562226031Sstas</div> 563226031Sstas<div class="memdoc"> 564226031Sstas 565226031Sstas<p> 566226031SstasEncodes an <a class="el" href="structntlm__type3.html">ntlm_type3</a> message.<p> 567226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 568226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 569226031Sstas <tr><td valign="top"></td><td valign="top"><em>type3</em> </td><td>the <a class="el" href="structntlm__type3.html">ntlm_type3</a> message to encode. </td></tr> 570226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>is the return buffer with the encoded message, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 571226031Sstas </table> 572226031Sstas</dl> 573226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 574226031Sstas 575226031Sstas</div> 576226031Sstas</div><p> 577226031Sstas<a class="anchor" name="g5f6c313a3a7258cda5f09bb44f8d1776"></a><!-- doxytag: member="ntlm.c::heim_ntlm_free_buf" ref="g5f6c313a3a7258cda5f09bb44f8d1776" args="(struct ntlm_buf *p)" --> 578226031Sstas<div class="memitem"> 579226031Sstas<div class="memproto"> 580226031Sstas <table class="memname"> 581226031Sstas <tr> 582226031Sstas <td class="memname">void heim_ntlm_free_buf </td> 583226031Sstas <td>(</td> 584226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 585226031Sstas <td class="paramname"> <em>p</em> </td> 586226031Sstas <td> ) </td> 587226031Sstas <td></td> 588226031Sstas </tr> 589226031Sstas </table> 590226031Sstas</div> 591226031Sstas<div class="memdoc"> 592226031Sstas 593226031Sstas<p> 594226031Sstasheim_ntlm_free_buf frees the ntlm buffer<p> 595226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 596226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 597226031Sstas <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>buffer to be freed </td></tr> 598226031Sstas </table> 599226031Sstas</dl> 600226031Sstas 601226031Sstas</div> 602226031Sstas</div><p> 603226031Sstas<a class="anchor" name="g704ec8c5dba05ef57186d242ff165565"></a><!-- doxytag: member="ntlm.c::heim_ntlm_free_targetinfo" ref="g704ec8c5dba05ef57186d242ff165565" args="(struct ntlm_targetinfo *ti)" --> 604226031Sstas<div class="memitem"> 605226031Sstas<div class="memproto"> 606226031Sstas <table class="memname"> 607226031Sstas <tr> 608226031Sstas <td class="memname">void heim_ntlm_free_targetinfo </td> 609226031Sstas <td>(</td> 610226031Sstas <td class="paramtype">struct ntlm_targetinfo * </td> 611226031Sstas <td class="paramname"> <em>ti</em> </td> 612226031Sstas <td> ) </td> 613226031Sstas <td></td> 614226031Sstas </tr> 615226031Sstas </table> 616226031Sstas</div> 617226031Sstas<div class="memdoc"> 618226031Sstas 619226031Sstas<p> 620226031SstasFrees the ntlm_targetinfo message<p> 621226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 622226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 623226031Sstas <tr><td valign="top"></td><td valign="top"><em>ti</em> </td><td>targetinfo to be freed </td></tr> 624226031Sstas </table> 625226031Sstas</dl> 626226031Sstas 627226031Sstas</div> 628226031Sstas</div><p> 629226031Sstas<a class="anchor" name="g76fa6caf3f539e24008e31613f5eb663"></a><!-- doxytag: member="ntlm.c::heim_ntlm_free_type1" ref="g76fa6caf3f539e24008e31613f5eb663" args="(struct ntlm_type1 *data)" --> 630226031Sstas<div class="memitem"> 631226031Sstas<div class="memproto"> 632226031Sstas <table class="memname"> 633226031Sstas <tr> 634226031Sstas <td class="memname">void heim_ntlm_free_type1 </td> 635226031Sstas <td>(</td> 636226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__type1.html">ntlm_type1</a> * </td> 637226031Sstas <td class="paramname"> <em>data</em> </td> 638226031Sstas <td> ) </td> 639226031Sstas <td></td> 640226031Sstas </tr> 641226031Sstas </table> 642226031Sstas</div> 643226031Sstas<div class="memdoc"> 644226031Sstas 645226031Sstas<p> 646226031SstasFrees the <a class="el" href="structntlm__type1.html">ntlm_type1</a> message<p> 647226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 648226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 649226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>message to be freed </td></tr> 650226031Sstas </table> 651226031Sstas</dl> 652226031Sstas 653226031Sstas</div> 654226031Sstas</div><p> 655226031Sstas<a class="anchor" name="g8fde84c86f1c7c9f730f7fb4acedcb43"></a><!-- doxytag: member="ntlm.c::heim_ntlm_free_type2" ref="g8fde84c86f1c7c9f730f7fb4acedcb43" args="(struct ntlm_type2 *data)" --> 656226031Sstas<div class="memitem"> 657226031Sstas<div class="memproto"> 658226031Sstas <table class="memname"> 659226031Sstas <tr> 660226031Sstas <td class="memname">void heim_ntlm_free_type2 </td> 661226031Sstas <td>(</td> 662226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__type2.html">ntlm_type2</a> * </td> 663226031Sstas <td class="paramname"> <em>data</em> </td> 664226031Sstas <td> ) </td> 665226031Sstas <td></td> 666226031Sstas </tr> 667226031Sstas </table> 668226031Sstas</div> 669226031Sstas<div class="memdoc"> 670226031Sstas 671226031Sstas<p> 672226031SstasFrees the <a class="el" href="structntlm__type2.html">ntlm_type2</a> message<p> 673226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 674226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 675226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>message to be freed </td></tr> 676226031Sstas </table> 677226031Sstas</dl> 678226031Sstas 679226031Sstas</div> 680226031Sstas</div><p> 681226031Sstas<a class="anchor" name="gc4e6d01e5247b8540d41ccbbf1031319"></a><!-- doxytag: member="ntlm.c::heim_ntlm_free_type3" ref="gc4e6d01e5247b8540d41ccbbf1031319" args="(struct ntlm_type3 *data)" --> 682226031Sstas<div class="memitem"> 683226031Sstas<div class="memproto"> 684226031Sstas <table class="memname"> 685226031Sstas <tr> 686226031Sstas <td class="memname">void heim_ntlm_free_type3 </td> 687226031Sstas <td>(</td> 688226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__type3.html">ntlm_type3</a> * </td> 689226031Sstas <td class="paramname"> <em>data</em> </td> 690226031Sstas <td> ) </td> 691226031Sstas <td></td> 692226031Sstas </tr> 693226031Sstas </table> 694226031Sstas</div> 695226031Sstas<div class="memdoc"> 696226031Sstas 697226031Sstas<p> 698226031SstasFrees the <a class="el" href="structntlm__type3.html">ntlm_type3</a> message<p> 699226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 700226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 701226031Sstas <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>message to be freed </td></tr> 702226031Sstas </table> 703226031Sstas</dl> 704226031Sstas 705226031Sstas</div> 706226031Sstas</div><p> 707226031Sstas<a class="anchor" name="g6ef0049af05a83d73b7a3d962e679c2a"></a><!-- doxytag: member="ntlm.c::heim_ntlm_keyex_unwrap" ref="g6ef0049af05a83d73b7a3d962e679c2a" args="(struct ntlm_buf *baseKey, struct ntlm_buf *encryptedSession, struct ntlm_buf *session)" --> 708226031Sstas<div class="memitem"> 709226031Sstas<div class="memproto"> 710226031Sstas <table class="memname"> 711226031Sstas <tr> 712226031Sstas <td class="memname">int heim_ntlm_keyex_unwrap </td> 713226031Sstas <td>(</td> 714226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 715226031Sstas <td class="paramname"> <em>baseKey</em>, </td> 716226031Sstas </tr> 717226031Sstas <tr> 718226031Sstas <td class="paramkey"></td> 719226031Sstas <td></td> 720226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 721226031Sstas <td class="paramname"> <em>encryptedSession</em>, </td> 722226031Sstas </tr> 723226031Sstas <tr> 724226031Sstas <td class="paramkey"></td> 725226031Sstas <td></td> 726226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 727226031Sstas <td class="paramname"> <em>session</em></td><td> </td> 728226031Sstas </tr> 729226031Sstas <tr> 730226031Sstas <td></td> 731226031Sstas <td>)</td> 732226031Sstas <td></td><td></td><td></td> 733226031Sstas </tr> 734226031Sstas </table> 735226031Sstas</div> 736226031Sstas<div class="memdoc"> 737226031Sstas 738226031Sstas<p> 739226031SstasGiven a key and encrypted session, unwrap the session key<p> 740226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 741226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 742226031Sstas <tr><td valign="top"></td><td valign="top"><em>baseKey</em> </td><td>the sessionBaseKey </td></tr> 743226031Sstas <tr><td valign="top"></td><td valign="top"><em>encryptedSession</em> </td><td>encrypted session, type3.session field. </td></tr> 744226031Sstas <tr><td valign="top"></td><td valign="top"><em>session</em> </td><td>generated session nonce, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 745226031Sstas </table> 746226031Sstas</dl> 747226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 748226031Sstas 749226031Sstas</div> 750226031Sstas</div><p> 751226031Sstas<a class="anchor" name="g254ee0a4d5a2594833e36697ad575d7e"></a><!-- doxytag: member="ntlm.c::heim_ntlm_nt_key" ref="g254ee0a4d5a2594833e36697ad575d7e" args="(const char *password, struct ntlm_buf *key)" --> 752226031Sstas<div class="memitem"> 753226031Sstas<div class="memproto"> 754226031Sstas <table class="memname"> 755226031Sstas <tr> 756226031Sstas <td class="memname">int heim_ntlm_nt_key </td> 757226031Sstas <td>(</td> 758226031Sstas <td class="paramtype">const char * </td> 759226031Sstas <td class="paramname"> <em>password</em>, </td> 760226031Sstas </tr> 761226031Sstas <tr> 762226031Sstas <td class="paramkey"></td> 763226031Sstas <td></td> 764226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 765226031Sstas <td class="paramname"> <em>key</em></td><td> </td> 766226031Sstas </tr> 767226031Sstas <tr> 768226031Sstas <td></td> 769226031Sstas <td>)</td> 770226031Sstas <td></td><td></td><td></td> 771226031Sstas </tr> 772226031Sstas </table> 773226031Sstas</div> 774226031Sstas<div class="memdoc"> 775226031Sstas 776226031Sstas<p> 777226031SstasCalculate the NTLM key, the password is assumed to be in UTF8.<p> 778226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 779226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 780226031Sstas <tr><td valign="top"></td><td valign="top"><em>password</em> </td><td>password to calcute the key for. </td></tr> 781226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>calcuted key, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>.</td></tr> 782226031Sstas </table> 783226031Sstas</dl> 784226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 785226031Sstas 786226031Sstas</div> 787226031Sstas</div><p> 788226031Sstas<a class="anchor" name="g4c4c32652527acead6848052615ae284"></a><!-- doxytag: member="ntlm.c::heim_ntlm_ntlmv2_key" ref="g4c4c32652527acead6848052615ae284" args="(const void *key, size_t len, const char *username, const char *target, unsigned char ntlmv2[16])" --> 789226031Sstas<div class="memitem"> 790226031Sstas<div class="memproto"> 791226031Sstas <table class="memname"> 792226031Sstas <tr> 793226031Sstas <td class="memname">int heim_ntlm_ntlmv2_key </td> 794226031Sstas <td>(</td> 795226031Sstas <td class="paramtype">const void * </td> 796226031Sstas <td class="paramname"> <em>key</em>, </td> 797226031Sstas </tr> 798226031Sstas <tr> 799226031Sstas <td class="paramkey"></td> 800226031Sstas <td></td> 801226031Sstas <td class="paramtype">size_t </td> 802226031Sstas <td class="paramname"> <em>len</em>, </td> 803226031Sstas </tr> 804226031Sstas <tr> 805226031Sstas <td class="paramkey"></td> 806226031Sstas <td></td> 807226031Sstas <td class="paramtype">const char * </td> 808226031Sstas <td class="paramname"> <em>username</em>, </td> 809226031Sstas </tr> 810226031Sstas <tr> 811226031Sstas <td class="paramkey"></td> 812226031Sstas <td></td> 813226031Sstas <td class="paramtype">const char * </td> 814226031Sstas <td class="paramname"> <em>target</em>, </td> 815226031Sstas </tr> 816226031Sstas <tr> 817226031Sstas <td class="paramkey"></td> 818226031Sstas <td></td> 819226031Sstas <td class="paramtype">unsigned char </td> 820226031Sstas <td class="paramname"> <em>ntlmv2</em>[16]</td><td> </td> 821226031Sstas </tr> 822226031Sstas <tr> 823226031Sstas <td></td> 824226031Sstas <td>)</td> 825226031Sstas <td></td><td></td><td></td> 826226031Sstas </tr> 827226031Sstas </table> 828226031Sstas</div> 829226031Sstas<div class="memdoc"> 830226031Sstas 831226031Sstas<p> 832226031SstasGenerates an NTLMv2 session key.<p> 833226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 834226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 835226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>the ntlm key </td></tr> 836226031Sstas <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of key </td></tr> 837226031Sstas <tr><td valign="top"></td><td valign="top"><em>username</em> </td><td>name of the user, as sent in the message, assumed to be in UTF8. </td></tr> 838226031Sstas <tr><td valign="top"></td><td valign="top"><em>target</em> </td><td>the name of the target, assumed to be in UTF8. </td></tr> 839226031Sstas <tr><td valign="top"></td><td valign="top"><em>ntlmv2</em> </td><td>the ntlmv2 session key</td></tr> 840226031Sstas </table> 841226031Sstas</dl> 842226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, or an error code on failure. </dd></dl> 843226031Sstas 844226031Sstas</div> 845226031Sstas</div><p> 846226031Sstas<a class="anchor" name="g3b3d6a5187cab6bfe656afa7a8273ca6"></a><!-- doxytag: member="ntlm.c::heim_ntlm_verify_ntlm2" ref="g3b3d6a5187cab6bfe656afa7a8273ca6" args="(const void *key, size_t len, const char *username, const char *target, time_t now, const unsigned char serverchallenge[8], const struct ntlm_buf *answer, struct ntlm_buf *infotarget, unsigned char ntlmv2[16])" --> 847226031Sstas<div class="memitem"> 848226031Sstas<div class="memproto"> 849226031Sstas <table class="memname"> 850226031Sstas <tr> 851226031Sstas <td class="memname">int heim_ntlm_verify_ntlm2 </td> 852226031Sstas <td>(</td> 853226031Sstas <td class="paramtype">const void * </td> 854226031Sstas <td class="paramname"> <em>key</em>, </td> 855226031Sstas </tr> 856226031Sstas <tr> 857226031Sstas <td class="paramkey"></td> 858226031Sstas <td></td> 859226031Sstas <td class="paramtype">size_t </td> 860226031Sstas <td class="paramname"> <em>len</em>, </td> 861226031Sstas </tr> 862226031Sstas <tr> 863226031Sstas <td class="paramkey"></td> 864226031Sstas <td></td> 865226031Sstas <td class="paramtype">const char * </td> 866226031Sstas <td class="paramname"> <em>username</em>, </td> 867226031Sstas </tr> 868226031Sstas <tr> 869226031Sstas <td class="paramkey"></td> 870226031Sstas <td></td> 871226031Sstas <td class="paramtype">const char * </td> 872226031Sstas <td class="paramname"> <em>target</em>, </td> 873226031Sstas </tr> 874226031Sstas <tr> 875226031Sstas <td class="paramkey"></td> 876226031Sstas <td></td> 877226031Sstas <td class="paramtype">time_t </td> 878226031Sstas <td class="paramname"> <em>now</em>, </td> 879226031Sstas </tr> 880226031Sstas <tr> 881226031Sstas <td class="paramkey"></td> 882226031Sstas <td></td> 883226031Sstas <td class="paramtype">const unsigned char </td> 884226031Sstas <td class="paramname"> <em>serverchallenge</em>[8], </td> 885226031Sstas </tr> 886226031Sstas <tr> 887226031Sstas <td class="paramkey"></td> 888226031Sstas <td></td> 889226031Sstas <td class="paramtype">const struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 890226031Sstas <td class="paramname"> <em>answer</em>, </td> 891226031Sstas </tr> 892226031Sstas <tr> 893226031Sstas <td class="paramkey"></td> 894226031Sstas <td></td> 895226031Sstas <td class="paramtype">struct <a class="el" href="structntlm__buf.html">ntlm_buf</a> * </td> 896226031Sstas <td class="paramname"> <em>infotarget</em>, </td> 897226031Sstas </tr> 898226031Sstas <tr> 899226031Sstas <td class="paramkey"></td> 900226031Sstas <td></td> 901226031Sstas <td class="paramtype">unsigned char </td> 902226031Sstas <td class="paramname"> <em>ntlmv2</em>[16]</td><td> </td> 903226031Sstas </tr> 904226031Sstas <tr> 905226031Sstas <td></td> 906226031Sstas <td>)</td> 907226031Sstas <td></td><td></td><td></td> 908226031Sstas </tr> 909226031Sstas </table> 910226031Sstas</div> 911226031Sstas<div class="memdoc"> 912226031Sstas 913226031Sstas<p> 914226031SstasVerify NTLMv2 response.<p> 915226031Sstas<dl compact><dt><b>Parameters:</b></dt><dd> 916226031Sstas <table border="0" cellspacing="2" cellpadding="0"> 917226031Sstas <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>the ntlm key </td></tr> 918226031Sstas <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of key </td></tr> 919226031Sstas <tr><td valign="top"></td><td valign="top"><em>username</em> </td><td>name of the user, as sent in the message, assumed to be in UTF8. </td></tr> 920226031Sstas <tr><td valign="top"></td><td valign="top"><em>target</em> </td><td>the name of the target, assumed to be in UTF8. </td></tr> 921226031Sstas <tr><td valign="top"></td><td valign="top"><em>now</em> </td><td>the time now (0 if the library should pick it up itself) </td></tr> 922226031Sstas <tr><td valign="top"></td><td valign="top"><em>serverchallenge</em> </td><td>challenge as sent by the server in the type2 message. </td></tr> 923226031Sstas <tr><td valign="top"></td><td valign="top"><em>answer</em> </td><td>ntlm response answer, should be freed with <a class="el" href="group__ntlm__core.html#g5f6c313a3a7258cda5f09bb44f8d1776">heim_ntlm_free_buf()</a>. </td></tr> 924226031Sstas <tr><td valign="top"></td><td valign="top"><em>infotarget</em> </td><td>infotarget as sent by the server in the type2 message. </td></tr> 925226031Sstas <tr><td valign="top"></td><td valign="top"><em>ntlmv2</em> </td><td>calculated session key</td></tr> 926226031Sstas </table> 927226031Sstas</dl> 928226031Sstas<dl class="return" compact><dt><b>Returns:</b></dt><dd>In case of success 0 is return, an errors, a errno in what went wrong. </dd></dl> 929226031Sstas 930226031Sstas</div> 931226031Sstas</div><p> 932226031Sstas</div> 933226031Sstas<hr size="1"><address style="text-align: right;"><small> 934234027SstasGenerated on Wed Jan 11 14:07:50 2012 for Heimdalntlmlibrary by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address> 935226031Sstas</body> 936226031Sstas</html> 937