Loading lib/curl_ntlm_msgs.c +1 −22 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #define BUILDING_CURL_NTLM_MSGS_C #include "curl_ntlm_msgs.h" #include "curl_sasl.h" #include "endian.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> Loading Loading @@ -148,28 +149,6 @@ static void ntlm_print_hex(FILE *handle, const char *buf, size_t len) # define DEBUG_OUT(x) Curl_nop_stmt #endif /* * This function converts from the little endian format used in the * incoming package to whatever endian format we're using natively. * Argument is a pointer to a 4 byte buffer. */ static unsigned int readint_le(unsigned char *buf) { return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) | ((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24); } /* * This function converts from the little endian format used in the incoming * package to whatever endian format we're using natively. Argument is a * pointer to a 2 byte buffer. */ static unsigned short readshort_le(unsigned char *buf) { return (unsigned short)(((unsigned short)buf[0]) | ((unsigned short)buf[1] << 8)); } /* * ntlm_decode_type2_target() * Loading lib/endian.c +22 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,25 @@ #include "curl_setup.h" #include "endian.h" /* * This function converts from the little endian format used in the incoming * package to whatever endian format we're using natively. Argument is a * pointer to a 2 byte buffer. */ unsigned short readshort_le(unsigned char *buf) { return (unsigned short)(((unsigned short)buf[0]) | ((unsigned short)buf[1] << 8)); } /* * This function converts from the little endian format used in the * incoming package to whatever endian format we're using natively. * Argument is a pointer to a 4 byte buffer. */ unsigned int readint_le(unsigned char *buf) { return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) | ((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24); } lib/endian.h +3 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,7 @@ * ***************************************************************************/ unsigned short readshort_le(unsigned char *buf); unsigned int readint_le(unsigned char *buf); #endif /* HEADER_CURL_ENDIAN_H */ Loading
lib/curl_ntlm_msgs.c +1 −22 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #define BUILDING_CURL_NTLM_MSGS_C #include "curl_ntlm_msgs.h" #include "curl_sasl.h" #include "endian.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> Loading Loading @@ -148,28 +149,6 @@ static void ntlm_print_hex(FILE *handle, const char *buf, size_t len) # define DEBUG_OUT(x) Curl_nop_stmt #endif /* * This function converts from the little endian format used in the * incoming package to whatever endian format we're using natively. * Argument is a pointer to a 4 byte buffer. */ static unsigned int readint_le(unsigned char *buf) { return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) | ((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24); } /* * This function converts from the little endian format used in the incoming * package to whatever endian format we're using natively. Argument is a * pointer to a 2 byte buffer. */ static unsigned short readshort_le(unsigned char *buf) { return (unsigned short)(((unsigned short)buf[0]) | ((unsigned short)buf[1] << 8)); } /* * ntlm_decode_type2_target() * Loading
lib/endian.c +22 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,25 @@ #include "curl_setup.h" #include "endian.h" /* * This function converts from the little endian format used in the incoming * package to whatever endian format we're using natively. Argument is a * pointer to a 2 byte buffer. */ unsigned short readshort_le(unsigned char *buf) { return (unsigned short)(((unsigned short)buf[0]) | ((unsigned short)buf[1] << 8)); } /* * This function converts from the little endian format used in the * incoming package to whatever endian format we're using natively. * Argument is a pointer to a 4 byte buffer. */ unsigned int readint_le(unsigned char *buf) { return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) | ((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24); }
lib/endian.h +3 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,7 @@ * ***************************************************************************/ unsigned short readshort_le(unsigned char *buf); unsigned int readint_le(unsigned char *buf); #endif /* HEADER_CURL_ENDIAN_H */