X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=smbencrypt.c;h=2714064cbf0bf4239b1659f87dc4334cf6a17755;hb=33cddbff323efcbae1503e91e6e65b2733da80c7;hp=0656863c718576abe82acd6889f8441701a5f141;hpb=6478e0c9185d2f37eb5efa95d0d726d77b2afb70;p=~andy%2Ffetchmail diff --git a/smbencrypt.c b/smbencrypt.c index 0656863c..2714064c 100644 --- a/smbencrypt.c +++ b/smbencrypt.c @@ -26,6 +26,7 @@ extern int DEBUGLEVEL; #include #include +#include #include #include #include "smbbyteorder.h" @@ -61,12 +62,6 @@ static size_t skip_multibyte_char(char c) return 0; } - -/******************************************************************* -safe string copy into a known length string. maxlength does not -include the terminating zero. -********************************************************************/ - static void strupper(char *s) { while (*s) @@ -150,7 +145,7 @@ static int _my_mbstowcs(int16_t *dst, unsigned char *src, int len) * Creates the MD4 Hash of the users password in NT UNICODE. */ -static void E_md4hash(uchar *passwd, uchar *p16) +static void E_md4hash(unsigned char *passwd, unsigned char *p16) { int len; int16_t wpwd[129]; @@ -180,7 +175,6 @@ void SMBOWFencrypt(unsigned char passwd[16], unsigned char *c8, unsigned char p2 } /* Does the NT MD4 hash then des encryption. */ - void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24) { unsigned char p21[21]; @@ -197,43 +191,3 @@ void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24) dump_data(100, (char *)p24, 24); #endif } - -#if 0 - -BOOL make_oem_passwd_hash(char data[516], const char *passwd, unsigned char old_pw_hash[16], BOOL unicode) -{ - int new_pw_len = strlen(passwd) * (unicode ? 2 : 1); - - if (new_pw_len > 512) - { - DEBUG(0,("make_oem_passwd_hash: new password is too long.\n")); - return False; - } - - /* - * Now setup the data area. - * We need to generate a random fill - * for this area to make it harder to - * decrypt. JRA. - */ - generate_random_buffer((unsigned char *)data, 516, False); - if (unicode) - { - struni2( &data[512 - new_pw_len], passwd); - } - else - { - fstrcpy( &data[512 - new_pw_len], passwd); - } - SIVAL(data, 512, new_pw_len); - -#ifdef DEBUG_PASSWORD - DEBUG(100,("make_oem_passwd_hash\n")); - dump_data(100, data, 516); -#endif - SamOEMhash( (unsigned char *)data, (unsigned char *)old_pw_hash, True); - - return True; -} - -#endif