summaryrefslogtreecommitdiff
path: root/random/gnupg-random.c
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2015-12-29 23:12:58 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-12-29 23:19:44 +0100
commitf5490b490c549efa89eefb6deefdc7341aa6a913 (patch)
tree8d037f950d37621e4f6a144cf71a8bc612f9a51e /random/gnupg-random.c
parent87673d93fd87c3fda97e91842c3d7d326a30ef8c (diff)
fix compiler warnings in hurd/random
random: Fix compiler warnings. * random/gnupg-random.c: Use byte instead of char. * random/gnupg-rmd.h (rmd160_mixblock): Use byte instead of char. * random/gnupg-rmd.c (rmd160_mixblock): Likewise. * random/gnupg-rmd.c: Place #ifdef __HURD__ earlier to avoid warnings.
Diffstat (limited to 'random/gnupg-random.c')
-rw-r--r--random/gnupg-random.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/random/gnupg-random.c b/random/gnupg-random.c
index 54ee3c55..3cf78121 100644
--- a/random/gnupg-random.c
+++ b/random/gnupg-random.c
@@ -98,8 +98,8 @@
static int is_initialized;
#define MASK_LEVEL(a) do {if( a > 2 ) a = 2; else if( a < 0 ) a = 0; } while(0)
-static char *rndpool; /* allocated size is POOLSIZE+BLOCKLEN */
-static char *keypool; /* allocated size is POOLSIZE+BLOCKLEN */
+static byte *rndpool; /* allocated size is POOLSIZE+BLOCKLEN */
+static byte *keypool; /* allocated size is POOLSIZE+BLOCKLEN */
static size_t pool_readpos;
static size_t pool_writepos;
static int pool_filled;
@@ -209,7 +209,7 @@ quick_random_gen( int onoff )
void
randomize_buffer( byte *buffer, size_t length, int level )
{
- char *p = get_random_bits( length*8, level, 1 );
+ byte *p = get_random_bits( length*8, level, 1 );
memcpy( buffer, p, length );
m_free(p);
}
@@ -267,8 +267,8 @@ get_random_bits( size_t nbits, int level, int secure )
static void
mix_pool(byte *pool)
{
- char *hashbuf = pool + POOLSIZE;
- char *p, *pend;
+ byte *hashbuf = pool + POOLSIZE;
+ byte *p, *pend;
int i, n;
RMD160_CONTEXT md;
@@ -291,7 +291,7 @@ mix_pool(byte *pool)
if( p+DIGESTLEN+BLOCKLEN < pend )
memcpy(hashbuf+DIGESTLEN, p+DIGESTLEN, BLOCKLEN-DIGESTLEN);
else {
- char *pp = p+DIGESTLEN;
+ byte *pp = p+DIGESTLEN;
for(i=DIGESTLEN; i < BLOCKLEN; i++ ) {
if( pp >= pend )
pp = pool;
@@ -323,7 +323,7 @@ read_seed_file()
{
int fd;
struct stat sb;
- unsigned char buffer[POOLSIZE];
+ byte buffer[POOLSIZE];
int n;
if( !seed_file_name )