summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/pwdstorage
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2005-09-14 23:37:37 +0000
committerNathan Kinder <nkinder@redhat.com>2005-09-14 23:37:37 +0000
commitf92eb8289632c918e3fc13e88e18e3103cd7851a (patch)
treef9da216ee0a5ac6b62b1ee9bd88fb49698834c72 /ldap/servers/plugins/pwdstorage
parent93217592552bdbc44cd63bc8c8a918668e2b60e3 (diff)
downloadds-f92eb8289632c918e3fc13e88e18e3103cd7851a.tar.gz
ds-f92eb8289632c918e3fc13e88e18e3103cd7851a.tar.xz
ds-f92eb8289632c918e3fc13e88e18e3103cd7851a.zip
168322 - Check size of hash needed before base64 encoding password hashes
Diffstat (limited to 'ldap/servers/plugins/pwdstorage')
-rw-r--r--ldap/servers/plugins/pwdstorage/ssha_pwd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldap/servers/plugins/pwdstorage/ssha_pwd.c b/ldap/servers/plugins/pwdstorage/ssha_pwd.c
index b23c2adf..ac72e46e 100644
--- a/ldap/servers/plugins/pwdstorage/ssha_pwd.c
+++ b/ldap/servers/plugins/pwdstorage/ssha_pwd.c
@@ -175,14 +175,14 @@ salted_sha_pw_enc( char *pwd, unsigned int shaLen )
}
if (( enc = slapi_ch_malloc( 3 + schemeNameLen +
- LDIF_BASE64_LEN(sizeof(hash)))) == NULL ) {
+ LDIF_BASE64_LEN(shaLen + SHA_SALT_LENGTH))) == NULL ) {
return( NULL );
}
sprintf( enc, "%c%s%c", PWD_HASH_PREFIX_START, schemeName,
PWD_HASH_PREFIX_END );
(void)ldif_base64_encode( hash, enc + 2 + schemeNameLen,
- sizeof(hash), -1 );
+ (shaLen + SHA_SALT_LENGTH), -1 );
return( enc );
}