/* $OpenLDAP$ */
/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/*
#include <lber.h>
+#include "ldap_pvt.h"
+
#include "lutil_md5.h"
#include "lutil_sha1.h"
#include "lutil.h"
? memcmp( passwd->bv_val, cred->bv_val, passwd->bv_len )
: 1;
}
-#else
- return 1;
#endif
-
+ return 1;
}
struct berval * lutil_passwd_generate( ber_len_t len )
return NULL;
}
- memcpy( pw->bv_val, sc->name.bv_val, sc->name.bv_len );
- memcpy( &pw->bv_val[sc->name.bv_len], passwd->bv_val, passwd->bv_len );
+ AC_MEMCPY( pw->bv_val, sc->name.bv_val, sc->name.bv_len );
+ AC_MEMCPY( &pw->bv_val[sc->name.bv_len], passwd->bv_val, passwd->bv_len );
pw->bv_val[pw->bv_len] = '\0';
return pw;
return NULL;
}
- memcpy( string.bv_val, hash->bv_val,
+ AC_MEMCPY( string.bv_val, hash->bv_val,
hash->bv_len );
- memcpy( &string.bv_val[hash->bv_len], salt->bv_val,
+ AC_MEMCPY( &string.bv_val[hash->bv_len], salt->bv_val,
salt->bv_len );
string.bv_val[string.bv_len] = '\0';
return NULL;
}
- memcpy(b64->bv_val, sc->name.bv_val, sc->name.bv_len);
+ AC_MEMCPY(b64->bv_val, sc->name.bv_val, sc->name.bv_len);
rc = lutil_b64_ntop(
string.bv_val, string.bv_len,
}
{
- char host[MAXHOSTNAMELEN];
+ char *host = ldap_pvt_get_fqdn( NULL );
- if( gethostname( host, MAXHOSTNAMELEN ) != 0 ) {
+ if( host == NULL ) {
krb5_free_principal( context, client );
krb5_free_context( context );
return 1;
ret = krb5_sname_to_principal( context,
host, "ldap", KRB5_NT_SRV_HST, &server );
+
+ ber_memfree( host );
}
if (ret) {
krb5_free_principal( context, client );
krb5_free_principal( context, server );
- krb5_free_creds_contents( context, &creds );
+ krb5_free_cred_contents( context, &creds );
krb5_free_context( context );
rtn = !!ret;
const struct berval *passwd )
{
lutil_SHA1_CTX SHA1context;
- unsigned char SHA1digest[20];
+ unsigned char SHA1digest[LUTIL_SHA1_BYTES];
struct berval digest;
digest.bv_val = SHA1digest;
digest.bv_len = sizeof(SHA1digest);
const struct berval *passwd )
{
lutil_MD5_CTX MD5context;
- unsigned char MD5digest[16];
+ unsigned char MD5digest[LUTIL_MD5_BYTES];
unsigned char saltdata[4];
struct berval digest;
struct berval salt;
const struct berval *passwd )
{
lutil_MD5_CTX MD5context;
- unsigned char MD5digest[16];
+ unsigned char MD5digest[LUTIL_MD5_BYTES];
struct berval digest;