~ubuntu-branches/ubuntu/dapper/freeradius/dapper-updates

« back to all changes in this revision

Viewing changes to src/modules/rlm_smb/smbdes.c

  • Committer: Bazaar Package Importer
  • Author(s): Paul Hampson
  • Date: 2004-12-29 20:19:42 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041229201942-uj2e95la965uthc7
Tags: 1.0.1-2
* freeradius-dialupadmin Suggests php4-mysql | php4-pgsql
   Closes: #279419
* Added a two-second pause to restart in init.d script
   Closes: #262635
* FreeRADIUS module packages now depend on the same source
  version of the main FreeRADIUS package.
   Closes: #284353
* FreeRADIUS-dialupadmin's default paths in admin.conf are
  now correct.
   Closes: #280942
* FreeRADIUS-dialupadmin's help.php3 can now find README.
   Closes: #280941
* Fixes stolen from 1.0.2 CVS:
  - Bug fix to make udpfromto code work
  - radrelay shouldn't dump core if it can't read a VP from the
    detail file.
  - Only initialize the random pool once.
  - In rlm_sql, don't escape characters twice.
  - In rlm_ldap, only claim Auth-Type if a plain text password is present.
  - Locking fixes in threading code
  - Fix building on gcc-4.0 by not trying to access static auth_port from
    other files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
 
1
/*
2
2
   Unix SMB/Netbios implementation.
3
3
   Version 1.9.
4
4
 
5
 
   a partial implementation of DES designed for use in the 
 
5
   a partial implementation of DES designed for use in the
6
6
   SMB authentication protocol
7
7
 
8
8
   Copyright (C) Andrew Tridgell 1997
9
 
   
 
9
 
10
10
   This program is free software; you can redistribute it and/or modify
11
11
   it under the terms of the GNU General Public License as published by
12
12
   the Free Software Foundation; either version 2 of the License, or
13
13
   (at your option) any later version.
14
 
   
 
14
 
15
15
   This program is distributed in the hope that it will be useful,
16
16
   but WITHOUT ANY WARRANTY; without even the implied warranty of
17
17
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
18
   GNU General Public License for more details.
19
 
   
 
19
 
20
20
   You should have received a copy of the GNU General Public License
21
21
   along with this program; if not, write to the Free Software
22
22
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
23
*/
24
24
 
25
25
 
26
 
/* NOTES: 
 
26
/* NOTES:
27
27
 
28
28
   This code makes no attempt to be fast! In fact, it is a very
29
 
   slow implementation 
 
29
   slow implementation
30
30
 
31
31
   This code is NOT a complete DES implementation. It implements only
32
32
   the minimum necessary for SMB authentication, as used by all SMB
201
201
                lshift(c, sc[i], 28);
202
202
                lshift(d, sc[i], 28);
203
203
 
204
 
                concat(cd, c, d, 28, 28); 
205
 
                permute(ki[i], cd, perm2, 48); 
 
204
                concat(cd, c, d, 28, 28);
 
205
                permute(ki[i], cd, perm2, 48);
206
206
        }
207
207
 
208
208
        permute(pd1, in, perm3, 64);
232
232
                        int m, n;
233
233
                        m = (b[j][0]<<1) | b[j][5];
234
234
 
235
 
                        n = (b[j][1]<<3) | (b[j][2]<<2) | (b[j][3]<<1) | b[j][4]; 
 
235
                        n = (b[j][1]<<3) | (b[j][2]<<2) | (b[j][3]<<1) | b[j][4];
236
236
 
237
 
                        for (k=0;k<4;k++) 
238
 
                                b[j][k] = (sbox[j][m][n] & (1<<(3-k)))?1:0; 
 
237
                        for (k=0;k<4;k++)
 
238
                                b[j][k] = (sbox[j][m][n] & (1<<(3-k)))?1:0;
239
239
                }
240
240
 
241
241
                for (j=0;j<8;j++)