1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* g10.c, options.h: Removed option --emulate-checksum-bug.

* misc.c (checksum_u16_nobug): Removed.
(checksum_u16): Removed the bug emulation.
(checksum_mpi): Ditto.
(checksum_mpi_counted_nbits): Removed and replaced all calls
with checksum_mpi.
* parse-packet.c (read_protected_v3_mpi): New.
(parse_key): Use it here to store it as an opaque MPI.
* seckey-cert.c (do_check): Changed the v3 unprotection to the new
why to store these keys.
(protect_secret_key): Likewise.
* build-packet.c (do_secret_key): And changed the writing.
This commit is contained in:
Werner Koch 2002-09-11 07:27:54 +00:00
parent c30d7e8dc7
commit c5445cc323
10 changed files with 152 additions and 126 deletions

View file

@ -690,7 +690,7 @@ gen_elg(int algo, unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
sk->is_protected = 0;
sk->protect.algo = 0;
sk->csum = checksum_mpi_counted_nbits( sk->skey[3] );
sk->csum = checksum_mpi( sk->skey[3] );
if( ret_sk ) /* not a subkey: return an unprotected version of the sk */
*ret_sk = copy_secret_key( NULL, sk );
@ -776,7 +776,7 @@ gen_dsa(unsigned int nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
sk->is_protected = 0;
sk->protect.algo = 0;
sk->csum = checksum_mpi_counted_nbits( sk->skey[4] );
sk->csum = checksum_mpi ( sk->skey[4] );
if( ret_sk ) /* not a subkey: return an unprotected version of the sk */
*ret_sk = copy_secret_key( NULL, sk );
@ -866,10 +866,10 @@ gen_rsa(int algo, unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
sk->is_protected = 0;
sk->protect.algo = 0;
sk->csum = checksum_mpi_counted_nbits( sk->skey[2] );
sk->csum += checksum_mpi_counted_nbits( sk->skey[3] );
sk->csum += checksum_mpi_counted_nbits( sk->skey[4] );
sk->csum += checksum_mpi_counted_nbits( sk->skey[5] );
sk->csum = checksum_mpi (sk->skey[2] );
sk->csum += checksum_mpi (sk->skey[3] );
sk->csum += checksum_mpi (sk->skey[4] );
sk->csum += checksum_mpi (sk->skey[5] );
if( ret_sk ) /* not a subkey: return an unprotected version of the sk */
*ret_sk = copy_secret_key( NULL, sk );