Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
5944f306
Commit
5944f306
authored
19 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
ITS#3910 heimdal 0.7 compatibility, silence warnings
parent
53921b2c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/slapd-modules/smbk5pwd/smbk5pwd.c
+21
-12
21 additions, 12 deletions
contrib/slapd-modules/smbk5pwd/smbk5pwd.c
with
21 additions
and
12 deletions
contrib/slapd-modules/smbk5pwd/smbk5pwd.c
+
21
−
12
View file @
5944f306
...
...
@@ -37,6 +37,12 @@
#include
<kadm5/admin.h>
#include
<hdb.h>
#ifndef HDB_INTERFACE_VERSION
#define HDB_MASTER_KEY_SET master_key_set
#else
#define HDB_MASTER_KEY_SET hdb_master_key_set
#endif
static
krb5_context
context
;
static
void
*
kadm_context
;
static
kadm5_config_params
conf
;
...
...
@@ -70,18 +76,21 @@ static const char hex[] = "0123456789abcdef";
/* From liblutil/passwd.c... */
static
void
lmPasswd_to_key
(
const
unsigned
char
*
lmPasswd
,
const
char
*
lmPasswd
,
des_cblock
*
key
)
{
const
unsigned
char
*
lpw
=
(
const
unsigned
char
*
)
lmPasswd
;
unsigned
char
*
k
=
(
unsigned
char
*
)
key
;
/* make room for parity bits */
((
char
*
)
key
)[
0
]
=
lmPasswd
[
0
];
((
char
*
)
key
)
[
1
]
=
((
l
mPasswd
[
0
]
&
0x01
)
<<
7
)
|
(
l
mPasswd
[
1
]
>>
1
);
((
char
*
)
key
)
[
2
]
=
((
l
mPasswd
[
1
]
&
0x03
)
<<
6
)
|
(
l
mPasswd
[
2
]
>>
2
);
((
char
*
)
key
)
[
3
]
=
((
l
mPasswd
[
2
]
&
0x07
)
<<
5
)
|
(
l
mPasswd
[
3
]
>>
3
);
((
char
*
)
key
)
[
4
]
=
((
l
mPasswd
[
3
]
&
0x0F
)
<<
4
)
|
(
l
mPasswd
[
4
]
>>
4
);
((
char
*
)
key
)
[
5
]
=
((
l
mPasswd
[
4
]
&
0x1F
)
<<
3
)
|
(
l
mPasswd
[
5
]
>>
5
);
((
char
*
)
key
)
[
6
]
=
((
l
mPasswd
[
5
]
&
0x3F
)
<<
2
)
|
(
l
mPasswd
[
6
]
>>
6
);
((
char
*
)
key
)
[
7
]
=
((
l
mPasswd
[
6
]
&
0x7F
)
<<
1
);
k
[
0
]
=
lpw
[
0
];
k
[
1
]
=
((
l
pw
[
0
]
&
0x01
)
<<
7
)
|
(
l
pw
[
1
]
>>
1
);
k
[
2
]
=
((
l
pw
[
1
]
&
0x03
)
<<
6
)
|
(
l
pw
[
2
]
>>
2
);
k
[
3
]
=
((
l
pw
[
2
]
&
0x07
)
<<
5
)
|
(
l
pw
[
3
]
>>
3
);
k
[
4
]
=
((
l
pw
[
3
]
&
0x0F
)
<<
4
)
|
(
l
pw
[
4
]
>>
4
);
k
[
5
]
=
((
l
pw
[
4
]
&
0x1F
)
<<
3
)
|
(
l
pw
[
5
]
>>
5
);
k
[
6
]
=
((
l
pw
[
5
]
&
0x3F
)
<<
2
)
|
(
l
pw
[
6
]
>>
6
);
k
[
7
]
=
((
l
pw
[
6
]
&
0x7F
)
<<
1
);
des_set_odd_parity
(
key
);
}
...
...
@@ -154,7 +163,7 @@ static void nthash(
MD4_Init
(
&
ctx
);
MD4_Update
(
&
ctx
,
passwd
->
bv_val
,
passwd
->
bv_len
);
MD4_Final
(
hbuf
,
&
ctx
);
MD4_Final
(
(
unsigned
char
*
)
hbuf
,
&
ctx
);
hexify
(
hbuf
,
hash
);
}
...
...
@@ -264,7 +273,7 @@ static int k5key_chk(
ent
.
keys
.
val
=
&
ekey
;
decode_Key
((
unsigned
char
*
)
a
->
a_vals
[
0
].
bv_val
,
(
size_t
)
a
->
a_vals
[
0
].
bv_len
,
&
ent
.
keys
.
val
[
0
],
&
l
);
if
(
db
->
master_key_set
)
if
(
db
->
HDB_MASTER_KEY_SET
)
hdb_unseal_keys
(
context
,
db
,
&
ent
);
krb5_string_to_key_salt
(
context
,
ekey
.
key
.
keytype
,
cred
->
bv_val
,
...
...
@@ -353,7 +362,7 @@ static int smbk5pwd_exop_passwd(
if
(
ret
!=
0
)
break
;
keys
[
i
].
bv_val
=
buf
;
keys
[
i
].
bv_val
=
(
char
*
)
buf
;
keys
[
i
].
bv_len
=
len
;
}
keys
[
i
].
bv_val
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment