From 9733de710dcd9e1d677c07aa3e60c412c836d9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 25 Jun 2007 19:22:02 +0000 Subject: [PATCH] Add comments. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21317 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/ntlm/ntlm.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/ntlm/ntlm.c b/lib/ntlm/ntlm.c index d8064c6ac..eab7fae81 100644 --- a/lib/ntlm/ntlm.c +++ b/lib/ntlm/ntlm.c @@ -52,6 +52,12 @@ RCSID("$Id$"); #include +/* + * Source of NTLM information: + * http://davenport.sourceforge.net/ntlm.html + */ + + struct sec_buffer { uint16_t length; uint16_t allocated; @@ -760,6 +766,10 @@ splitandenc(unsigned char *hash, memset(key, 0, sizeof(key)); } +/* + * String-to-key function for NTLM + */ + int heim_ntlm_nt_key(const char *password, struct ntlm_buf *key) { @@ -784,6 +794,10 @@ heim_ntlm_nt_key(const char *password, struct ntlm_buf *key) return 0; } +/* + * Calculate NTLMv1 response hash + */ + int heim_ntlm_calculate_ntlm1(void *key, size_t len, unsigned char challange[8], @@ -809,6 +823,10 @@ heim_ntlm_calculate_ntlm1(void *key, size_t len, return 0; } +/* + * Calculate NTLMv1 master key + */ + int heim_ntlm_build_ntlm1_master(void *key, size_t len, struct ntlm_buf *session, @@ -914,6 +932,10 @@ nt2unixtime(uint64_t t) } +/* + * Calculate NTLMv2 response + */ + int heim_ntlm_calculate_ntlm2(const void *key, size_t len, const char *username, @@ -998,6 +1020,10 @@ out: static const int authtimediff = 3600 * 2; /* 2 hours */ +/* + * Verify NTLMv2 response. + */ + int heim_ntlm_verify_ntlm2(const void *key, size_t len, const char *username, @@ -1098,9 +1124,9 @@ out: /* - * Calculate the NTLM2 Session Response as per pg 24 of Davenport NTLM - * document http://davenport.sourceforge.net/ntlm.html + * Calculate the NTLM2 Session Response */ + int heim_ntlm_calculate_ntlm2_sess(const unsigned char clnt_nonce[8], const unsigned char svr_chal[8],