/* it's base64 encoded. */
bvalue.bv_val = malloc( strlen( &sep[1] ));
bvalue.bv_len = lutil_b64_pton( &sep[1],
- bvalue.bv_val, strlen( &sep[1] ));
+ (unsigned char *) bvalue.bv_val, strlen( &sep[1] ));
if (bvalue.bv_len == (ber_len_t)-1) {
fprintf(stderr, _("base64 decode error\n"));
b64->bv_val = ber_memalloc( b64->bv_len + 1 );
b64->bv_len = lutil_b64_ntop(
- ctrls[i]->ldctl_value.bv_val, ctrls[i]->ldctl_value.bv_len,
+ (unsigned char *) ctrls[i]->ldctl_value.bv_val,
+ ctrls[i]->ldctl_value.bv_len,
b64->bv_val, b64->bv_len );
}
return LBER_DEFAULT;
}
- if( (unsigned) ber_read( ber, netlen, noctets ) != noctets ) {
+ if( (unsigned) ber_read( ber, (char *) netlen, noctets ) != noctets ) {
return LBER_DEFAULT;
}
}
rc = ber_write( ber,
- &nettag[sizeof(ber_tag_t) - taglen],
+ (char *) &nettag[sizeof(ber_tag_t) - taglen],
taglen, nosos );
return rc;
/* write the length itself */
rc = ber_write( ber,
- &netlen[sizeof(ber_len_t)-i],
+ (char *) &netlen[sizeof(ber_len_t)-i],
i, nosos );
return rc == i ? i+1 : -1;
}
rc = ber_write( ber,
- &netnum[sizeof(ber_int_t) - i],
+ (char *) &netnum[sizeof(ber_int_t) - i],
i, 0 );
/* length of tag + length + contents */
/* the length itself */
rc = ber_write( ber,
- &netlen[sizeof(ber_len_t) - (FOUR_BYTE_LEN-1)],
+ (char *) &netlen[sizeof(ber_len_t) - (FOUR_BYTE_LEN-1)],
FOUR_BYTE_LEN-1, 1 );
if( rc != FOUR_BYTE_LEN - 1 ) {
sec_buf_in->buf_end, len );
if ( len >= 4 ) {
- sec_buf_in->buf_end = sb_sasl_pkt_length( sec_buf_in->buf_base,
- max, debuglevel);
+ sec_buf_in->buf_end = sb_sasl_pkt_length(
+ (unsigned char *) sec_buf_in->buf_base, max, debuglevel);
}
else {
sec_buf_in->buf_end = 0;
}
/* The new packet always starts at p->sec_buf_in.buf_base */
- ret = sb_sasl_pkt_length( p->sec_buf_in.buf_base,
+ ret = sb_sasl_pkt_length( (unsigned char *) p->sec_buf_in.buf_base,
*p->sasl_maxbuf, sbiod->sbiod_sb->sb_debug );
/* Grow the packet buffer if neccessary */
/* parsing/printing routines */
static int str2strval( const char *str, ber_len_t stoplen, struct berval *val,
- const char **next, unsigned flags, unsigned *retFlags, void *ctx );
+ const char **next, unsigned flags, int *retFlags, void *ctx );
static int DCE2strval( const char *str, struct berval *val,
const char **next, unsigned flags, void *ctx );
static int IA52strval( const char *str, struct berval *val,
* '\' + HEXPAIR(p) -> unhex(p)
*/
static int
-str2strval( const char *str, ber_len_t stoplen, struct berval *val, const char **next, unsigned flags, unsigned *retFlags, void *ctx )
+str2strval( const char *str, ber_len_t stoplen, struct berval *val, const char **next, unsigned flags, int *retFlags, void *ctx )
{
const char *p, *end, *startPos, *endPos = NULL;
ber_len_t len, escapes;
}
}
}
- Val.bv_val = str->data;
+ Val.bv_val = (char *) str->data;
Val.bv_len = str->length;
switch( str->type ) {
case V_ASN1_UNIVERSALSTRING:
}
SSL_CTX_set_session_id_context( tls_def_ctx,
- "OpenLDAP", sizeof("OpenLDAP")-1 );
+ (const unsigned char *) "OpenLDAP", sizeof("OpenLDAP")-1 );
if ( tls_opt_ciphersuite &&
!SSL_CTX_set_cipher_list( tls_def_ctx, ciphersuite ) )
if (gn->type == GEN_DNS) {
if (ntype != IS_DNS) continue;
- sn = ASN1_STRING_data(gn->d.ia5);
+ sn = (char *) ASN1_STRING_data(gn->d.ia5);
sl = ASN1_STRING_length(gn->d.ia5);
/* Is this an exact match? */
} else if (gn->type == GEN_IPADD) {
if (ntype == IS_DNS) continue;
- sn = ASN1_STRING_data(gn->d.ia5);
+ sn = (char *) ASN1_STRING_data(gn->d.ia5);
sl = ASN1_STRING_length(gn->d.ia5);
#ifdef LDAP_PF_INET6
/* conv UTF-8 to UCS-4, useful for comparisons */
ldap_ucs4_t ldap_x_utf8_to_ucs4( const char * p )
{
- const unsigned char *c = p;
+ const unsigned char *c = (const unsigned char *) p;
ldap_ucs4_t ch;
int len, i;
static unsigned char mask[] = {
int ldap_x_ucs4_to_utf8( ldap_ucs4_t c, char *buf )
{
int len=0;
- unsigned char* p = buf;
+ unsigned char* p = (unsigned char *) buf;
/* not a valid Unicode character */
if ( c < 0 ) return 0;
char* ldap_utf8_next( const char * p )
{
int i;
- const unsigned char *u = p;
+ const unsigned char *u = (const unsigned char *) p;
if( LDAP_UTF8_ISASCII(u) ) {
return (char *) &p[1];
char* ldap_utf8_prev( const char * p )
{
int i;
- const unsigned char *u = p;
+ const unsigned char *u = (const unsigned char *) p;
for( i=-1; i>-6 ; i-- ) {
if ( ( u[i] & 0xc0 ) != 0x80 ) {
int ldap_utf8_copy( char* dst, const char *src )
{
int i;
- const unsigned char *u = src;
+ const unsigned char *u = (const unsigned char *) src;
dst[0] = src[0];
for( n = 0; n < nbytes; n += 16 ) {
struct lutil_MD5Context ctx;
- char digest[16];
+ unsigned char digest[16];
/* poor resolution */
#ifdef HAVE_GETTIMEOFDAY
return NULL;
}
- if( lutil_entropy( pw->bv_val, pw->bv_len) < 0 ) {
+ if( lutil_entropy( (unsigned char *) pw->bv_val, pw->bv_len) < 0 ) {
ber_bvfree( pw );
return NULL;
}
AC_MEMCPY(b64->bv_val, sc->bv_val, sc->bv_len);
rc = lutil_b64_ntop(
- string.bv_val, string.bv_len,
+ (unsigned char *) string.bv_val, string.bv_len,
&b64->bv_val[sc->bv_len], b64len );
if( salt ) ber_memfree( string.bv_val );
{
lutil_SHA1_CTX SHA1context;
unsigned char SHA1digest[LUTIL_SHA1_BYTES];
- unsigned char saltdata[4];
+ char saltdata[4];
struct berval digest;
struct berval salt;
- digest.bv_val = SHA1digest;
+ digest.bv_val = (char *) SHA1digest;
digest.bv_len = sizeof(SHA1digest);
salt.bv_val = saltdata;
salt.bv_len = sizeof(saltdata);
- if( lutil_entropy( salt.bv_val, salt.bv_len) < 0 ) {
+ if( lutil_entropy( (unsigned char *) salt.bv_val, salt.bv_len) < 0 ) {
return NULL;
}
lutil_SHA1_CTX SHA1context;
unsigned char SHA1digest[LUTIL_SHA1_BYTES];
struct berval digest;
- digest.bv_val = SHA1digest;
+ digest.bv_val = (char *) SHA1digest;
digest.bv_len = sizeof(SHA1digest);
lutil_SHA1Init( &SHA1context );
{
lutil_MD5_CTX MD5context;
unsigned char MD5digest[LUTIL_MD5_BYTES];
- unsigned char saltdata[4];
+ char saltdata[4];
struct berval digest;
struct berval salt;
- digest.bv_val = MD5digest;
+ digest.bv_val = (char *) MD5digest;
digest.bv_len = sizeof(MD5digest);
salt.bv_val = saltdata;
salt.bv_len = sizeof(saltdata);
- if( lutil_entropy( salt.bv_val, salt.bv_len) < 0 ) {
+ if( lutil_entropy( (unsigned char *) salt.bv_val, salt.bv_len) < 0 ) {
return NULL;
}
struct berval digest;
- digest.bv_val = MD5digest;
+ digest.bv_val = (char *) MD5digest;
digest.bv_len = sizeof(MD5digest);
lutil_MD5Init( &MD5context );
/* copy the salt we made into entropy before snprintfing
it back into the salt */
char entropy[sizeof(salt)];
- strcpy( entropy, salt );
- snprintf( salt, sizeof(entropy), salt_format, entropy );
+ strcpy( entropy, (char *) salt );
+ snprintf( (char *) salt, sizeof(entropy), salt_format, entropy );
}
- hash.bv_val = crypt( passwd->bv_val, salt );
+ hash.bv_val = crypt( passwd->bv_val, (char *) salt );
if( hash.bv_val == NULL ) return NULL;
i = entry_getlen(&ptr);
x = ch_calloc(1, i);
i = entry_getlen(&ptr);
- x->e_name.bv_val = ptr;
+ x->e_name.bv_val = (char *) ptr;
x->e_name.bv_len = i;
ptr += i+1;
i = entry_getlen(&ptr);
- x->e_nname.bv_val = ptr;
+ x->e_nname.bv_val = (char *) ptr;
x->e_nname.bv_len = i;
ptr += i+1;
#ifdef NEW_LOGGING
while ((i = entry_getlen(&ptr))) {
struct berval bv;
bv.bv_len = i;
- bv.bv_val = ptr;
+ bv.bv_val = (char *) ptr;
if (a) {
a->a_next = (Attribute *)bptr;
}