summaryrefslogtreecommitdiff
path: root/source3/libsmb/smbdes.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/smbdes.c')
-rw-r--r--source3/libsmb/smbdes.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/smbdes.c b/source3/libsmb/smbdes.c
index 579d0dd8b4..fa7d64cec8 100644
--- a/source3/libsmb/smbdes.c
+++ b/source3/libsmb/smbdes.c
@@ -365,6 +365,10 @@ void SamOEMhash( unsigned char *data, unsigned char *key, int val)
unsigned char index_j = 0;
unsigned char j = 0;
int ind;
+ int len = 0;
+ if (val == 1) len = 516;
+ if (val == 0) len = 16;
+ if (val == 2) len = 68;
for (ind = 0; ind < 256; ind++)
{
@@ -381,7 +385,7 @@ void SamOEMhash( unsigned char *data, unsigned char *key, int val)
s_box[ind] = s_box[j];
s_box[j] = tc;
}
- for( ind = 0; ind < (val ? 516 : 16); ind++)
+ for( ind = 0; ind < len; ind++)
{
unsigned char tc;
unsigned char t;