mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* primegen.c (is_prime): Free A2. Noted by pmike2001@mail.ru.
Fixes #423. * DETAILS: Document new status codes. * cardglue.c (agent_scd_pkdecrypt, agent_scd_pksign) (agent_scd_genkey, agent_scd_setattr, agent_scd_change_pin) (agent_scd_checkpin, agent_openpgp_storekey): Make sure to send a SC_OP_FAILURE after card operations which might change data. * card-util.c (change_pin): Send a SC_OP_SUCCESS after a PIN has been changed. (change_name): Removed a debug output. * status.h, status.c: New codes BAD_PASSPHRASE_PIN, SC_OP_FAILURE and SC_OP_SUCCESS. * de.po: Updated. Translation is still in the works, though.
This commit is contained in:
parent
db82cdd26a
commit
c91e30fda4
11 changed files with 420 additions and 394 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-03-07 Werner Koch <wk@g10code.com>
|
||||
|
||||
* primegen.c (is_prime): Free A2. Noted by pmike2001@mail.ru.
|
||||
Fixes #423.
|
||||
|
||||
2004-11-30 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* md.c (string_to_digest_algo): Allow read/write SHA384 and
|
||||
|
|
|
@ -462,15 +462,16 @@ is_prime( MPI n, int steps, int *count )
|
|||
mpi_set_ui( x, 2 );
|
||||
}
|
||||
else {
|
||||
/*mpi_set_bytes( x, nbits-1, get_random_byte, 0 );*/
|
||||
{ char *p = get_random_bits( nbits, 0, 0 );
|
||||
mpi_set_buffer( x, p, (nbits+7)/8, 0 );
|
||||
m_free(p);
|
||||
}
|
||||
/* make sure that the number is smaller than the prime
|
||||
* and keep the randomness of the high bit */
|
||||
char *p;
|
||||
|
||||
p = get_random_bits( nbits, 0, 0 );
|
||||
mpi_set_buffer( x, p, (nbits+7)/8, 0 );
|
||||
m_free(p);
|
||||
|
||||
/* Make sure that the number is smaller than the prime
|
||||
* and keep the randomness of the high bit. */
|
||||
if( mpi_test_bit( x, nbits-2 ) ) {
|
||||
mpi_set_highbit( x, nbits-2 ); /* clear all higher bits */
|
||||
mpi_set_highbit( x, nbits-2 ); /* Clear all higher bits */
|
||||
}
|
||||
else {
|
||||
mpi_set_highbit( x, nbits-2 );
|
||||
|
@ -498,6 +499,7 @@ is_prime( MPI n, int steps, int *count )
|
|||
mpi_free( z );
|
||||
mpi_free( nminus1 );
|
||||
mpi_free( q );
|
||||
mpi_free (a2);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue