ReactOS
0.4.16-dev-819-g75c0dc0
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
pppcrypt.c
Go to the documentation of this file.
1
/*
2
* pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1
3
*
4
* Extracted from chap_ms.c by James Carlson.
5
*
6
* Copyright (c) 1995 Eric Rosenquist. All rights reserved.
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
10
* are met:
11
*
12
* 1. Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
14
*
15
* 2. Redistributions in binary form must reproduce the above copyright
16
* notice, this list of conditions and the following disclaimer in
17
* the documentation and/or other materials provided with the
18
* distribution.
19
*
20
* 3. The name(s) of the authors of this software must not be used to
21
* endorse or promote products derived from this software without
22
* prior written permission.
23
*
24
* THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
25
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
26
* AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
27
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
28
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
29
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
30
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
31
*/
32
33
#include "
netif/ppp/ppp_opts.h
"
34
#if PPP_SUPPORT && MSCHAP_SUPPORT
/* don't build if not necessary */
35
36
#include "
netif/ppp/ppp_impl.h
"
37
38
#include "
netif/ppp/pppcrypt.h
"
39
40
41
static
u_char
pppcrypt_get_7bits(
u_char
*
input
,
int
startBit) {
42
unsigned
int
word
;
43
44
word
= (
unsigned
)
input
[startBit / 8] << 8;
45
word
|= (
unsigned
)
input
[startBit / 8 + 1];
46
47
word
>>= 15 - (startBit % 8 + 7);
48
49
return
word
& 0xFE;
50
}
51
52
/* IN 56 bit DES key missing parity bits
53
* OUT 64 bit DES key with parity bits added
54
*/
55
void
pppcrypt_56_to_64_bit_key(
u_char
*
key
,
u_char
*
des_key
) {
56
des_key
[0] = pppcrypt_get_7bits(
key
, 0);
57
des_key
[1] = pppcrypt_get_7bits(
key
, 7);
58
des_key
[2] = pppcrypt_get_7bits(
key
, 14);
59
des_key
[3] = pppcrypt_get_7bits(
key
, 21);
60
des_key
[4] = pppcrypt_get_7bits(
key
, 28);
61
des_key
[5] = pppcrypt_get_7bits(
key
, 35);
62
des_key
[6] = pppcrypt_get_7bits(
key
, 42);
63
des_key
[7] = pppcrypt_get_7bits(
key
, 49);
64
}
65
66
#endif
/* PPP_SUPPORT && MSCHAP_SUPPORT */
u_char
UCHAR u_char
Definition:
types.h:80
input
GLenum GLenum GLenum input
Definition:
glext.h:9031
word
const WCHAR * word
Definition:
lex.c:36
unsigned
static unsigned(__cdecl *hash_bstr)(bstr_t s)
ppp_impl.h
ppp_opts.h
pppcrypt.h
key
Definition:
copy.c:22
tag_des_key
Definition:
tomcrypt.h:124
drivers
network
tcpip
lwip
src
netif
ppp
pppcrypt.c
Generated on Sat Mar 15 2025 06:06:02 for ReactOS by
1.9.6