aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog54
-rw-r--r--g10/Makefile.am2
-rw-r--r--g10/compress.c26
-rw-r--r--g10/decrypt.c1
-rw-r--r--g10/encode.c4
-rw-r--r--g10/encr-data.c1
-rw-r--r--g10/exec.c10
-rw-r--r--g10/filter.h6
-rw-r--r--g10/free-packet.c1
-rw-r--r--g10/g10.c10
-rw-r--r--g10/helptext.c2
-rw-r--r--g10/keyedit.c17
-rw-r--r--g10/keygen.c10
-rw-r--r--g10/keyring.c3
-rw-r--r--g10/main.h4
-rw-r--r--g10/options.skel4
-rw-r--r--g10/parse-packet.c4
-rw-r--r--g10/tdbio.c2
18 files changed, 116 insertions, 45 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index d2c63dc53..bb197982b 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,43 @@
+2002-04-06 Werner Koch <[email protected]>
+
+ * keyring.c (keyring_get_keyblock): Disable the keylist mode here.
+
+ * encode.c (encode_simple, encode_crypt): Only test on compressed
+ files if a compress level was not explicity set.
+
+ * keygen.c (keygen_set_std_prefs): Removed Blowfish and Twofish
+ from the list of default preferences, swapped the preferences of
+ RMD160 and SHA1. Don't include a preference to 3DES unless the
+ IDEA kludge gets used.
+
+ * free-packet.c (free_packet): call free_encrypted also for
+ PKT_ENCRYPTED_MDC.
+
+ * compress.c (release_context): New.
+ (handle_compressed): Allocate the context and setup a closure to
+ release the context. This is required because there is no
+ guarabntee that the filter gets popped from the chain at the end
+ of the function. Problem noted by Timo and probably also the
+ cause for a couple of other reports.
+ (compress_filter): Use the release function if set.
+
+ * tdbio.c [__CYGWIN32__]: Don't rename ftruncate. Noted by
+ Disastry.
+
+ * parse-packet.c (parse_signature): Put parens around a bit test.
+
+ * exec.c (make_tempdir): Double backslash for TMP directory
+ creation under Windows. Better strlen the DIRSEP_S constants for
+ allocation measurements.
+
+ * decrypt.c (decrypt_messages): Release the passphrase aquired
+ by get_last_passphrase.
+
+2002-04-02 Werner Koch <[email protected]>
+
+ * Makefile.am (EXTRA_DIST): Removed OPTIONS an pubring.asc - they
+ are no longer of any use.
+
2002-04-03 David Shaw <[email protected]>
* keyserver.c (parse_keyserver_options): fix auto-key-retrieve to
@@ -37,6 +77,16 @@
* hkp.c (write_quoted): quote backslashes from keyserver searches
+2002-03-26 Werner Koch <[email protected]>
+
+ * keygen.c (ask_keysize): Removed the warning for key sizes > 1536.
+
+2002-03-25 Werner Koch <[email protected]>
+
+ * keyedit.c (sign_uids): Use 2 strings and not a %s so that
+ translations can be done the right way.
+ * helptext.c: Fixed small typo.
+
2002-03-23 David Shaw <[email protected]>
* import.c (append_uid, merge_sigs): it is okay to import
@@ -95,6 +145,10 @@
* sign.c (clearsign_file): Allow --not-dash-escaped to work with
v3 keys.
+2002-03-14 Werner Koch <[email protected]>
+
+ * main.h: Changed the default algorithms to CAST5 and SHA1.
+
2002-03-13 David Shaw <[email protected]>
* import.c (chk_self_sigs): Show which user ID a bad self-sig
diff --git a/g10/Makefile.am b/g10/Makefile.am
index 7ee1729df..cca0385d0 100644
--- a/g10/Makefile.am
+++ b/g10/Makefile.am
@@ -19,7 +19,7 @@
## Process this file with automake to produce Makefile.in
INCLUDES = -I.. -I$(top_srcdir)/include -I$(top_srcdir)/intl
-EXTRA_DIST = OPTIONS pubring.asc options.skel
+EXTRA_DIST = options.skel
# it seems that we can't use this with automake 1.5
#OMIT_DEPENDENCIES = zlib.h zconf.h
LDFLAGS = @LDFLAGS@ @DYNLINK_LDFLAGS@
diff --git a/g10/compress.c b/g10/compress.c
index 766fad9a5..70df4510b 100644
--- a/g10/compress.c
+++ b/g10/compress.c
@@ -266,12 +266,21 @@ compress_filter( void *opaque, int control,
zfx->opaque = NULL;
m_free(zfx->outbuf); zfx->outbuf = NULL;
}
+ if (zfx->release)
+ zfx->release (zfx);
}
else if( control == IOBUFCTRL_DESC )
*(char**)buf = "compress_filter";
return rc;
}
+
+static void
+release_context (compress_filter_context_t *ctx)
+{
+ m_free (ctx);
+}
+
/****************
* Handle a compressed packet
*/
@@ -279,26 +288,19 @@ int
handle_compressed( void *procctx, PKT_compressed *cd,
int (*callback)(IOBUF, void *), void *passthru )
{
- compress_filter_context_t cfx;
+ compress_filter_context_t *cfx;
int rc;
- memset( &cfx, 0, sizeof cfx );
if( cd->algorithm < 1 || cd->algorithm > 2 )
return G10ERR_COMPR_ALGO;
- cfx.algo = cd->algorithm;
-
- iobuf_push_filter( cd->buf, compress_filter, &cfx );
+ cfx = m_alloc_clear (sizeof *cfx);
+ cfx->algo = cd->algorithm;
+ cfx->release = release_context;
+ iobuf_push_filter( cd->buf, compress_filter, cfx );
if( callback )
rc = callback(cd->buf, passthru );
else
rc = proc_packets(procctx, cd->buf);
- #if 0
- iobuf_pop_filter( cd->buf, compress_filter, &cfx );
- if( cd->len )
- iobuf_set_limit( cd->buf, 0 ); /* disable the readlimit */
- else
- iobuf_clear_eof( cd->buf );
- #endif
cd->buf = NULL;
return rc;
}
diff --git a/g10/decrypt.c b/g10/decrypt.c
index 6e43295ba..ce2d9cd98 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -121,6 +121,7 @@ decrypt_messages(int nfiles, char **files)
g10_errstr(rc));
p = get_last_passphrase();
set_next_passphrase(p);
+ m_free (p);
files++;
m_free(output);
write_status( STATUS_FILE_DONE );
diff --git a/g10/encode.c b/g10/encode.c
index 7412c8236..36747f074 100644
--- a/g10/encode.c
+++ b/g10/encode.c
@@ -86,7 +86,7 @@ encode_simple( const char *filename, int mode )
memset( &tfx, 0, sizeof tfx);
init_packet(&pkt);
- if (is_file_compressed(filename, &rc))
+ if (opt.compress == -1 && is_file_compressed(filename, &rc))
{
if (opt.verbose)
log_info(_("`%s' already compressed\n"), filename);
@@ -290,7 +290,7 @@ encode_crypt( const char *filename, STRLIST remusr )
}
}
- if (is_file_compressed(filename, &rc2))
+ if (opt.compress == -1 && is_file_compressed(filename, &rc2))
{
if (opt.verbose)
log_info(_("`%s' already compressed\n"), filename);
diff --git a/g10/encr-data.c b/g10/encr-data.c
index e2752bf36..c8a8c85db 100644
--- a/g10/encr-data.c
+++ b/g10/encr-data.c
@@ -148,6 +148,7 @@ decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
/*log_hexdump("MDC calculated:", md_read( dfx.mdc_hash, 0), datalen);*/
/*log_hexdump("MDC message :", dfx.defer, 20);*/
}
+
leave:
cipher_close(dfx.cipher_hd);
diff --git a/g10/exec.c b/g10/exec.c
index 910413339..3be81e947 100644
--- a/g10/exec.c
+++ b/g10/exec.c
@@ -64,7 +64,7 @@ static int make_tempdir(struct exec_info *info)
#elif defined (__MINGW32__) || defined (__CYGWIN32__)
tmp=m_alloc(256);
if(GetTempPath(256,tmp)==0)
- strcpy(tmp,"c:\temp");
+ strcpy(tmp,"c:\\temp");
else
{
int len=strlen(tmp);
@@ -83,7 +83,7 @@ static int make_tempdir(struct exec_info *info)
}
}
- info->tempdir=m_alloc(strlen(tmp)+1+10+1);
+ info->tempdir=m_alloc(strlen(tmp)+strlen(DIRSEP_S)+10+1);
sprintf(info->tempdir,"%s" DIRSEP_S "gpg-XXXXXX",tmp);
@@ -98,13 +98,15 @@ static int make_tempdir(struct exec_info *info)
{
info->madedir=1;
- info->tempfile_in=m_alloc(strlen(info->tempdir)+1+10+1);
+ info->tempfile_in=m_alloc(strlen(info->tempdir)
+ +strlen(DIRSEP_S)+6+strlen(EXTSEP_S)+3+1);
sprintf(info->tempfile_in,"%s" DIRSEP_S "datain" EXTSEP_S "%s",
info->tempdir,info->binary?"bin":"txt");
if(!info->writeonly)
{
- info->tempfile_out=m_alloc(strlen(info->tempdir)+1+11+1);
+ info->tempfile_out=m_alloc(strlen(info->tempdir)
+ +strlen(DIRSEP_S)+7+strlen(EXTSEP_S)+3+1);
sprintf(info->tempfile_out,"%s" DIRSEP_S "dataout" EXTSEP_S "%s",
info->tempdir,info->binary?"bin":"txt");
}
diff --git a/g10/filter.h b/g10/filter.h
index 2261a3cf2..b7a99e6bc 100644
--- a/g10/filter.h
+++ b/g10/filter.h
@@ -68,7 +68,7 @@ struct unarmor_pump_s;
typedef struct unarmor_pump_s *UnarmorPump;
-typedef struct {
+struct compress_filter_context_s {
int status;
void *opaque; /* (used for z_stream) */
byte *inbuf;
@@ -77,7 +77,9 @@ typedef struct {
unsigned outbufsize;
int algo; /* compress algo */
int algo1hack;
-} compress_filter_context_t;
+ void (*release)(struct compress_filter_context_s*);
+};
+typedef struct compress_filter_context_s compress_filter_context_t;
typedef struct {
diff --git a/g10/free-packet.c b/g10/free-packet.c
index 4df3658d3..0161eac5a 100644
--- a/g10/free-packet.c
+++ b/g10/free-packet.c
@@ -390,6 +390,7 @@ free_packet( PACKET *pkt )
free_compressed( pkt->pkt.compressed);
break;
case PKT_ENCRYPTED:
+ case PKT_ENCRYPTED_MDC:
free_encrypted( pkt->pkt.encrypted );
break;
case PKT_PLAINTEXT:
diff --git a/g10/g10.c b/g10/g10.c
index 22acf8897..6732d0e30 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -832,7 +832,7 @@ main( int argc, char **argv )
#endif
}
- #ifdef HAVE_DOSISH_SYSTEM
+#ifdef HAVE_DOSISH_SYSTEM
if ( strchr (opt.homedir,'\\') ) {
char *d, *buf = m_alloc (strlen (opt.homedir)+1);
const char *s = opt.homedir;
@@ -841,13 +841,13 @@ main( int argc, char **argv )
*d = 0;
opt.homedir = buf;
}
- #endif
- #undef USE_SHM_COPROCESSING
- #ifdef USE_SHM_COPROCESSING
+#endif
+#undef USE_SHM_COPROCESSING /* huh? */
+#ifdef USE_SHM_COPROCESSING
if( opt.shm_coprocess ) {
init_shm_coprocessing(requested_shm_size, 1 );
}
- #endif
+#endif
/* initialize the secure memory. */
secmem_init( 16384 );
maybe_setuid = 0;
diff --git a/g10/helptext.c b/g10/helptext.c
index 973a905c6..911998525 100644
--- a/g10/helptext.c
+++ b/g10/helptext.c
@@ -230,7 +230,7 @@ static struct helptexts { const char *key; const char *help; } helptexts[] = {
{ "keyedit.updpref.okay", N_(
"Change the preferences of all user IDs (or just of the selected ones)\n"
"to the current list of preferences. The timestamp of all affected\n"
- "self-signatures fill be advanced by one second.\n"
+ "self-signatures will be advanced by one second.\n"
)},
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 491ef4e2b..c7650e278 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -371,10 +371,19 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
/* Fixme: see whether there is a revocation in which
* case we should allow to sign it again. */
- tty_printf(_("\"%s\" was already %ssigned by key %08lX\n"),
- uidnode->pkt->pkt.user_id->name,
- (!node->pkt->pkt.signature->flags.exportable &&
- local)?"locally ":"",(ulong)sk_keyid[1] );
+ /* Note: I kept the %s and the empty string in the
+ else branch so that not too many translations
+ get broken. */
+ if (!node->pkt->pkt.signature->flags.exportable && local)
+ tty_printf(_(
+ "\"%s\" was already locally signed by key %08lX\n"),
+ uidnode->pkt->pkt.user_id->name,
+ (ulong)sk_keyid[1] );
+ else
+ tty_printf(_(
+ "\"%s\" was already %ssigned by key %08lX\n"),
+ uidnode->pkt->pkt.user_id->name,
+ "",(ulong)sk_keyid[1] );
sprintf (buf, "%08lX%08lX",
(ulong)sk->keyid[0], (ulong)sk->keyid[1] );
write_status_text (STATUS_ALREADY_SIGNED, buf);
diff --git a/g10/keygen.c b/g10/keygen.c
index 540857762..9c1bae7f1 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -219,9 +219,9 @@ keygen_set_std_prefs (const char *string)
if (!string || !ascii_strcasecmp (string, "default")) {
if ( !check_cipher_algo(CIPHER_ALGO_IDEA) )
- string = "S7 S10 S3 S4 S2 S1 H3 H2 Z2 Z1";
+ string = "S7 S3 S2 S1 H2 H3 Z2 Z1";
else
- string = "S7 S10 S3 S4 S2 H3 H2 Z2 Z1";
+ string = "S7 S3 H2 H3 Z2 Z1";
/* If we have it, IDEA goes *after* 3DES so it won't be used
unless we're encrypting along with a V3 key. Ideally, we
@@ -348,6 +348,7 @@ keygen_upd_std_prefs( PKT_signature *sig, void *opaque )
/****************
* Add preference to the self signature packet.
* This is only called for packets with version > 3.
+
*/
int
keygen_add_std_prefs( PKT_signature *sig, void *opaque )
@@ -865,11 +866,6 @@ ask_keysize( int algo )
break;
}
}
- else if( nbits > 1536 && !cpr_enabled() && algo != PUBKEY_ALGO_RSA ) {
- if( cpr_get_answer_is_yes("keygen.size.large.okay",_(
- "Do you really need such a large keysize? ")) )
- break;
- }
else
break;
}
diff --git a/g10/keyring.c b/g10/keyring.c
index 7852a1481..f75a79dfe 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -354,6 +354,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
int in_cert = 0;
int pk_no = 0;
int uid_no = 0;
+ int save_mode;
if (ret_kb)
*ret_kb = NULL;
@@ -377,6 +378,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
init_packet (pkt);
hd->found.n_packets = 0;;
lastnode = NULL;
+ save_mode = set_packet_list_mode(0);
while ((rc=parse_packet (a, pkt)) != -1) {
hd->found.n_packets++;
if (rc == G10ERR_UNKNOWN_PACKET) {
@@ -444,6 +446,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
pkt = m_alloc (sizeof *pkt);
init_packet(pkt);
}
+ set_packet_list_mode(save_mode);
if (rc == -1 && keyblock)
rc = 0; /* got the entire keyblock */
diff --git a/g10/main.h b/g10/main.h
index 5c1f34f42..adcd0cec1 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -25,9 +25,9 @@
#include "cipher.h"
#include "keydb.h"
-#define DEFAULT_CIPHER_ALGO CIPHER_ALGO_BLOWFISH
+#define DEFAULT_CIPHER_ALGO CIPHER_ALGO_CAST5
#define DEFAULT_PUBKEY_ALGO PUBKEY_ALGO_ELGAMAL
-#define DEFAULT_DIGEST_ALGO DIGEST_ALGO_RMD160
+#define DEFAULT_DIGEST_ALGO DIGEST_ALGO_SHA1
typedef struct {
diff --git a/g10/options.skel b/g10/options.skel
index def2fe5fb..0458ac7b0 100644
--- a/g10/options.skel
+++ b/g10/options.skel
@@ -96,7 +96,7 @@ lock-once
# support).
#
# Example HKP keyserver:
-# x-hkp://wwwkeys.nl.pgp.net
+# x-hkp://keyserver.cryptnet.net
#
# Example email keyserver:
@@ -118,9 +118,9 @@ lock-once
# Most servers do synchronize with each other and DNS round-robin may
# give you a quasi-random server each time.
+#keyserver x-hkp://keyserver.cryptnet.net
#keyserver mailto:[email protected]
#keyserver ldap://keyserver.pgp.com
-#keyserver x-hkp://wwwkeys.nl.pgp.net
# Options for keyserver functions
#
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 68754c25f..9db08fb70 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -1254,7 +1254,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
if(p && *p==0)
sig->flags.exportable=0;
- /* Find all revokation keys. Back to hashed area only. */
+ /* Find all revocation keys. Back to hashed area only. */
if(sig->sig_class==0x1F)
{
struct revocation_key *revkey;
@@ -1267,7 +1267,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
&len,&seq)))
{
if(len==sizeof(struct revocation_key) &&
- revkey->class&0x80) /* 0x80 bit must be set */
+ (revkey->class&0x80)) /* 0x80 bit must be set */
{
sig->revkey=m_realloc(sig->revkey,
sizeof(struct revocation_key *)*(sig->numrevkeys+1));
diff --git a/g10/tdbio.c b/g10/tdbio.c
index 1fa087e46..33e2583c8 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -39,7 +39,7 @@
#include "trustdb.h"
#include "tdbio.h"
-#ifdef HAVE_DOSISH_SYSTEM
+#if defined(HAVE_DOSISH_SYSTEM) && !defined(__CYGWIN32__)
#define ftruncate chsize
#endif