mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
sync
This commit is contained in:
parent
c5b6f97767
commit
0a76a4465b
41 changed files with 708 additions and 456 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jul 13 21:30:52 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||
|
||||
* random.c (read_pool): Simple alloc if secure_alloc is not set.
|
||||
(get_random_bits): Ditto.
|
||||
|
||||
Thu Jul 9 13:01:14 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||
|
||||
* dynload.c (load_extension): Function now nbails out if
|
||||
|
|
|
@ -281,7 +281,6 @@ gen_prime( unsigned nbits, int secret, int randomlevel )
|
|||
mods = m_alloc( no_of_small_prime_numbers * sizeof *mods );
|
||||
/* make nbits fit into MPI implementation */
|
||||
nlimbs = (nbits + BITS_PER_MPI_LIMB - 1) / BITS_PER_MPI_LIMB;
|
||||
assert( nlimbs );
|
||||
val_2 = mpi_alloc( nlimbs );
|
||||
mpi_set_ui(val_2, 2);
|
||||
val_3 = mpi_alloc( nlimbs );
|
||||
|
|
|
@ -153,7 +153,7 @@ get_random_bits( size_t nbits, int level, int secure )
|
|||
size_t nbytes = (nbits+7)/8;
|
||||
|
||||
MASK_LEVEL(level);
|
||||
buf = secure? m_alloc_secure( nbytes ) : m_alloc( nbytes );
|
||||
buf = secure && secure_alloc ? m_alloc_secure( nbytes ) : m_alloc( nbytes );
|
||||
read_pool( buf, nbytes, level );
|
||||
return buf;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ read_pool( byte *buffer, size_t length, int level )
|
|||
needed = length - pool_balance;
|
||||
if( needed > POOLSIZE )
|
||||
BUG();
|
||||
p = m_alloc_secure( needed );
|
||||
p = secure_alloc ? m_alloc_secure( needed ) : m_alloc(needed);
|
||||
read_random_source( p, needed, 2 ); /* read /dev/random */
|
||||
add_randomness( p, needed, 3);
|
||||
m_free(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue