mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Fri Apr 9 12:26:25 CEST 1999 Werner Koch
This commit is contained in:
parent
97efca04ef
commit
02d018f9c8
22 changed files with 152 additions and 139 deletions
|
@ -1,3 +1,14 @@
|
|||
Fri Apr 9 12:26:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* status.c (write_status_text): Some more status codes.
|
||||
* passphrase_to_dek (passphrase_to_dek): add a status code.
|
||||
* seckey_cert.c (check_secret_key): Likewise.
|
||||
|
||||
* encr-data.c (decrypt_data): Reverse the last changes
|
||||
* cipher.c (write_header): Ditto.
|
||||
|
||||
* parse-packet.c (parse_key): Dropped kludge for ancient blowfish mode.
|
||||
|
||||
Thu Apr 8 09:35:53 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* mainproc.c (proc_encrypted): Add a new status output
|
||||
|
|
|
@ -58,10 +58,7 @@ write_header( cipher_filter_context_t *cfx, IOBUF a )
|
|||
blocksize = cipher_get_blocksize( cfx->dek->algo );
|
||||
if( blocksize < 8 || blocksize > 16 )
|
||||
log_fatal("unsupported blocksize %u\n", blocksize );
|
||||
/* FIXME: remove the kludge for the experimental twofish128 mode:
|
||||
* we always use the 10 byte prefix and not one depending on the blocksize
|
||||
*/
|
||||
nprefix = cfx->dek->algo == CIPHER_ALGO_TWOFISH_OLD? blocksize : 8;
|
||||
nprefix = blocksize;
|
||||
randomize_buffer( temp, nprefix, 1 );
|
||||
temp[nprefix] = temp[nprefix-2];
|
||||
temp[nprefix+1] = temp[nprefix-1];
|
||||
|
|
|
@ -66,10 +66,7 @@ decrypt_data( PKT_encrypted *ed, DEK *dek )
|
|||
blocksize = cipher_get_blocksize(dek->algo);
|
||||
if( !blocksize || blocksize > 16 )
|
||||
log_fatal("unsupported blocksize %u\n", blocksize );
|
||||
/* FIXME: remove the kludge for the experimental twofish128 mode:
|
||||
* we always use the 10 byte prefix and not one depending on the blocksize
|
||||
*/
|
||||
nprefix = dek->algo == CIPHER_ALGO_TWOFISH_OLD? blocksize : 8;
|
||||
nprefix = blocksize;
|
||||
if( ed->len && ed->len < (nprefix+2) )
|
||||
BUG();
|
||||
|
||||
|
|
|
@ -988,6 +988,10 @@ merge_blocks( const char *fname, KBNODE keyblock_orig, KBNODE keyblock,
|
|||
/****************
|
||||
* append the userid starting with NODE and all signatures to KEYBLOCK.
|
||||
* Mark all new and copied packets by setting flag bit 0.
|
||||
* FIXME: It may happen that two identical user ID gets imported; should we
|
||||
* add another check and how can we handle the signature? Maybe
|
||||
* we have to collapse both UIDs into one and then remove duplicated
|
||||
* signatures.
|
||||
*/
|
||||
static int
|
||||
append_uid( KBNODE keyblock, KBNODE node, int *n_sigs,
|
||||
|
|
|
@ -241,6 +241,7 @@ proc_encrypted( CTX c, PACKET *pkt )
|
|||
if( result == -1 )
|
||||
;
|
||||
else if( !result ) {
|
||||
write_status( STATUS_DECRYPTION_OKAY );
|
||||
if( opt.verbose > 1 )
|
||||
log_info(_("decryption okay\n"));
|
||||
}
|
||||
|
|
|
@ -1305,11 +1305,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||
}
|
||||
else { /* old version; no S2K, so we set mode to 0, hash MD5 */
|
||||
sk->protect.s2k.mode = 0;
|
||||
/* We need a kludge to cope with old GNUPG versions */
|
||||
sk->protect.s2k.hash_algo =
|
||||
( sk->protect.algo == CIPHER_ALGO_BLOWFISH160
|
||||
&& algorithm == PUBKEY_ALGO_ELGAMAL_E ) ?
|
||||
DIGEST_ALGO_RMD160 : DIGEST_ALGO_MD5;
|
||||
sk->protect.s2k.hash_algo = DIGEST_ALGO_MD5;
|
||||
if( list_mode )
|
||||
printf( "\tprotect algo: %d (hash algo: %d)\n",
|
||||
sk->protect.algo, sk->protect.s2k.hash_algo );
|
||||
|
|
|
@ -201,6 +201,10 @@ passphrase_to_dek( u32 *keyid, int cipher_algo, STRING2KEY *s2k, int mode )
|
|||
m_free(pw2);
|
||||
}
|
||||
}
|
||||
|
||||
if( !pw || !*pw )
|
||||
write_status( STATUS_MISSING_PASSPHRASE );
|
||||
|
||||
dek = m_alloc_secure( sizeof *dek );
|
||||
dek->algo = cipher_algo;
|
||||
if( !*pw && mode == 2 )
|
||||
|
|
|
@ -187,6 +187,9 @@ check_secret_key( PKT_secret_key *sk, int n )
|
|||
break;
|
||||
}
|
||||
|
||||
if( !rc )
|
||||
write_status( STATUS_GOOD_PASSPHRASE );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,9 @@ write_status_text ( int no, const char *text)
|
|||
case STATUS_NO_SECKEY : s = "NO_SECKEY\n"; break;
|
||||
case STATUS_NEED_PASSPHRASE_SYM: s = "NEED_PASSPHRASE_SYM\n"; break;
|
||||
case STATUS_DECRYPTION_FAILED: s = "DECRYPTION_FAILED\n"; break;
|
||||
case STATUS_DECRYPTION_OKAY: s = "DECRYPTION_OKAY\n"; break;
|
||||
case STATUS_MISSING_PASSPHRASE: s = "MISSING_PASSPHRASE\n"; break;
|
||||
case STATUS_GOOD_PASSPHRASE : s = "GOOD_PASSPHRASE\n"; break;
|
||||
default: s = "?\n"; break;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
#define STATUS_NO_SECKEY 27
|
||||
#define STATUS_NEED_PASSPHRASE_SYM 28
|
||||
#define STATUS_DECRYPTION_FAILED 29
|
||||
#define STATUS_DECRYPTION_OKAY 30
|
||||
#define STATUS_MISSING_PASSPHRASE 31
|
||||
#define STATUS_GOOD_PASSPHRASE 32
|
||||
|
||||
/*-- status.c --*/
|
||||
void set_status_fd ( int fd );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue