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
9ed2b33e
Commit
9ed2b33e
authored
23 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
optional SHA1
parent
17b52c97
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libraries/liblutil/authpasswd.c
+10
-1
10 additions, 1 deletion
libraries/liblutil/authpasswd.c
libraries/liblutil/passwd.c
+10
-0
10 additions, 0 deletions
libraries/liblutil/passwd.c
libraries/liblutil/sha1.c
+5
-0
5 additions, 0 deletions
libraries/liblutil/sha1.c
with
25 additions
and
1 deletion
libraries/liblutil/authpasswd.c
+
10
−
1
View file @
9ed2b33e
...
...
@@ -67,11 +67,13 @@ static int chk_md5(
const
struct
berval
*
salt
,
const
struct
berval
*
cred
);
#ifdef LUTIL_SHA1_BYTES
static
int
chk_sha1
(
const
struct
pw_scheme
*
scheme
,
const
struct
berval
*
passwd
,
const
struct
berval
*
salt
,
const
struct
berval
*
cred
);
#endif
static
int
chk_crypt
(
const
struct
pw_scheme
*
scheme
,
...
...
@@ -95,7 +97,7 @@ static int chk_ext_unix(
const
struct
berval
*
passwd
,
const
struct
berval
*
cred
);
#ifdef LUTIL_SHA1_BYTES
/* password hash routines */
static
int
*
hash_sha1
(
const
struct
pw_scheme
*
scheme
,
...
...
@@ -103,6 +105,7 @@ static int *hash_sha1(
const
struct
berval
*
salt
,
struct
berval
**
passwd_out
,
struct
berval
**
salt_out
);
#endif
static
int
*
hash_md5
(
const
struct
pw_scheme
*
scheme
,
...
...
@@ -128,7 +131,9 @@ struct pw_scheme {
static
const
struct
pw_scheme
pw_schemes
[]
=
{
#ifdef LUTIL_SHA1_BYTES
{
{
sizeof
(
"SHA1"
)
-
1
,
"SHA1"
},
chk_sha1
,
0
/* hash_sha1 */
,
4
},
#endif
{
{
sizeof
(
"MD5"
)
-
1
,
"MD5"
},
chk_md5
,
0
/* hash_md5 */
,
4
},
#ifdef SLAPD_CRYPT
...
...
@@ -364,6 +369,7 @@ static struct berval * base64(
/* PASSWORD CHECK ROUTINES */
#ifdef LUTIL_SHA1_BYTES
static
int
chk_sha1
(
const
struct
pw_scheme
*
sc
,
const
struct
berval
*
passwd
,
...
...
@@ -431,6 +437,7 @@ done:
ber_memfree
(
orig_salt
);
return
rc
;
}
#endif
static
int
chk_md5
(
const
struct
pw_scheme
*
sc
,
...
...
@@ -791,6 +798,7 @@ static int chk_unix(
#ifdef SLAPD_GENERATE
#ifdef LUTIL_SHA1_BYTES
static
struct
berval
*
hash_ssha1
(
const
struct
pw_scheme
*
scheme
,
const
struct
berval
*
passwd
)
...
...
@@ -837,6 +845,7 @@ static struct berval *hash_sha1(
return
pw_string64
(
scheme
,
&
digest
,
NULL
);
}
#endif
static
struct
berval
*
hash_smd5
(
const
struct
pw_scheme
*
scheme
,
...
...
This diff is collapsed.
Click to expand it.
libraries/liblutil/passwd.c
+
10
−
0
View file @
9ed2b33e
...
...
@@ -93,6 +93,7 @@ static int chk_smd5(
const
struct
berval
*
passwd
,
const
struct
berval
*
cred
);
#ifdef LUTIL_SHA1_BYTES
static
int
chk_ssha1
(
const
struct
pw_scheme
*
scheme
,
const
struct
berval
*
passwd
,
...
...
@@ -102,6 +103,7 @@ static int chk_sha1(
const
struct
pw_scheme
*
scheme
,
const
struct
berval
*
passwd
,
const
struct
berval
*
cred
);
#endif
#ifdef SLAPD_LMHASH
static
int
chk_lanman
(
...
...
@@ -139,6 +141,7 @@ static int chk_unix(
#endif
#ifdef LUTIL_SHA1_BYTES
/* password hash routines */
static
struct
berval
*
hash_sha1
(
const
struct
pw_scheme
*
scheme
,
...
...
@@ -147,6 +150,7 @@ static struct berval *hash_sha1(
static
struct
berval
*
hash_ssha1
(
const
struct
pw_scheme
*
scheme
,
const
struct
berval
*
passwd
);
#endif
static
struct
berval
*
hash_smd5
(
const
struct
pw_scheme
*
scheme
,
...
...
@@ -171,8 +175,10 @@ static struct berval *hash_crypt(
static
const
struct
pw_scheme
pw_schemes
[]
=
{
#ifdef LUTIL_SHA1_BYTES
{
{
sizeof
(
"{SSHA}"
)
-
1
,
"{SSHA}"
},
chk_ssha1
,
hash_ssha1
},
{
{
sizeof
(
"{SHA}"
)
-
1
,
"{SHA}"
},
chk_sha1
,
hash_sha1
},
#endif
{
{
sizeof
(
"{SMD5}"
)
-
1
,
"{SMD5}"
},
chk_smd5
,
hash_smd5
},
{
{
sizeof
(
"{MD5}"
)
-
1
,
"{MD5}"
},
chk_md5
,
hash_md5
},
...
...
@@ -448,6 +454,7 @@ static struct berval * pw_string64(
/* PASSWORD CHECK ROUTINES */
#ifdef LUTIL_SHA1_BYTES
static
int
chk_ssha1
(
const
struct
pw_scheme
*
sc
,
const
struct
berval
*
passwd
,
...
...
@@ -520,6 +527,7 @@ static int chk_sha1(
ber_memfree
(
orig_pass
);
return
rc
?
1
:
0
;
}
#endif
static
int
chk_smd5
(
const
struct
pw_scheme
*
sc
,
...
...
@@ -952,6 +960,7 @@ static int chk_unix(
/* PASSWORD GENERATION ROUTINES */
#ifdef LUTIL_SHA1_BYTES
static
struct
berval
*
hash_ssha1
(
const
struct
pw_scheme
*
scheme
,
const
struct
berval
*
passwd
)
...
...
@@ -998,6 +1007,7 @@ static struct berval *hash_sha1(
return
pw_string64
(
scheme
,
&
digest
,
NULL
);
}
#endif
static
struct
berval
*
hash_smd5
(
const
struct
pw_scheme
*
scheme
,
...
...
This diff is collapsed.
Click to expand it.
libraries/liblutil/sha1.c
+
5
−
0
View file @
9ed2b33e
...
...
@@ -25,6 +25,7 @@
*/
#include
"portable.h"
#include
<ac/bytes.h>
#include
<ac/string.h>
/* include socket.h to get sys/types.h and/or winsock2.h */
...
...
@@ -34,6 +35,8 @@
#include
"lutil_sha1.h"
#ifdef LUTIL_SHA1_BYTES
/* undefining this will cause pointer alignment errors */
#define SHA1HANDSOFF
/* Copies data before messing with it. */
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
...
...
@@ -275,3 +278,5 @@ lutil_SHA1Data( const unsigned char *data, size_t len, char *buf )
lutil_SHA1Update
(
&
ctx
,
data
,
len
);
return
(
lutil_SHA1End
(
&
ctx
,
buf
));
}
#endif
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