On 3/12/08, Mirek Zajic <za...@nextsoft.cz> wrote: > Hello, > I have finally made some changes to the NTLMv2 patch according to Alon's > comments. Now it should also be architecture independent. > > Miroslav Zajic > NextSoft s.r.o.
Hi! Great! Some more comments... :) > + timestamp_ull = openvpn_time(NULL); > + timestamp_ull = (timestamp_ull + UINT64(11644473600)) * > UINT64(10000000); Just noticed that openvpn has: openvpn_gettimeofday() which works also for WIN32... Maybe use this one? > + msg_buf[sb_offset + 5] = (unsigned char)((*msg_bufpos & 0xff00) >> 8); always & such with 0xff. > diff -Naur openvpn-2.1/ntlm.h openvpn-NTLMv2-predelane-2.1/ntlm.h > --- openvpn-2.1/ntlm.h 2008-01-13 21:25:52.935292800 +0100 > +++ openvpn-NTLMv2-predelane-2.1/ntlm.h 2008-03-12 11:35:36.296875000 > +0100 > @@ -3,6 +3,18 @@ > > #if NTLM > > +/* 64bit datatype macros */ > +#ifdef _MSC_VER > + /* MS compilers */ > +#define UINTEGER64 __int64 > +#define UINT64(c) c ## Ui64 > +#else > + /* Non MS compilers */ > +#define UINTEGER64 unsigned long long > +#define UINT64(c) c ## LL > +#endif > + > Why not use long long for both platforms, it is already used in common.h... Also you can use ull suffix for both platforms. Anyway... this belongs to the .c file, it is not used by any other files. But I don't think it is required at all. Alon.