mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Added LIBINTL to more Makefile targets.
doc/ * com-certs.pem: Added the current root certifcates of D-Trust and S-Trust. g10/ * status.c (write_status_begin_signing): New. * sign.c (sign_file, sign_symencrypt_file): Call it. * textfilter.c (copy_clearsig_text): Call it. * call-agent.c (agent_scd_pksign): Pass --hash-rmd160 to SCD if required. * gpg.c (main): Let --no-use-agent and --gpg-agent-info print a warning. * misc.c (obsolete_option): New.
This commit is contained in:
parent
0d4b205630
commit
7eec2efa66
23 changed files with 286 additions and 13 deletions
|
@ -1,3 +1,20 @@
|
|||
2007-01-30 Werner Koch <wk@g10code.com>
|
||||
|
||||
* status.c (write_status_begin_signing): New.
|
||||
* sign.c (sign_file, sign_symencrypt_file): Call it.
|
||||
* textfilter.c (copy_clearsig_text): Call it.
|
||||
|
||||
* call-agent.c (agent_scd_pksign): Pass --hash-rmd160 to SCD if
|
||||
required.
|
||||
|
||||
* gpg.c (main): Let --no-use-agent and --gpg-agent-info print a
|
||||
warning.
|
||||
* misc.c (obsolete_option): New.
|
||||
|
||||
2007-01-29 Werner Koch <wk@g10code.com>
|
||||
|
||||
* pkclist.c (do_we_trust_pre): Issue a user-id-hint status code.
|
||||
|
||||
2007-01-15 Werner Koch <wk@g10code.com>
|
||||
|
||||
* parse-packet.c (read_protected_v3_mpi): Make sure to stop
|
||||
|
|
|
@ -668,7 +668,9 @@ agent_scd_pksign (const char *serialno, int hashalgo,
|
|||
snprintf (line, DIM(line)-1, "SCD PKAUTH %s", serialno);
|
||||
else
|
||||
#endif
|
||||
snprintf (line, DIM(line)-1, "SCD PKSIGN %s", serialno);
|
||||
snprintf (line, DIM(line)-1, "SCD PKSIGN %s%s",
|
||||
hashalgo == GCRY_MD_RMD160? "--hash=rmd160 " : "",
|
||||
serialno);
|
||||
line[DIM(line)-1] = 0;
|
||||
rc = assuan_transact (agent_ctx, line, membuf_data_cb, &data,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
|
16
g10/gpg.c
16
g10/gpg.c
|
@ -2134,10 +2134,20 @@ main (int argc, char **argv )
|
|||
opt.list_options|=LIST_SHOW_UNUSABLE_SUBKEYS;
|
||||
break;
|
||||
|
||||
case oBatch: opt.batch = 1; nogreeting = 1; break;
|
||||
case oBatch:
|
||||
opt.batch = 1;
|
||||
nogreeting = 1;
|
||||
break;
|
||||
|
||||
case oUseAgent: /* Dummy. */
|
||||
case oNoUseAgent: /* Dummy. */ break;
|
||||
case oGpgAgentInfo: opt.gpg_agent_info = pargs.r.ret_str; break;
|
||||
break;
|
||||
case oNoUseAgent:
|
||||
obsolete_option (configname, configlineno, "--no-use-agent");
|
||||
break;
|
||||
case oGpgAgentInfo:
|
||||
obsolete_option (configname, configlineno, "--gpg-agent-info");
|
||||
break;
|
||||
|
||||
case oAnswerYes: opt.answer_yes = 1; break;
|
||||
case oAnswerNo: opt.answer_no = 1; break;
|
||||
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
|
||||
|
|
|
@ -105,6 +105,8 @@ char *pct_expando(const char *string,struct expando_args *args);
|
|||
void deprecated_warning(const char *configname,unsigned int configlineno,
|
||||
const char *option,const char *repl1,const char *repl2);
|
||||
void deprecated_command (const char *name);
|
||||
void obsolete_option (const char *configname, unsigned int configlineno,
|
||||
const char *name);
|
||||
|
||||
int string_to_cipher_algo (const char *string);
|
||||
int string_to_digest_algo (const char *string);
|
||||
|
|
17
g10/misc.c
17
g10/misc.c
|
@ -469,6 +469,10 @@ openpgp_pk_algo_usage ( int algo )
|
|||
int
|
||||
openpgp_md_test_algo( int algo )
|
||||
{
|
||||
/* Note: If the list of actual supported OpenPGP algorithms changes,
|
||||
make sure that our hard coded values at
|
||||
print_status_begin_signing() gets updated. */
|
||||
|
||||
if (algo < 0 || algo > 110)
|
||||
return gpg_error (GPG_ERR_DIGEST_ALGO);
|
||||
return gcry_md_test_algo (algo);
|
||||
|
@ -737,6 +741,19 @@ deprecated_command (const char *name)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
obsolete_option (const char *configname, unsigned int configlineno,
|
||||
const char *name)
|
||||
{
|
||||
if(configname)
|
||||
log_info (_("%s:%u: obsolete option \"%s\" - it has no effect\n"),
|
||||
configname, configlineno, name);
|
||||
else
|
||||
log_info (_("WARNING: \"%s\" is an obsolete option - it has no effect\n"),
|
||||
name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Wrapper around gcry_cipher_map_name to provide a fallback using the
|
||||
* "Sn" syntax as used by the preference strings.
|
||||
|
|
|
@ -464,6 +464,18 @@ do_we_trust_pre( PKT_public_key *pk, unsigned int trustlevel )
|
|||
|
||||
tty_printf("\n");
|
||||
|
||||
|
||||
if (is_status_enabled ())
|
||||
{
|
||||
u32 kid[2];
|
||||
char *hint_str;
|
||||
|
||||
keyid_from_pk (pk, kid);
|
||||
hint_str = get_long_user_id_string ( kid );
|
||||
write_status_text ( STATUS_USERID_HINT, hint_str );
|
||||
xfree (hint_str);
|
||||
}
|
||||
|
||||
if( cpr_get_answer_is_yes("untrusted_key.override",
|
||||
_("Use this key anyway? (y/N) ")) )
|
||||
rc = 1;
|
||||
|
|
|
@ -503,6 +503,7 @@ only_old_style( SK_LIST sk_list )
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
print_status_sig_created ( PKT_secret_key *sk, PKT_signature *sig, int what )
|
||||
{
|
||||
|
@ -983,7 +984,7 @@ sign_file( strlist_t filenames, int detached, strlist_t locusr,
|
|||
goto leave;
|
||||
}
|
||||
|
||||
write_status (STATUS_BEGIN_SIGNING);
|
||||
write_status_begin_signing (mfx.md);
|
||||
|
||||
/* Setup the inner packet. */
|
||||
if( detached ) {
|
||||
|
@ -1361,7 +1362,7 @@ sign_symencrypt_file (const char *fname, strlist_t locusr)
|
|||
goto leave;
|
||||
}
|
||||
|
||||
write_status (STATUS_BEGIN_SIGNING);
|
||||
write_status_begin_signing (mfx.md);
|
||||
|
||||
/* Pipe data through all filters; i.e. write the signed stuff */
|
||||
/*(current filters: zip - encrypt - armor)*/
|
||||
|
|
33
g10/status.c
33
g10/status.c
|
@ -323,6 +323,39 @@ write_status_buffer ( int no, const char *buffer, size_t len, int wrap )
|
|||
}
|
||||
|
||||
|
||||
/* Print the BEGIN_SIGNING status message. If MD is not NULL it is
|
||||
used retrieve the hash algorithms used for the message. */
|
||||
void
|
||||
write_status_begin_signing (gcry_md_hd_t md)
|
||||
{
|
||||
if (md)
|
||||
{
|
||||
char buf[100];
|
||||
size_t buflen;
|
||||
int i;
|
||||
|
||||
/* We use a hard coded list of possible algorithms. Using other
|
||||
algorithms than specified by OpenPGP does not make sense
|
||||
anyway. We do this out of performance reasons: Walking all
|
||||
the 110 allowed Ids is not a good idea given the way the
|
||||
check is implemented in libgcrypt. Recall that the only use
|
||||
of this status code is to create the micalg algorithm for
|
||||
PGP/MIME. */
|
||||
buflen = 0;
|
||||
for (i=1; i <= 11; i++)
|
||||
if (i < 4 || i > 7)
|
||||
if ( gcry_md_is_enabled (md, i) && buflen < DIM(buf) )
|
||||
{
|
||||
snprintf (buf+buflen, DIM(buf) - buflen - 1,
|
||||
"%sH%d", buflen? " ":"",i);
|
||||
buflen += strlen (buf+buflen);
|
||||
}
|
||||
write_status_text ( STATUS_BEGIN_SIGNING, buf );
|
||||
}
|
||||
else
|
||||
write_status ( STATUS_BEGIN_SIGNING );
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
myread(int fd, void *buf, size_t count)
|
||||
|
|
|
@ -131,6 +131,9 @@ void write_status_buffer ( int no,
|
|||
void write_status_text_and_buffer ( int no, const char *text,
|
||||
const char *buffer, size_t len, int wrap );
|
||||
|
||||
void write_status_begin_signing (gcry_md_hd_t md);
|
||||
|
||||
|
||||
int cpr_enabled(void);
|
||||
char *cpr_get( const char *keyword, const char *prompt );
|
||||
char *cpr_get_no_help( const char *keyword, const char *prompt );
|
||||
|
|
|
@ -178,7 +178,7 @@ copy_clearsig_text( IOBUF out, IOBUF inp, gcry_md_hd_t md,
|
|||
if( !escape_dash )
|
||||
escape_from = 0;
|
||||
|
||||
write_status (STATUS_BEGIN_SIGNING);
|
||||
write_status_begin_signing (md);
|
||||
|
||||
for(;;) {
|
||||
maxlen = MAX_LINELEN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue