~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to helpers/basic_auth/MSNT/md4.c

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2009-09-24 14:51:06 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090924145106-38jgrzmj0d73pha5
Tags: 3.1.0.13-1
* Upload to experimental

* New upstream release
  - Fixes Follow-X-Forwarded-For support (Closes: #523943)
  - Adds IPv6 support (Closes: #432351)

* debian/rules
  - Removed obsolete configuration options
  - Enable db and radius basic authentication modules

* debian/patches/01-cf.data.debian
  - Adapted to new upstream version

* debian/patches/02-makefile-defaults
  - Adapted to new upstream version

* debian/{squid.postinst,squid.rc,README.Debian,watch}
  - Updated references to squid 3.1

* debian/squid3.install
  - Install CSS file for error pages
  - Install manual pages for new authentication modules

* debian/squid3-common.install
  - Install documented version of configuration file in /usr/share/doc/squid3

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
 * a implementation of MD4 designed for use in the SMB authentication protocol
5
5
 * Copyright (C) Andrew Tridgell 1997
6
 
 * 
 
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
9
9
 * the Free Software Foundation; either version 2 of the License, or
10
10
 * (at your option) any later version.
11
 
 * 
 
11
 *
12
12
 * This program is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
15
 * GNU General Public License for more details.
16
 
 * 
 
16
 *
17
17
 * You should have received a copy of the GNU General Public License
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
22
#include <string.h>
23
23
#include "md4.h"
24
24
 
25
 
/* NOTE: This code makes no attempt to be fast! 
26
 
 * 
 
25
/* NOTE: This code makes no attempt to be fast!
 
26
 *
27
27
 * It assumes that a int is at least 32 bits long
28
28
 */
29
29
 
69
69
    uint32 X[16];
70
70
 
71
71
    for (j = 0; j < 16; j++)
72
 
        X[j] = M[j];
 
72
        X[j] = M[j];
73
73
 
74
74
    AA = A;
75
75
    BB = B;
138
138
    D &= 0xFFFFFFFF;
139
139
 
140
140
    for (j = 0; j < 16; j++)
141
 
        X[j] = 0;
 
141
        X[j] = 0;
142
142
}
143
143
 
144
144
static void
147
147
    int i;
148
148
 
149
149
    for (i = 0; i < 16; i++)
150
 
        M[i] = (in[i * 4 + 3] << 24) | (in[i * 4 + 2] << 16) |
151
 
            (in[i * 4 + 1] << 8) | (in[i * 4 + 0] << 0);
 
150
        M[i] = (in[i * 4 + 3] << 24) | (in[i * 4 + 2] << 16) |
 
151
               (in[i * 4 + 1] << 8) | (in[i * 4 + 0] << 0);
152
152
}
153
153
 
154
154
static void
175
175
    D = 0x10325476;
176
176
 
177
177
    while (n > 64) {
178
 
        copy64(M, in);
179
 
        mdfour64(M);
180
 
        in += 64;
181
 
        n -= 64;
 
178
        copy64(M, in);
 
179
        mdfour64(M);
 
180
        in += 64;
 
181
        n -= 64;
182
182
    }
183
183
 
184
184
    for (i = 0; i < 128; i++)
185
 
        buf[i] = 0;
 
185
        buf[i] = 0;
186
186
    memcpy(buf, in, n);
187
187
    buf[n] = 0x80;
188
188
 
189
189
    if (n <= 55) {
190
 
        copy4(buf + 56, b);
191
 
        copy64(M, buf);
192
 
        mdfour64(M);
 
190
        copy4(buf + 56, b);
 
191
        copy64(M, buf);
 
192
        mdfour64(M);
193
193
    } else {
194
 
        copy4(buf + 120, b);
195
 
        copy64(M, buf);
196
 
        mdfour64(M);
197
 
        copy64(M, buf + 64);
198
 
        mdfour64(M);
 
194
        copy4(buf + 120, b);
 
195
        copy64(M, buf);
 
196
        mdfour64(M);
 
197
        copy64(M, buf + 64);
 
198
        mdfour64(M);
199
199
    }
200
200
 
201
201
    for (i = 0; i < 128; i++)
202
 
        buf[i] = 0;
 
202
        buf[i] = 0;
203
203
    copy64(M, buf);
204
204
 
205
205
    copy4(out, A);