summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-04-26 13:53:14 +0200
committerWerner Koch <wk@gnupg.org>2010-04-26 13:53:14 +0200
commit31bbe71ad6b6b35016724f1012e66c4253378530 (patch)
tree17883951b8f656b668a287b9b3fa120990f38977 /g10
parentDecryption and signi via agent is now implemented. (diff)
downloadgnupg2-31bbe71ad6b6b35016724f1012e66c4253378530.tar.xz
gnupg2-31bbe71ad6b6b35016724f1012e66c4253378530.zip
Fix preference setting in new keys
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog6
-rw-r--r--g10/decrypt.c2
-rw-r--r--g10/keygen.c25
-rw-r--r--g10/seckey-cert.c3
4 files changed, 31 insertions, 5 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 7fb50191a..e084916f0 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-26 Werner Koch <wk@g10code.com>
+
+ * keygen.c (keygen_set_std_prefs): Explicitly include Z0 in the
+ default preferences if no compression algorithms are available.
+ Remove a possible trailing space in the dummy_string.
+
2010-04-23 Werner Koch <wk@g10code.com>
* pubkey-enc.c (get_it): Use the agent for decryption.
diff --git a/g10/decrypt.c b/g10/decrypt.c
index 870c21616..210e1feec 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -132,7 +132,7 @@ decrypt_message_fd (int input_fd, int output_fd)
}
#ifdef HAVE_W32CE_SYSTEM
-#warning Ned to fix this
+#warning Need to fix this
opt.outfp = NULL;
#else
opt.outfp = fdopen (dup (output_fd), "wb");
diff --git a/g10/keygen.c b/g10/keygen.c
index 56a6cc0eb..1be92db06 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -315,6 +315,7 @@ keygen_set_std_prefs (const char *string,int personal)
string=opt.def_preference_list;
else
{
+ int any_compress = 0;
dummy_string[0]='\0';
/* The rationale why we use the order AES256,192,128 is
@@ -375,13 +376,31 @@ keygen_set_std_prefs (const char *string,int personal)
strcat (dummy_string, "H11 ");
if(!check_compress_algo(COMPRESS_ALGO_ZLIB))
- strcat(dummy_string,"Z2 ");
+ {
+ strcat(dummy_string,"Z2 ");
+ any_compress = 1;
+ }
if(!check_compress_algo(COMPRESS_ALGO_BZIP2))
- strcat(dummy_string,"Z3 ");
+ {
+ strcat(dummy_string,"Z3 ");
+ any_compress = 1;
+ }
if(!check_compress_algo(COMPRESS_ALGO_ZIP))
- strcat(dummy_string,"Z1");
+ {
+ strcat(dummy_string,"Z1 ");
+ any_compress = 1;
+ }
+
+ /* In case we have no compress algo at all, declare that
+ we prefer no compresssion. */
+ if (!any_compress)
+ strcat(dummy_string,"Z0 ");
+
+ /* Remove the trailing space. */
+ if (*dummy_string && dummy_string[strlen (dummy_string)-1] == ' ')
+ dummy_string[strlen (dummy_string)-1] = 0;
string=dummy_string;
}
diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c
index fed92134e..25f62a684 100644
--- a/g10/seckey-cert.c
+++ b/g10/seckey-cert.c
@@ -35,6 +35,7 @@
#include "status.h"
#include "pkglue.h"
+#if 0 /* Not anymore used - kept for reference. */
static int
do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
int *canceled )
@@ -256,7 +257,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
return 0;
}
-
+#endif /*0*/
/****************