aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-10-22 16:03:04 +0000
committerWerner Koch <[email protected]>2004-10-22 16:03:04 +0000
commit17c2c406016e51a6ecce5bd139d0c8e81ee07ec8 (patch)
tree153d15f62ec45ae4d304098ed9a98aff50deaafd /g10
parentCleaned up (diff)
downloadgnupg-17c2c406016e51a6ecce5bd139d0c8e81ee07ec8.tar.gz
gnupg-17c2c406016e51a6ecce5bd139d0c8e81ee07ec8.zip
Compile fixes.
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog9
-rw-r--r--g10/card-util.c30
-rw-r--r--g10/g10.c8
-rw-r--r--g10/main.h2
4 files changed, 41 insertions, 8 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 36d5e3314..01bbf649d 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-22 Werner Koch <[email protected]>
+
+ * g10.c (main): Display a bit fat warning that this gpg should not
+ be used.
+
+ * card-util.c (fetch_url): Disable for gnupg 1.9
+ (card_generate_subkey): Ditto.
+ (card_store_subkey): Ditto.
+
2004-09-30 Werner Koch <[email protected]>
* gpgv.c (i18n_init): Always use LC_ALL.
diff --git a/g10/card-util.c b/g10/card-util.c
index 1d2e47ea2..1ff57ade5 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -523,6 +523,7 @@ change_url (void)
static int
fetch_url(void)
{
+#if GNUPG_MAJOR_VERSION == 1
int rc;
struct agent_card_info_s info;
@@ -560,6 +561,9 @@ fetch_url(void)
log_error("no URL set on card\n");
return rc;
+#else
+ return 0;
+#endif
}
@@ -577,12 +581,14 @@ change_login (const char *args)
for (args++; spacep (args); args++)
;
fp = fopen (args, "rb");
+#if GNUPG_MAJOR_VERSION == 1
if (fp && is_secured_file (fileno (fp)))
{
fclose (fp);
fp = NULL;
errno = EPERM;
}
+#endif
if (!fp)
{
tty_printf (_("can't open `%s': %s\n"), args, strerror (errno));
@@ -839,6 +845,7 @@ restore_forced_chv1 (int *forced_chv1)
}
}
+#if GNUPG_MAJOR_VERSION == 1
/* Helper for the key generation/edit functions. */
static void
show_card_key_info (struct agent_card_info_s *info)
@@ -851,8 +858,9 @@ show_card_key_info (struct agent_card_info_s *info)
print_sha1_fpr (NULL, info->fpr3valid? info->fpr3:NULL);
tty_printf ("\n");
}
+#endif
-
+#if GNUPG_MAJOR_VERSION == 1
/* Helper for the key generation/edit functions. */
static int
replace_existing_key_p (struct agent_card_info_s *info, int keyno)
@@ -872,7 +880,7 @@ replace_existing_key_p (struct agent_card_info_s *info, int keyno)
}
return 0;
}
-
+#endif
static void
@@ -895,10 +903,10 @@ generate_card_keys (const char *serialno)
m_free(answer);
}
#else
- /* Does 1.9 have answer_is_yes_no_default() ? */
- want_backup = !(cpr_get_answer_is_yes
+ want_backup = cpr_get_answer_is_yes
( "cardedit.genkeys.backup_enc",
- _("Inhibit off-card backup of encryption key? (y/N) ")));
+ _("Make off-card backup of encryption key? (Y/n) "));
+ /*FIXME: we need answer_is_yes_no_default()*/
#endif
if ( (info.fpr1valid && !fpr_is_zero (info.fpr1))
@@ -928,8 +936,12 @@ generate_card_keys (const char *serialno)
if (check_pin_for_key_operation (&info, &forced_chv1))
goto leave;
+#if GNUPG_MAJOR_VERSION == 1
generate_keypair (NULL, info.serialno,
want_backup? opt.homedir:NULL);
+#else
+ generate_keypair (NULL, info.serialno);
+#endif
leave:
agent_release_card_info (&info);
@@ -942,6 +954,7 @@ generate_card_keys (const char *serialno)
int
card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
{
+#if GNUPG_MAJOR_VERSION == 1
struct agent_card_info_s info;
int okay = 0;
int forced_chv1 = 0;
@@ -988,6 +1001,9 @@ card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
agent_release_card_info (&info);
restore_forced_chv1 (&forced_chv1);
return okay;
+#else
+ return 0;
+#endif
}
@@ -997,6 +1013,7 @@ card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
int
card_store_subkey (KBNODE node, int use)
{
+#if GNUPG_MAJOR_VERSION == 1
struct agent_card_info_s info;
int okay = 0;
int rc;
@@ -1117,6 +1134,9 @@ card_store_subkey (KBNODE node, int use)
free_secret_key (copied_sk);
agent_release_card_info (&info);
return okay;
+#else
+ return 0;
+#endif
}
diff --git a/g10/g10.c b/g10/g10.c
index 915011026..039074f6b 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -2038,6 +2038,10 @@ main( int argc, char **argv )
}
#endif
+ log_info ("WARNING: This version of gpg is not very matured and\n");
+ log_info ("WARNING: only intended for testing. Please keep using\n");
+ log_info ("WARNING: gpg 1.2.x, 1.3.x or 1.4.x for OpenPGP\n");
+
/* FIXME: We should use the lggging to a file only in server mode;
however we have not yet implemetyed that thus we try to get
away with --batch as indication for logging to file required. */
@@ -2926,9 +2930,9 @@ main( int argc, char **argv )
case aChangePIN:
if (!argc)
- change_pin (0);
+ change_pin (0,1);
else if (argc == 1)
- change_pin ( atoi (*argv));
+ change_pin ( atoi (*argv), 1);
else
wrong_args ("--change-pin [no]");
break;
diff --git a/g10/main.h b/g10/main.h
index 52bfa7659..939d12ded 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -259,7 +259,7 @@ int hash_datafiles( MD_HANDLE md, MD_HANDLE md2,
void run_in_pipemode (void);
/*-- card-util.c --*/
-void change_pin (int no);
+void change_pin (int no, int allow_admin);
void card_status (FILE *fp, char *serialnobuf, size_t serialnobuflen);
void card_edit (STRLIST commands);