RE: [PATCH] Added AUTH NTLM for SMTP
Date: Wed, 10 Aug 2011 15:45:37 +0100
On Tue, 9 Aug 2011, Yang Tse wrote:
> Pull or pull and rebase to keep the good work.
I pulled the changes down this morning and checked out the differences.
Since then I have cracked on with producing the second patch which is
attached. This one moves the ntlm code to the new curl_ntlm module and tries
to simple move the code (as was) and not rework it or reformat it, etc... I
have spotted a few areas that still need tiding up, that I had missed
yesterday, but I will take the opportunity at the end to produce a separate
patch for those.
You will note that the function declarations for
Curl_ntlm_create_type1_message and Curl_ntlm_create_type3_message() are
slightly different from my original patch, from last week, as the "host"
parameter is no longer required. I had misunderstood how the original code
worked and as such had passed the result of Curl_gethostname() into both of
them, which didn't break anything but nonetheless is not required by either
the Windows SSPI functions or by the native creation of a type 1 message -
it is only needed in the native type 3 message creation.
You will note that InitializeSecurityContextA() takes "host" as the third
parameter but will see that it is never populated until much later on in the
code (the native type 3 creation) and as such an empty string is passed to
both InitializeSecurityContextA() calls. According to the MSDN documentation
this should specify "A pointer to a null-terminated string that indicates
the service principal name (SPN) or the security context of the destination
server" - as such I would recommend renaming the variable to "destination"
or "target" at some point, but I will do that in a final patch.
Received on 2011-08-10