]> Pileus Git - ~andy/fetchmail/blobdiff - smbencrypt.c
Add Esperanto-language translation.
[~andy/fetchmail] / smbencrypt.c
index 0656863c718576abe82acd6889f8441701a5f141..2714064cbf0bf4239b1659f87dc4334cf6a17755 100644 (file)
@@ -26,6 +26,7 @@ extern int DEBUGLEVEL;
 
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <string.h>
 #include <ctype.h>
 #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