[Fedora-directory-commits] ldapserver/ldap/admin/src upgradeServer, 1.5, 1.6
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29129
Modified Files:
upgradeServer
Log Message:
[167679] modify upgradeServer to upgrade db2index.pl
To fix the bug "[160003] db2index.pl cannot find libldap50.so if only certain
parameters are used", template-db2index.pl has been modified.
When upgrading existing servers, the perl scripts are not touched unless forced
to. This upgradeServer provides the framework.
Index: upgradeServer
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/upgradeServer,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- upgradeServer 19 Apr 2005 22:06:55 -0000 1.5
+++ upgradeServer 7 Sep 2005 00:54:20 -0000 1.6
@@ -419,7 +419,7 @@
sub instantiate_new_scripts {
@newtemplates = (
- "$sroot/bin/slapd/admin/scripts/template-ns-newpwpolicy.pl"
+ "$sroot/bin/slapd/admin/scripts/template-db2index.pl"
);
$host = localhost;
@@ -435,7 +435,6 @@
foreach $src ( @newtemplates ) {
$dest = "$sroot/$prefix/$1" if $src =~ /.*template-(.*)$/;
- next if -f $dest;
unless ( open ( template, $src )) {
print "Can't open $src: $!\n";
next;
@@ -451,6 +450,7 @@
s#{{ROOT-DN}}#$rootdn#g;
s#{{SERVER-PORT}}#$port#g;
s#{{SERVER-NAME}}#$host#g;
+ s#{{MY-DS-ROOT}}#$sroot/$prefix#g;
printf target;
}
close template;
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/admin/src upgradeServer, 1.5, 1.5.2.1
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29102
Modified Files:
Tag: Directory71RtmBranch
upgradeServer
Log Message:
[167679] modify upgradeServer to upgrade db2index.pl
To fix the bug "[160003] db2index.pl cannot find libldap50.so if only certain
parameters are used", template-db2index.pl has been modified.
When upgrading existing servers, the perl scripts are not touched unless forced
to. This upgradeServer provides the framework.
Index: upgradeServer
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/upgradeServer,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- upgradeServer 19 Apr 2005 22:06:55 -0000 1.5
+++ upgradeServer 7 Sep 2005 00:51:53 -0000 1.5.2.1
@@ -419,7 +419,7 @@
sub instantiate_new_scripts {
@newtemplates = (
- "$sroot/bin/slapd/admin/scripts/template-ns-newpwpolicy.pl"
+ "$sroot/bin/slapd/admin/scripts/template-db2index.pl"
);
$host = localhost;
@@ -435,7 +435,6 @@
foreach $src ( @newtemplates ) {
$dest = "$sroot/$prefix/$1" if $src =~ /.*template-(.*)$/;
- next if -f $dest;
unless ( open ( template, $src )) {
print "Can't open $src: $!\n";
next;
@@ -451,6 +450,7 @@
s#{{ROOT-DN}}#$rootdn#g;
s#{{SERVER-PORT}}#$port#g;
s#{{SERVER-NAME}}#$host#g;
+ s#{{MY-DS-ROOT}}#$sroot/$prefix#g;
printf target;
}
close template;
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd plugin.c, 1.9, 1.10
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23217/ldap/servers/slapd
Modified Files:
plugin.c
Log Message:
167441 - Added SHA2 hashed password storage support.
Index: plugin.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/plugin.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- plugin.c 19 Apr 2005 22:07:36 -0000 1.9
+++ plugin.c 6 Sep 2005 21:15:15 -0000 1.10
@@ -463,8 +463,11 @@
struct slapdplugin *p;
for ( p = global_plugin_list[index]; p != NULL; p = p->plg_next ) {
- if (strncasecmp(p->plg_pwdstorageschemename, name, len) == 0)
- return( p );
+ if (strlen(p->plg_pwdstorageschemename) == len) {
+ if (strncasecmp(p->plg_pwdstorageschemename, name, len) == 0) {
+ return( p );
+ }
+ }
}
return( NULL );
}
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/pwdstorage pwd_init.c, 1.6, 1.7 pwdstorage.h, 1.6, 1.7 sha_pwd.c, 1.4, 1.5 ssha_pwd.c, 1.5, 1.6
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23217/ldap/servers/plugins/pwdstorage
Modified Files:
pwd_init.c pwdstorage.h sha_pwd.c ssha_pwd.c
Log Message:
167441 - Added SHA2 hashed password storage support.
Index: pwd_init.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage/pwd_init.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pwd_init.c 14 Jun 2005 15:44:19 -0000 1.6
+++ pwd_init.c 6 Sep 2005 21:15:15 -0000 1.7
@@ -47,6 +47,18 @@
static Slapi_PluginDesc ssha_pdesc = { "ssha-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Salted Secure Hashing Algorithm (SSHA)" };
+static Slapi_PluginDesc sha256_pdesc = { "sha256-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Secure Hashing Algorithm (SHA256)" };
+
+static Slapi_PluginDesc ssha256_pdesc = { "ssha256-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Salted Secure Hashing Algorithm (SSHA256)" };
+
+static Slapi_PluginDesc sha384_pdesc = { "sha384-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Secure Hashing Algorithm (SHA384)" };
+
+static Slapi_PluginDesc ssha384_pdesc = { "ssha384-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Salted Secure Hashing Algorithm (SSHA384)" };
+
+static Slapi_PluginDesc sha512_pdesc = { "sha512-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Secure Hashing Algorithm (SHA512)" };
+
+static Slapi_PluginDesc ssha512_pdesc = { "ssha512-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Salted Secure Hashing Algorithm (SSHA512)" };
+
#ifndef _WIN32
static Slapi_PluginDesc crypt_pdesc = { "crypt-password-storage-scheme", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, "Unix crypt algorithm (CRYPT)" };
#endif
@@ -108,6 +120,153 @@
return( rc );
}
+int
+sha256_pwd_storage_scheme_init( Slapi_PBlock *pb )
+{
+ int rc;
+ char *name;
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "=> sha256_pwd_storage_scheme_init\n" );
+
+ rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
+ (void *) SLAPI_PLUGIN_VERSION_01 );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
+ (void *)&sha256_pdesc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN,
+ (void *) sha256_pw_enc);
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_CMP_FN,
+ (void *) sha256_pw_cmp );
+ name = slapi_ch_strdup("SHA256");
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME,
+ name );
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "<= sha256_pwd_storage_scheme_init %d\n\n", rc );
+
+ return( rc );
+}
+
+int
+ssha256_pwd_storage_scheme_init( Slapi_PBlock *pb )
+{
+ int rc;
+ char *name;
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "=> ssha256_pwd_storage_scheme_init\n" );
+
+ rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
+ (void *) SLAPI_PLUGIN_VERSION_01 );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
+ (void *)&ssha256_pdesc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN,
+ (void *) salted_sha256_pw_enc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_CMP_FN,
+ (void *) sha256_pw_cmp );
+ name = slapi_ch_strdup("SSHA256");
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME,
+ name );
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "<= ssha256_pwd_storage_scheme_init %d\n\n", rc );
+ return( rc );
+}
+
+int
+sha384_pwd_storage_scheme_init( Slapi_PBlock *pb )
+{
+ int rc;
+ char *name;
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "=> sha384_pwd_storage_scheme_init\n" );
+
+ rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
+ (void *) SLAPI_PLUGIN_VERSION_01 );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
+ (void *)&sha384_pdesc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN,
+ (void *) sha384_pw_enc);
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_CMP_FN,
+ (void *) sha384_pw_cmp );
+ name = slapi_ch_strdup("SHA384");
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME,
+ name );
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "<= sha384_pwd_storage_scheme_init %d\n\n", rc );
+
+ return( rc );
+}
+
+int
+ssha384_pwd_storage_scheme_init( Slapi_PBlock *pb )
+{
+ int rc;
+ char *name;
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "=> ssha384_pwd_storage_scheme_init\n" );
+
+ rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
+ (void *) SLAPI_PLUGIN_VERSION_01 );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
+ (void *)&ssha384_pdesc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN,
+ (void *) salted_sha384_pw_enc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_CMP_FN,
+ (void *) sha384_pw_cmp );
+ name = slapi_ch_strdup("SSHA384");
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME,
+ name );
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "<= ssha384_pwd_storage_scheme_init %d\n\n", rc );
+ return( rc );
+}
+
+int
+sha512_pwd_storage_scheme_init( Slapi_PBlock *pb )
+{
+ int rc;
+ char *name;
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "=> sha512_pwd_storage_scheme_init\n" );
+
+ rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
+ (void *) SLAPI_PLUGIN_VERSION_01 );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
+ (void *)&sha512_pdesc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN,
+ (void *) sha512_pw_enc);
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_CMP_FN,
+ (void *) sha512_pw_cmp );
+ name = slapi_ch_strdup("SHA512");
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME,
+ name );
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "<= sha512_pwd_storage_scheme_init %d\n\n", rc );
+
+ return( rc );
+}
+
+int
+ssha512_pwd_storage_scheme_init( Slapi_PBlock *pb )
+{
+ int rc;
+ char *name;
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "=> ssha512_pwd_storage_scheme_init\n" );
+
+ rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
+ (void *) SLAPI_PLUGIN_VERSION_01 );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
+ (void *)&ssha512_pdesc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN,
+ (void *) salted_sha512_pw_enc );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_CMP_FN,
+ (void *) sha512_pw_cmp );
+ name = slapi_ch_strdup("SSHA512");
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME,
+ name );
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "<= ssha512_pwd_storage_scheme_init %d\n\n", rc );
+ return( rc );
+}
+
#ifndef _WIN32
int
crypt_pwd_storage_scheme_init( Slapi_PBlock *pb )
Index: pwdstorage.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage/pwdstorage.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pwdstorage.h 14 Jun 2005 15:44:19 -0000 1.6
+++ pwdstorage.h 6 Sep 2005 21:15:15 -0000 1.7
@@ -49,10 +49,24 @@
#define PWD_HASH_PREFIX_START '{'
#define PWD_HASH_PREFIX_END '}'
+#define MAX_SHA_HASH_SIZE 64
+
#define SHA1_SCHEME_NAME "SHA"
#define SHA1_NAME_LEN 3
#define SALTED_SHA1_SCHEME_NAME "SSHA"
#define SALTED_SHA1_NAME_LEN 4
+#define SHA256_SCHEME_NAME "SHA256"
+#define SHA256_NAME_LEN 6
+#define SALTED_SHA256_SCHEME_NAME "SSHA256"
+#define SALTED_SHA256_NAME_LEN 7
+#define SHA384_SCHEME_NAME "SHA384"
+#define SHA384_NAME_LEN 6
+#define SALTED_SHA384_SCHEME_NAME "SSHA384"
+#define SALTED_SHA384_NAME_LEN 7
+#define SHA512_SCHEME_NAME "SHA512"
+#define SHA512_NAME_LEN 6
+#define SALTED_SHA512_SCHEME_NAME "SSHA512"
+#define SALTED_SHA512_NAME_LEN 7
#define CRYPT_SCHEME_NAME "crypt"
#define CRYPT_NAME_LEN 5
#define NS_MTA_MD5_SCHEME_NAME "NS-MTA-MD5"
@@ -62,10 +76,22 @@
#define MD5_SCHEME_NAME "MD5"
#define MD5_NAME_LEN 3
-SECStatus sha1_salted_hash(unsigned char *hash_out, char *pwd, struct berval *salt);
+SECStatus sha_salted_hash(unsigned char *hash_out, char *pwd, struct berval *salt, unsigned int secOID);
+int sha_pw_cmp( char *userpwd, char *dbpwd, unsigned int shaLen );
+char * sha_pw_enc( char *pwd, unsigned int shaLen );
+char * salted_sha_pw_enc( char *pwd, unsigned int shaLen );
int sha1_pw_cmp( char *userpwd, char *dbpwd );
char * sha1_pw_enc( char *pwd );
char * salted_sha1_pw_enc( char *pwd );
+int sha256_pw_cmp( char *userpwd, char *dbpwd );
+char * sha256_pw_enc( char *pwd );
+char * salted_sha256_pw_enc( char *pwd );
+int sha384_pw_cmp( char *userpwd, char *dbpwd );
+char * sha384_pw_enc( char *pwd );
+char * salted_sha384_pw_enc( char *pwd );
+int sha512_pw_cmp( char *userpwd, char *dbpwd );
+char * sha512_pw_enc( char *pwd );
+char * salted_sha512_pw_enc( char *pwd );
int clear_pw_cmp( char *userpwd, char *dbpwd );
char *clear_pw_enc( char *pwd );
#ifndef _WIN32
@@ -121,6 +147,9 @@
* Number of bytes each hash algorithm produces
*/
#define SHA1_LENGTH 20
+#define SHA256_LENGTH 32
+#define SHA384_LENGTH 48
+#define SHA512_LENGTH 64
/******************************************/
/*
Index: sha_pwd.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage/sha_pwd.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sha_pwd.c 19 Apr 2005 22:07:32 -0000 1.4
+++ sha_pwd.c 6 Sep 2005 21:15:15 -0000 1.5
@@ -50,7 +50,7 @@
#include <sechash.h>
#endif /* NET_SSL */
-#define SHA1_SALT_LENGTH 8 /* number of bytes of data in salt */
+#define SHA_SALT_LENGTH 8 /* number of bytes of data in salt */
#define NOT_FIRST_TIME (time_t)1 /* not the first logon */
static char *hasherrmsg = "pw_cmp: %s userPassword \"%s\" is the wrong length or is not properly encoded BASE64\n";
@@ -62,21 +62,46 @@
* 8 bytes of salt plus the first 10 bytes of the SHA-1 digest.
* It's obsolescent now, but we still handle such stored values.
*/
-
+
int
-sha1_pw_cmp (char *userpwd, char *dbpwd )
+sha_pw_cmp (char *userpwd, char *dbpwd, unsigned int shaLen )
{
/*
- * SHA1 passwords are stored in the database as SHA1_LENGTH bytes of
+ * SHA passwords are stored in the database as shaLen bytes of
* hash, followed by zero or more bytes of salt, all BASE64 encoded.
*/
int result = 1; /* failure */
- unsigned char userhash[SHA1_LENGTH];
- unsigned char quick_dbhash[SHA1_LENGTH + SHA1_SALT_LENGTH + 3];
+ unsigned char userhash[MAX_SHA_HASH_SIZE];
+ unsigned char quick_dbhash[MAX_SHA_HASH_SIZE + SHA_SALT_LENGTH + 3];
unsigned char *dbhash = quick_dbhash;
struct berval salt;
int hash_len; /* must be a signed valued -- see below */
-
+ unsigned int secOID;
+ char *schemeName;
+
+ /* Determine which algorithm we're using */
+ switch (shaLen) {
+ case SHA1_LENGTH:
+ schemeName = SHA1_SCHEME_NAME;
+ secOID = SEC_OID_SHA1;
+ break;
+ case SHA256_LENGTH:
+ schemeName = SHA256_SCHEME_NAME;
+ secOID = SEC_OID_SHA256;
+ break;
+ case SHA384_LENGTH:
+ schemeName = SHA384_SCHEME_NAME;
+ secOID = SEC_OID_SHA384;
+ break;
+ case SHA512_LENGTH:
+ schemeName = SHA512_SCHEME_NAME;
+ secOID = SEC_OID_SHA512;
+ break;
+ default:
+ /* An unknown shaLen was passed in. We shouldn't get here. */
+ goto loser;
+ }
+
/*
* Decode hash stored in database.
*
@@ -90,54 +115,137 @@
if ( dbhash == NULL ) goto loser;
}
hash_len = ldif_base64_decode( dbpwd, dbhash );
- if ( hash_len >= SHA1_LENGTH ) {
- salt.bv_val = (void*)(dbhash + SHA1_LENGTH);
- salt.bv_len = hash_len - SHA1_LENGTH;
+ if ( hash_len >= shaLen ) {
+ salt.bv_val = (void*)(dbhash + shaLen);
+ salt.bv_len = hash_len - shaLen;
} else if ( hash_len == DS40B1_SALTED_SHA_LENGTH ) {
salt.bv_val = (void*)dbhash;
salt.bv_len = 8;
} else { /* unsupported, invalid BASE64 (hash_len < 0), or similar */
- slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, hasherrmsg, SHA1_SCHEME_NAME, dbpwd );
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, hasherrmsg, schemeName, dbpwd );
goto loser;
}
-
- /* SHA1 hash the user's key */
- if ( sha1_salted_hash( userhash, userpwd, &salt ) != SECSuccess ) {
- slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "sha1_pw_cmp: SHA1_Hash() failed\n");
+
+ /* hash the user's key */
+ if ( sha_salted_hash( userhash, userpwd, &salt, secOID ) != SECSuccess ) {
+ slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "sha_pw_cmp: sha_salted_hash() failed\n");
goto loser;
}
-
+
/* the proof is in the comparison... */
result = ( hash_len == DS40B1_SALTED_SHA_LENGTH ) ?
( memcmp( userhash, dbhash + 8, hash_len - 8 )) :
- ( memcmp( userhash, dbhash, SHA1_LENGTH ));
-
+ ( memcmp( userhash, dbhash, shaLen ));
+
loser:
if ( dbhash && dbhash != quick_dbhash ) slapi_ch_free( (void**)&dbhash );
return result;
}
-
-
+
char *
-sha1_pw_enc( char *pwd )
+sha_pw_enc( char *pwd, unsigned int shaLen )
{
- unsigned char hash[ SHA1_LENGTH ];
+ unsigned char hash[MAX_SHA_HASH_SIZE];
char *enc;
-
- /* SHA1 hash the user's key */
- if ( sha1_salted_hash( hash, pwd, NULL ) != SECSuccess ) {
+ char *schemeName;
+ unsigned int schemeNameLen;
+ unsigned int secOID;
+
+ /* Determine which algorithm we're using */
+ switch (shaLen) {
+ case SHA1_LENGTH:
+ schemeName = SHA1_SCHEME_NAME;
+ schemeNameLen = SHA1_NAME_LEN;
+ secOID = SEC_OID_SHA1;
+ break;
+ case SHA256_LENGTH:
+ schemeName = SHA256_SCHEME_NAME;
+ schemeNameLen = SHA256_NAME_LEN;
+ secOID = SEC_OID_SHA256;
+ break;
+ case SHA384_LENGTH:
+ schemeName = SHA384_SCHEME_NAME;
+ schemeNameLen = SHA384_NAME_LEN;
+ secOID = SEC_OID_SHA384;
+ break;
+ case SHA512_LENGTH:
+ schemeName = SHA512_SCHEME_NAME;
+ schemeNameLen = SHA512_NAME_LEN;
+ secOID = SEC_OID_SHA512;
+ break;
+ default:
+ /* An unknown shaLen was passed in. We shouldn't get here. */
+ return( NULL );
+ }
+
+ /* hash the user's key */
+ if ( sha_salted_hash( hash, pwd, NULL, secOID ) != SECSuccess ) {
return( NULL );
}
-
- if (( enc = slapi_ch_malloc( 3 + SHA1_NAME_LEN +
- LDIF_BASE64_LEN( SHA1_LENGTH ))) == NULL ) {
+
+ if (( enc = slapi_ch_malloc( 3 + schemeNameLen +
+ LDIF_BASE64_LEN( shaLen ))) == NULL ) {
return( NULL );
}
-
- sprintf( enc, "%c%s%c", PWD_HASH_PREFIX_START, SHA1_SCHEME_NAME,
+
+ sprintf( enc, "%c%s%c", PWD_HASH_PREFIX_START, schemeName,
PWD_HASH_PREFIX_END );
- (void)ldif_base64_encode( hash, enc + 2 + SHA1_NAME_LEN,
- SHA1_LENGTH, -1 );
-
+ (void)ldif_base64_encode( hash, enc + 2 + schemeNameLen,
+ shaLen, -1 );
+
return( enc );
}
+
+/*
+ * Wrapper password comparison functions
+ */
+int
+sha1_pw_cmp (char *userpwd, char *dbpwd )
+{
+ return sha_pw_cmp( userpwd, dbpwd, SHA1_LENGTH );
+}
+
+int
+sha256_pw_cmp (char *userpwd, char *dbpwd )
+{
+ return sha_pw_cmp( userpwd, dbpwd, SHA256_LENGTH );
+}
+
+int
+sha384_pw_cmp (char *userpwd, char *dbpwd )
+{
+ return sha_pw_cmp( userpwd, dbpwd, SHA384_LENGTH );
+}
+
+int
+sha512_pw_cmp (char *userpwd, char *dbpwd )
+{
+ return sha_pw_cmp( userpwd, dbpwd, SHA512_LENGTH );
+}
+
+/*
+ * Wrapper password encryption functions
+ */
+char *
+sha1_pw_enc( char *pwd )
+{
+ return sha_pw_enc( pwd, SHA1_LENGTH );
+}
+
+char *
+sha256_pw_enc( char *pwd )
+{
+ return sha_pw_enc( pwd, SHA256_LENGTH );
+}
+
+char *
+sha384_pw_enc( char *pwd )
+{
+ return sha_pw_enc( pwd, SHA384_LENGTH );
+}
+
+char *
+sha512_pw_enc( char *pwd )
+{
+ return sha_pw_enc( pwd, SHA512_LENGTH );
+}
Index: ssha_pwd.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage/ssha_pwd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ssha_pwd.c 19 Apr 2005 22:07:32 -0000 1.5
+++ ssha_pwd.c 6 Sep 2005 21:15:15 -0000 1.6
@@ -53,7 +53,7 @@
#include <pk11pqg.h>
#endif /* NET_SSL */
-#define SHA1_SALT_LENGTH 8 /* number of bytes of data in salt */
+#define SHA_SALT_LENGTH 8 /* number of bytes of data in salt */
static void ssha_rand_array(void *randx, size_t len);
@@ -70,75 +70,146 @@
PK11_GenerateRandom((unsigned char *)randx, (int)len);
}
-/*
- * A salted SHA1 hash
- * if salt is null, no salt is used (this is for backward compatibility)
-*/
SECStatus
-sha1_salted_hash(unsigned char *hash_out, char *pwd, struct berval *salt)
+sha_salted_hash(unsigned char *hash_out, char *pwd, struct berval *salt, unsigned int secOID)
{
PK11Context *ctx;
unsigned int outLen;
+ unsigned int shaLen;
SECStatus rc;
+
+ switch (secOID) {
+ case SEC_OID_SHA1:
+ shaLen = SHA1_LENGTH;
+ break;
+ case SEC_OID_SHA256:
+ shaLen = SHA256_LENGTH;
+ break;
+ case SEC_OID_SHA384:
+ shaLen = SHA384_LENGTH;
+ break;
+ case SEC_OID_SHA512:
+ shaLen = SHA512_LENGTH;
+ break;
+ default:
+ /* An unknown secOID was passed in. We shouldn't get here. */
+ rc = SECFailure;
+ return rc;
+ }
if (salt && salt->bv_len) {
- ctx = PK11_CreateDigestContext(SEC_OID_SHA1);
- if (ctx == NULL) {
- rc = SECFailure;
- }
- else {
- PK11_DigestBegin(ctx);
- PK11_DigestOp(ctx, (unsigned char*)pwd, strlen(pwd));
- PK11_DigestOp(ctx, (unsigned char*)(salt->bv_val), salt->bv_len);
- PK11_DigestFinal(ctx, hash_out, &outLen, SHA1_LENGTH);
- PK11_DestroyContext(ctx, 1);
- if (outLen == SHA1_LENGTH)
- rc = SECSuccess;
- else
- rc = SECFailure;
- }
+ ctx = PK11_CreateDigestContext(secOID);
+ if (ctx == NULL) {
+ rc = SECFailure;
+ } else {
+ PK11_DigestBegin(ctx);
+ PK11_DigestOp(ctx, (unsigned char*)pwd, strlen(pwd));
+ PK11_DigestOp(ctx, (unsigned char*)(salt->bv_val), salt->bv_len);
+ PK11_DigestFinal(ctx, hash_out, &outLen, shaLen);
+ PK11_DestroyContext(ctx, 1);
+ if (outLen == shaLen)
+ rc = SECSuccess;
+ else
+ rc = SECFailure;
+ }
}
else {
/*backward compatibility*/
- rc = PK11_HashBuf(SEC_OID_SHA1, hash_out, (unsigned char *)pwd, strlen(pwd));
+ rc = PK11_HashBuf(secOID, hash_out, (unsigned char *)pwd, strlen(pwd));
}
-
+
return rc;
}
char *
-salted_sha1_pw_enc( char *pwd )
+salted_sha_pw_enc( char *pwd, unsigned int shaLen )
{
- unsigned char hash[ SHA1_LENGTH + SHA1_SALT_LENGTH ];
- unsigned char *salt = hash + SHA1_LENGTH;
+ unsigned char hash[ MAX_SHA_HASH_SIZE + SHA_SALT_LENGTH ];
+ unsigned char *salt = hash + shaLen;
struct berval saltval;
char *enc;
-
+ char *schemeName;
+ unsigned int schemeNameLen;
+ unsigned int secOID;
+
+ /* Determine which algorithm we're using */
+ switch (shaLen) {
+ case SHA1_LENGTH:
+ schemeName = SALTED_SHA1_SCHEME_NAME;
+ schemeNameLen = SALTED_SHA1_NAME_LEN;
+ secOID = SEC_OID_SHA1;
+ break;
+ case SHA256_LENGTH:
+ schemeName = SALTED_SHA256_SCHEME_NAME;
+ schemeNameLen = SALTED_SHA256_NAME_LEN;
+ secOID = SEC_OID_SHA256;
+ break;
+ case SHA384_LENGTH:
+ schemeName = SALTED_SHA384_SCHEME_NAME;
+ schemeNameLen = SALTED_SHA384_NAME_LEN;
+ secOID = SEC_OID_SHA384;
+ break;
+ case SHA512_LENGTH:
+ schemeName = SALTED_SHA512_SCHEME_NAME;
+ schemeNameLen = SALTED_SHA512_NAME_LEN;
+ secOID = SEC_OID_SHA512;
+ break;
+ default:
+ /* An unknown shaLen was passed in. We shouldn't get here. */
+ return( NULL );
+ }
+
saltval.bv_val = (void*)salt;
- saltval.bv_len = SHA1_SALT_LENGTH;
-
+ saltval.bv_len = SHA_SALT_LENGTH;
+
/* generate a new random salt */
- /* Note: the uninitialized salt array provides a little extra entropy
- * to the random array generation, but it is not really needed since
- * PK11_GenerateRandom takes care of seeding. In any case, it doesn't
- * hurt. */
- ssha_rand_array( salt, SHA1_SALT_LENGTH );
-
- /* SHA1 hash the user's key */
- if ( sha1_salted_hash( hash, pwd, &saltval ) != SECSuccess ) {
+ /* Note: the uninitialized salt array provides a little extra entropy
+ * to the random array generation, but it is not really needed since
+ * PK11_GenerateRandom takes care of seeding. In any case, it doesn't
+ * hurt. */
+ ssha_rand_array( salt, SHA_SALT_LENGTH );
+
+ /* hash the user's key */
+ if ( sha_salted_hash( hash, pwd, &saltval, secOID ) != SECSuccess ) {
return( NULL );
}
-
- if (( enc = slapi_ch_malloc( 3 + SALTED_SHA1_NAME_LEN +
+
+ if (( enc = slapi_ch_malloc( 3 + schemeNameLen +
LDIF_BASE64_LEN(sizeof(hash)))) == NULL ) {
return( NULL );
}
-
- sprintf( enc, "%c%s%c", PWD_HASH_PREFIX_START, SALTED_SHA1_SCHEME_NAME,
+
+ sprintf( enc, "%c%s%c", PWD_HASH_PREFIX_START, schemeName,
PWD_HASH_PREFIX_END );
- (void)ldif_base64_encode( hash, enc + 2 + SALTED_SHA1_NAME_LEN,
+ (void)ldif_base64_encode( hash, enc + 2 + schemeNameLen,
sizeof(hash), -1 );
-
+
return( enc );
}
+/*
+ * Wrapper functions for password encoding
+ */
+char *
+salted_sha1_pw_enc( char *pwd )
+{
+ return salted_sha_pw_enc( pwd, SHA1_LENGTH );
+}
+
+char *
+salted_sha256_pw_enc( char *pwd )
+{
+ return salted_sha_pw_enc( pwd, SHA256_LENGTH );
+}
+
+char *
+salted_sha384_pw_enc( char *pwd )
+{
+ return salted_sha_pw_enc( pwd, SHA384_LENGTH );
+}
+
+char *
+salted_sha512_pw_enc( char *pwd )
+{
+ return salted_sha_pw_enc( pwd, SHA512_LENGTH );
+}
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/admin/src create_instance.c, 1.21, 1.22
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23217/ldap/admin/src
Modified Files:
create_instance.c
Log Message:
167441 - Added SHA2 hashed password storage support.
Index: create_instance.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- create_instance.c 2 Sep 2005 20:40:48 -0000 1.21
+++ create_instance.c 6 Sep 2005 21:15:14 -0000 1.22
@@ -3194,6 +3194,36 @@
fprintf(f, "nsslapd-pluginenabled: on\n");
fprintf(f, "\n");
+ fprintf(f, "dn: cn=SSHA256,cn=Password Storage Schemes,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "cn: SSHA256\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: ssha256_pwd_storage_scheme_init\n");
+ fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
+ fprintf(f, "nsslapd-pluginenabled: on\n");
+ fprintf(f, "\n");
+
+ fprintf(f, "dn: cn=SSHA384,cn=Password Storage Schemes,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "cn: SSHA384\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: ssha384_pwd_storage_scheme_init\n");
+ fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
+ fprintf(f, "nsslapd-pluginenabled: on\n");
+ fprintf(f, "\n");
+
+ fprintf(f, "dn: cn=SSHA512,cn=Password Storage Schemes,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "cn: SSHA512\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: ssha512_pwd_storage_scheme_init\n");
+ fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
+ fprintf(f, "nsslapd-pluginenabled: on\n");
+ fprintf(f, "\n");
+
fprintf(f, "dn: cn=SHA,cn=Password Storage Schemes,cn=plugins,cn=config\n");
fprintf(f, "objectclass: top\n");
fprintf(f, "objectclass: nsSlapdPlugin\n");
@@ -3204,6 +3234,36 @@
fprintf(f, "nsslapd-pluginenabled: on\n");
fprintf(f, "\n");
+ fprintf(f, "dn: cn=SHA256,cn=Password Storage Schemes,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "cn: SHA256\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: sha256_pwd_storage_scheme_init\n");
+ fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
+ fprintf(f, "nsslapd-pluginenabled: on\n");
+ fprintf(f, "\n");
+
+ fprintf(f, "dn: cn=SHA384,cn=Password Storage Schemes,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "cn: SHA384\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: sha384_pwd_storage_scheme_init\n");
+ fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
+ fprintf(f, "nsslapd-pluginenabled: on\n");
+ fprintf(f, "\n");
+
+ fprintf(f, "dn: cn=SHA512,cn=Password Storage Schemes,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "cn: SHA512\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: sha512_pwd_storage_scheme_init\n");
+ fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
+ fprintf(f, "nsslapd-pluginenabled: on\n");
+ fprintf(f, "\n");
+
#if !defined(_WIN32)
fprintf(f, "dn: cn=CRYPT,cn=Password Storage Schemes,cn=plugins,cn=config\n");
fprintf(f, "objectclass: top\n");
18 years, 6 months
[Fedora-directory-commits] ldapserver internal_comp_deps.mk, 1.25, 1.26
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14376
Modified Files:
internal_comp_deps.mk
Log Message:
Pull setuputil from sbsint, not sbc.
Index: internal_comp_deps.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/internal_comp_deps.mk,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- internal_comp_deps.mk 2 Sep 2005 20:40:46 -0000 1.25
+++ internal_comp_deps.mk 6 Sep 2005 17:30:03 -0000 1.26
@@ -401,8 +401,8 @@
SETUPUTIL_BUILD_DIR = $(NSCP_DISTDIR)/setuputil
SETUPUTIL_VERSION = $(SETUPUTIL_RELDATE)
ifeq ($(BUILD_MODE), int)
- SETUPUTIL_RELEASE = $(COMPONENTS_DIR)/$(SETUPUTIL_VERSDIR)/$(SETUPUTIL_VERSION)/$(NSOBJDIR_NAME)
-# SETUPUTIL_RELEASE = $(COMPONENTS_DIR_DEV)/$(SETUPUTIL_VERSDIR)/$(SETUPUTIL_VERSION)/$(NSOBJDIR_NAME)
+# SETUPUTIL_RELEASE = $(COMPONENTS_DIR)/$(SETUPUTIL_VERSDIR)/$(SETUPUTIL_VERSION)/$(NSOBJDIR_NAME)
+ SETUPUTIL_RELEASE = $(COMPONENTS_DIR_DEV)/$(SETUPUTIL_VERSDIR)/$(SETUPUTIL_VERSION)/$(NSOBJDIR_NAME)
else
SETUPUTIL_RELEASE = $(FED_COMPONENTS_DIR)/$(SETUPUTIL_VERSDIR)/$(SETUPUTIL_VERSION)/$(NSOBJDIR_NAME)
endif
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/cm/newinst setup, 1.9, 1.10
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/cm/newinst
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4616
Modified Files:
setup
Log Message:
[167478] setup script needs to check the DS instance
if the instance dir exists, run ns-config with "-r".
Index: setup
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinst/setup,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- setup 19 Apr 2005 22:07:20 -0000 1.9
+++ setup 2 Sep 2005 23:33:48 -0000 1.10
@@ -248,9 +248,20 @@
echo "SuiteSpotGroup = $group" >> $inffile
echo ServerRoot = `pwd` >> $inffile
+ # check if ds instance directory exists or not
+ # if it does, run ns-config with the reconfigure option
+ doreconfig=""
+ for x in `ls -d slapd-*`
+ do
+ if [ -d $x ]; then
+ doreconfig="-r"
+ break
+ fi
+ done
+
# first, run ds
cd bin/slapd/admin/bin
- ./ns-config -f $inffile -l $logfile -m $installmode || doExit
+ ./ns-config -f $inffile -l $logfile -m $installmode $doreconfig || doExit
cd ../../../..
# next, run admin
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/cm/newinst setup, 1.9, 1.9.2.1
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/cm/newinst
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4584
Modified Files:
Tag: Directory71RtmBranch
setup
Log Message:
[167478] setup script needs to check the DS instance
if the instance dir exists, run ns-config with "-r".
Index: setup
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinst/setup,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -r1.9 -r1.9.2.1
--- setup 19 Apr 2005 22:07:20 -0000 1.9
+++ setup 2 Sep 2005 23:30:49 -0000 1.9.2.1
@@ -248,9 +248,20 @@
echo "SuiteSpotGroup = $group" >> $inffile
echo ServerRoot = `pwd` >> $inffile
+ # check if ds instance directory exists or not
+ # if it does, run ns-config with the reconfigure option
+ doreconfig=""
+ for x in `ls -d slapd-*`
+ do
+ if [ -d $x ]; then
+ doreconfig="-r"
+ break
+ fi
+ done
+
# first, run ds
cd bin/slapd/admin/bin
- ./ns-config -f $inffile -l $logfile -m $installmode || doExit
+ ./ns-config -f $inffile -l $logfile -m $installmode $doreconfig || doExit
cd ../../../..
# next, run admin
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/cm/newinstnt Makefile, 1.6, 1.7 dsinst.c, 1.11, 1.12
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/cm/newinstnt
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32096/ldapserver/ldap/cm/newinstnt
Modified Files:
Makefile dsinst.c
Log Message:
Bug(s) fixed: 167453
Bug Description: Use all open source components
Reviewed by: Noriko (Thanks!)
Fix Description: This changes the DS 72 build to pick up the new Admin
Server open source candidate (using Apache, modules, etc), and the new
adminutil and setuputil components. The code has been changed to
reflect the new naming (adminsdk -> adminutil, setupsdk -> setuputil)
and new versions of these components (7.1) and new /s/b/c disk layout
where applicable. We don't really get very much from the admin server
anymore, just the admin and base packages. All of the other setup stuff
(setup, setup.inf, svrcore, etc.) come directly from the setuputil package.
Platforms tested: RHEL3
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinstnt/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile 19 Apr 2005 22:07:21 -0000 1.6
+++ Makefile 2 Sep 2005 20:40:54 -0000 1.7
@@ -54,7 +54,7 @@
OUTDIR=$(OBJDIR)/setup
-CFLAGS=/nologo /MD /W3 /Gm /GX /Zi /Od $(SETUPSDK_INCLUDE) $(LDAPSDK_INCLUDE) \
+CFLAGS=/nologo /MD /W3 /Gm /GX /Zi /Od $(SETUPUTIL_INCLUDE) $(LDAPSDK_INCLUDE) \
/I "$(LDAP_SRC)/admin/include" /I "$(LDAP_SRC)/admin/lib" \
/I "$(LDAP_SRC)/admin/src" /D \
"WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(OUTDIR)/dsinst.pch" /YX \
@@ -71,7 +71,7 @@
kernel32.lib user32.lib gdi32.lib comdlg32.lib\
comctl32.lib advapi32.lib shell32.lib uuid.lib\
wsock32.lib\
- $(SETUPSDKLINK) $(LDAP_SDK_LIBLDAP_DLL) $(NSPRLINK)
+ $(SETUPUTILLINK) $(LDAP_SDK_LIBLDAP_DLL) $(NSPRLINK)
DSOBJS= \
$(OUTDIR)/dsinst_dsalib_dn.obj \
@@ -92,7 +92,7 @@
RM=erase /F /Q
FIXINF= ../newinst/fixINF.pl
-all: $(SETUPSDK_DEP) $(LDAPSDK_DEP) $(NSPR_DEP) $(ADMINUTIL_DEP) $(OUTDIR)/dsinst.dll $(OUTDIR)/slapd.inf
+all: $(SETUPUTIL_DEP) $(LDAPSDK_DEP) $(NSPR_DEP) $(ADMINUTIL_DEP) $(OUTDIR)/dsinst.dll $(OUTDIR)/slapd.inf
clean:
-rm -rf "$(OUTDIR)"
Index: dsinst.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinstnt/dsinst.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- dsinst.c 19 Apr 2005 22:07:21 -0000 1.11
+++ dsinst.c 2 Sep 2005 20:40:54 -0000 1.12
@@ -7455,7 +7455,7 @@
return FALSE;
}
- // hack to work around potential bug in setupsdk . . .
+ // hack to work around potential bug in setuputil . . .
SetCurrentDirectory("../slapd");
my_snprintf(infFile, sizeof(infFile), "slapd.inf");
GetProductInfoStringWithTok(NSPERL_POST_INSTALL_PROG, "=", nsPerlPostInstall,
18 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/cm Makefile,1.30,1.31
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/cm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32096/ldapserver/ldap/cm
Modified Files:
Makefile
Log Message:
Bug(s) fixed: 167453
Bug Description: Use all open source components
Reviewed by: Noriko (Thanks!)
Fix Description: This changes the DS 72 build to pick up the new Admin
Server open source candidate (using Apache, modules, etc), and the new
adminutil and setuputil components. The code has been changed to
reflect the new naming (adminsdk -> adminutil, setupsdk -> setuputil)
and new versions of these components (7.1) and new /s/b/c disk layout
where applicable. We don't really get very much from the admin server
anymore, just the admin and base packages. All of the other setup stuff
(setup, setup.inf, svrcore, etc.) come directly from the setuputil package.
Platforms tested: RHEL3
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/Makefile,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Makefile 28 Apr 2005 17:32:32 -0000 1.30
+++ Makefile 2 Sep 2005 20:40:53 -0000 1.31
@@ -194,12 +194,12 @@
#ADM_VERSDIR = admserv40
#ADM_RELDATE = untested/19980119
#IMPORTADMINSRV = $(IMPORTADMINSRV_BASE)/$(NSOBJDIR_NAME_32)
-IMPORTADMINSRVNOTAR = $(COMPONENTS_DIR)/$(ADM_VERSDIR)/$(ADM_VERSION)/untar/$(NSOBJDIR_NAME)
+IMPORTADMINSRVNOTARBASE = $(COMPONENTS_DIR_DEV)/$(ADM_VERSDIR)/$(ADM_VERSION)/$(NSOBJDIR_NAME)
# these are files and directories in the import adminsrv directory which we don't
# make a local copy of, we just import directly into the tar file or create a
# symlink to
-ADMIN_IMPORTS=setup base admin svrcore silent.inf LICENSE.txt README.txt
-ADMIN_SERVER_TARGZ=admserv.tar.gz
+ADMIN_IMPORTS=base admin
+ADMIN_SERVER_TARGZ=adminserver.tar.gz
ADMIN_IMPORTS_TARGZ=$(ADMIN_SERVER_TARGZ)
# Release directory for ldapsdk
@@ -610,9 +610,11 @@
$(INSTDIR)/tools/infozip.zip \
$(ADMSERV_DEP)
-# copy over the setup sdk stuff
-# hack - remove once admin server bundles setupsdk 6.02
-# cp -R $(SETUP_SDK_BUILD_DIR)/bin/* $(INSTDIR)
+# this gets setup, setup.inf, silent.inf, the zip wrapper, and svrcore, among others
+ifeq ($(USE_SETUPUTIL),1)
+ cp -R $(SETUPUTIL_BINPATH)/* $(INSTDIR)
+ $(PERL) -w $(FIX_SETUP_INF) $(SETUPUTIL_BINPATH)/setup.inf $(INSTDIR)/setup.inf
+endif
# copy in our product .inf files
$(INSTALL) -m 755 $(OBJDIR_32)/*.inf $(INSTDIR)/slapd
@@ -675,23 +677,17 @@
# if the untar directory is there, hooray; otherwise, we will have to unpack the
# binaries ourselves . . .
- @curdir=`pwd`; cd $(INSTDIR) ; \
- if [ ! -d $(IMPORTADMINSRVNOTAR) ] ; \
+ curdir=`pwd`; cd $(INSTDIR) ; \
+ if [ ! -d $(IMPORTADMINSRVNOTARBASE)/admin ] ; \
then for file in $(ADMIN_IMPORTS_TARGZ) ; \
do rm -rf $$file ; \
$(GUNZIP) -c $(ADMSERV_DIR)/$$file | $(TAR) xvf - ; \
done ; \
- cd $$curdir ; \
- $(PERL) -w $(FIX_SETUP_INF) $(INSTDIR)/setup.inf \
- $(INSTDIR)/setup.inf.tmp ; \
- mv $(INSTDIR)/setup.inf.tmp \
- $(INSTDIR)/setup.inf ; \
else \
for file in $(ADMIN_IMPORTS) ; \
do rm -rf $$file ; \
- ln -s $(IMPORTADMINSRVNOTAR)/$$file $$file ; \
+ cp -r $(IMPORTADMINSRVNOTARBASE)/$$file $$file ; \
done ; \
- $(PERL) -w $(FIX_SETUP_INF) $(IMPORTADMINSRVNOTAR)/setup.inf setup.inf ; \
fi
# we must remove the nsbase.zip file - we package those files now
@@ -700,11 +696,6 @@
# base.inf file
$(PERL) -w $(FIX_BASE_INF) $(INSTDIR)/base/base.inf
-# We must remove the JRE per Red Hat. The user will download the jre
-ifneq ($(ARCH), Linux)
- rm -f $(INSTDIR)/base/nsjre.zip
-endif
-
# Move setup binary to dssetup
mv $(INSTDIR)/setup $(INSTDIR)/dssetup
# Move the new setup wrappers into place
@@ -734,11 +725,6 @@
# Install dsktune at root of Installation
cp $(RELDIR)/bin/slapd/server/dsktune $(INSTDIR)
-# copy the sample silent.inf from setup
- if [ ! -f $(INSTDIR)/silent.inf ] ; \
- then cp $(SETUPSDK_BINPATH)/silent.inf $(INSTDIR) ; \
- fi
-
ifndef NO_INSTALLER_TAR_FILES
# build the slapd package tar file
cd $(INSTDIR); $(TAR) cvf - slapd \
18 years, 6 months