mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-09 12:54:23 +01:00
(agent_send_all_options): Try to deduce the ttyname
from stdin.
This commit is contained in:
parent
65077adf83
commit
3060984dd1
@ -1,3 +1,17 @@
|
|||||||
|
2004-10-26 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* app-openpgp.c (verify_chv3): The minimum length for CHV3 is
|
||||||
|
8. Changed string to match the other ones.
|
||||||
|
|
||||||
|
* passphrase.c (agent_send_all_options): Try to deduce the ttyname
|
||||||
|
from stdin.
|
||||||
|
|
||||||
|
2004-10-22 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* card-util.c (fetch_url): Disable for gnupg 1.9
|
||||||
|
(card_generate_subkey): Ditto.
|
||||||
|
(card_store_subkey): Ditto.
|
||||||
|
|
||||||
2004-10-21 David Shaw <dshaw@jabberwocky.com>
|
2004-10-21 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* options.h, g10.c (main), mainproc.c (check_sig_and_print):
|
* options.h, g10.c (main), mainproc.c (check_sig_and_print):
|
||||||
|
@ -523,6 +523,7 @@ change_url (void)
|
|||||||
static int
|
static int
|
||||||
fetch_url(void)
|
fetch_url(void)
|
||||||
{
|
{
|
||||||
|
#if GNUPG_MAJOR_VERSION == 1
|
||||||
int rc;
|
int rc;
|
||||||
struct agent_card_info_s info;
|
struct agent_card_info_s info;
|
||||||
|
|
||||||
@ -560,6 +561,9 @@ fetch_url(void)
|
|||||||
log_error("no URL set on card\n");
|
log_error("no URL set on card\n");
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -577,12 +581,14 @@ change_login (const char *args)
|
|||||||
for (args++; spacep (args); args++)
|
for (args++; spacep (args); args++)
|
||||||
;
|
;
|
||||||
fp = fopen (args, "rb");
|
fp = fopen (args, "rb");
|
||||||
|
#if GNUPG_MAJOR_VERSION == 1
|
||||||
if (fp && is_secured_file (fileno (fp)))
|
if (fp && is_secured_file (fileno (fp)))
|
||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
fp = NULL;
|
fp = NULL;
|
||||||
errno = EPERM;
|
errno = EPERM;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
tty_printf (_("can't open `%s': %s\n"), args, strerror (errno));
|
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. */
|
/* Helper for the key generation/edit functions. */
|
||||||
static void
|
static void
|
||||||
show_card_key_info (struct agent_card_info_s *info)
|
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);
|
print_sha1_fpr (NULL, info->fpr3valid? info->fpr3:NULL);
|
||||||
tty_printf ("\n");
|
tty_printf ("\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if GNUPG_MAJOR_VERSION == 1
|
||||||
/* Helper for the key generation/edit functions. */
|
/* Helper for the key generation/edit functions. */
|
||||||
static int
|
static int
|
||||||
replace_existing_key_p (struct agent_card_info_s *info, int keyno)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -898,7 +906,7 @@ generate_card_keys (const char *serialno)
|
|||||||
want_backup = cpr_get_answer_is_yes
|
want_backup = cpr_get_answer_is_yes
|
||||||
( "cardedit.genkeys.backup_enc",
|
( "cardedit.genkeys.backup_enc",
|
||||||
_("Make off-card backup of encryption key? (Y/n) "));
|
_("Make off-card backup of encryption key? (Y/n) "));
|
||||||
#warning we need answer_is_yes_no_default()
|
/*FIXME: we need answer_is_yes_no_default()*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( (info.fpr1valid && !fpr_is_zero (info.fpr1))
|
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))
|
if (check_pin_for_key_operation (&info, &forced_chv1))
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
|
#if GNUPG_MAJOR_VERSION == 1
|
||||||
generate_keypair (NULL, info.serialno,
|
generate_keypair (NULL, info.serialno,
|
||||||
want_backup? opt.homedir:NULL);
|
want_backup? opt.homedir:NULL);
|
||||||
|
#else
|
||||||
|
generate_keypair (NULL, info.serialno);
|
||||||
|
#endif
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
agent_release_card_info (&info);
|
agent_release_card_info (&info);
|
||||||
@ -942,6 +954,7 @@ generate_card_keys (const char *serialno)
|
|||||||
int
|
int
|
||||||
card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
|
card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
|
||||||
{
|
{
|
||||||
|
#if GNUPG_MAJOR_VERSION == 1
|
||||||
struct agent_card_info_s info;
|
struct agent_card_info_s info;
|
||||||
int okay = 0;
|
int okay = 0;
|
||||||
int forced_chv1 = 0;
|
int forced_chv1 = 0;
|
||||||
@ -988,6 +1001,9 @@ card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
|
|||||||
agent_release_card_info (&info);
|
agent_release_card_info (&info);
|
||||||
restore_forced_chv1 (&forced_chv1);
|
restore_forced_chv1 (&forced_chv1);
|
||||||
return okay;
|
return okay;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -997,6 +1013,7 @@ card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
|
|||||||
int
|
int
|
||||||
card_store_subkey (KBNODE node, int use)
|
card_store_subkey (KBNODE node, int use)
|
||||||
{
|
{
|
||||||
|
#if GNUPG_MAJOR_VERSION == 1
|
||||||
struct agent_card_info_s info;
|
struct agent_card_info_s info;
|
||||||
int okay = 0;
|
int okay = 0;
|
||||||
int rc;
|
int rc;
|
||||||
@ -1117,6 +1134,9 @@ card_store_subkey (KBNODE node, int use)
|
|||||||
free_secret_key (copied_sk);
|
free_secret_key (copied_sk);
|
||||||
agent_release_card_info (&info);
|
agent_release_card_info (&info);
|
||||||
return okay;
|
return okay;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -377,9 +377,13 @@ agent_send_all_options (int fd)
|
|||||||
|
|
||||||
if (!opt.ttyname)
|
if (!opt.ttyname)
|
||||||
{
|
{
|
||||||
|
const char *tmp;
|
||||||
|
|
||||||
dft_ttyname = getenv ("GPG_TTY");
|
dft_ttyname = getenv ("GPG_TTY");
|
||||||
if ((!dft_ttyname || !*dft_ttyname) && tty_get_ttyname ())
|
if ((!dft_ttyname || !*dft_ttyname) && (tmp=ttyname (0)))
|
||||||
dft_ttyname = tty_get_ttyname ();
|
dft_ttyname = tmp;
|
||||||
|
if ((!dft_ttyname || !*dft_ttyname) && (tmp=tty_get_ttyname ()))
|
||||||
|
dft_ttyname = tmp;
|
||||||
}
|
}
|
||||||
if (opt.ttyname || dft_ttyname)
|
if (opt.ttyname || dft_ttyname)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user