diff options
author | Werner Koch <wk@gnupg.org> | 1999-04-06 20:04:55 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-04-06 20:04:55 +0200 |
commit | 1b9a820c19d8ada57d19ea9ec1bbf7e80cb69d18 (patch) | |
tree | fa5639c6ee2652942b712a244125734d7155c937 /cipher | |
parent | ./BUGS (diff) | |
download | gnupg2-1b9a820c19d8ada57d19ea9ec1bbf7e80cb69d18.tar.xz gnupg2-1b9a820c19d8ada57d19ea9ec1bbf7e80cb69d18.zip |
See ChangeLog: Tue Apr 6 19:58:12 CEST 1999 Werner Koch
Diffstat (limited to 'cipher')
-rw-r--r-- | cipher/ChangeLog | 7 | ||||
-rw-r--r-- | cipher/cipher.c | 3 | ||||
-rw-r--r-- | cipher/random.c | 9 |
3 files changed, 16 insertions, 3 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index bfb5860f3..b1000c8f7 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,10 @@ +Tue Apr 6 19:58:12 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + * random.c (get_random_bits): Can now handle requests > POOLSIZE + + * cipher.c (cipher_open): Now uses standard CFB for automode if + the blocksize is gt 8 (according to rfc2440). + Sat Mar 20 11:44:21 CET 1999 Werner Koch <wk@isil.d.shuttle.de> * rndlinux.c (tty_printf) [IS_MODULE]: Removed. diff --git a/cipher/cipher.c b/cipher/cipher.c index ca79fa9b7..338b2b9d2 100644 --- a/cipher/cipher.c +++ b/cipher/cipher.c @@ -340,7 +340,8 @@ cipher_open( int algo, int mode, int secure ) if( algo == CIPHER_ALGO_DUMMY ) hd->mode = CIPHER_MODE_DUMMY; else if( mode == CIPHER_MODE_AUTO_CFB ) { - if( algo == CIPHER_ALGO_BLOWFISH160 || algo >= 100 ) + if( hd->blocksize > 8 + || algo == CIPHER_ALGO_BLOWFISH160 || algo >= 100 ) hd->mode = CIPHER_MODE_CFB; else hd->mode = CIPHER_MODE_PHILS_CFB; diff --git a/cipher/random.c b/cipher/random.c index eedfcfa65..a201c1dbb 100644 --- a/cipher/random.c +++ b/cipher/random.c @@ -169,14 +169,19 @@ random_is_faked() byte * get_random_bits( size_t nbits, int level, int secure ) { - byte *buf; + byte *buf, *p; size_t nbytes = (nbits+7)/8; if( quick_test && level > 1 ) level = 1; MASK_LEVEL(level); buf = secure && secure_alloc ? m_alloc_secure( nbytes ) : m_alloc( nbytes ); - read_pool( buf, nbytes, level ); + for( p = buf; nbytes > 0; ) { + size_t n = nbytes > POOLSIZE? POOLSIZE : nbytes; + read_pool( p, n, level ); + nbytes -= n; + p += n; + } return buf; } |