* This routinue should be extended to support additional sources
* of entropy.
*/
-int lutil_entropy( char *buf, ber_len_t nbytes )
+int lutil_entropy( unsigned char *buf, ber_len_t nbytes )
{
if( nbytes == 0 ) return 0;
struct rdata_s {
int counter;
- char *buf;
+ unsigned char *buf;
struct rdata_s *stack;
pid_t pid;
rdata.junk++;
lutil_MD5Init( &ctx );
- lutil_MD5Update( &ctx, (char *) &rdata, sizeof( rdata ) );
+ lutil_MD5Update( &ctx, (unsigned char *) &rdata, sizeof( rdata ) );
/* allow caller to provided additional entropy */
- lutil_MD5Update( &ctx, (char *) &buf, nbytes );
+ lutil_MD5Update( &ctx, buf, nbytes );
lutil_MD5Final( digest, &ctx );
/* hash credentials with salt */
lutil_MD5Init(&MD5context);
lutil_MD5Update(&MD5context,
- (const unsigned char *) cred->bv_val, cred->bv_len );
+ (const unsigned char *) cred->bv_val,
+ cred->bv_len );
lutil_MD5Update(&MD5context,
- (const unsigned char *) &orig_pass[sizeof(MD5digest)],
+ &orig_pass[sizeof(MD5digest)],
rc - sizeof(MD5digest));
lutil_MD5Final(MD5digest, &MD5context);
/* hash credentials with salt */
lutil_MD5Init(&MD5context);
lutil_MD5Update(&MD5context,
- (const unsigned char *) cred->bv_val, cred->bv_len );
+ (const unsigned char *) cred->bv_val,
+ cred->bv_len );
lutil_MD5Final(MD5digest, &MD5context);
/* compare */