aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog11
-rw-r--r--g10/cipher.c5
-rw-r--r--g10/encr-data.c5
-rw-r--r--g10/import.c4
-rw-r--r--g10/mainproc.c1
-rw-r--r--g10/parse-packet.c6
-rw-r--r--g10/passphrase.c4
-rw-r--r--g10/seckey-cert.c3
-rw-r--r--g10/status.c3
-rw-r--r--g10/status.h3
10 files changed, 32 insertions, 13 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 217367ec9..fd8e718c7 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,14 @@
+Fri Apr 9 12:26:25 CEST 1999 Werner Koch <[email protected]>
+
+ * 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 <[email protected]>
* mainproc.c (proc_encrypted): Add a new status output
diff --git a/g10/cipher.c b/g10/cipher.c
index 98c5e8403..5a7229f24 100644
--- a/g10/cipher.c
+++ b/g10/cipher.c
@@ -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];
diff --git a/g10/encr-data.c b/g10/encr-data.c
index 8ae6949d8..ff0930775 100644
--- a/g10/encr-data.c
+++ b/g10/encr-data.c
@@ -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();
diff --git a/g10/import.c b/g10/import.c
index 5a739b922..31965dcb9 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -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,
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 45acb3838..5d33f4edc 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -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"));
}
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index bf22f10dc..1683df0a2 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -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 );
diff --git a/g10/passphrase.c b/g10/passphrase.c
index 3cc8e009d..400e60696 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -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 )
diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c
index 4ee0485ca..d875e6333 100644
--- a/g10/seckey-cert.c
+++ b/g10/seckey-cert.c
@@ -187,6 +187,9 @@ check_secret_key( PKT_secret_key *sk, int n )
break;
}
+ if( !rc )
+ write_status( STATUS_GOOD_PASSPHRASE );
+
return rc;
}
diff --git a/g10/status.c b/g10/status.c
index 889c63b0c..9af3c9a5f 100644
--- a/g10/status.c
+++ b/g10/status.c
@@ -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;
}
diff --git a/g10/status.h b/g10/status.h
index a4622f817..083d7ce41 100644
--- a/g10/status.h
+++ b/g10/status.h
@@ -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 );