1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-09 12:54:23 +01:00

* parse-packet.c (parse_signature): Minor fix - signatures should expire

at their expiration time and not one second later.

* keygen.c (proc_parameter_file): Allow specifying preferences string
(i.e. "s5 s2 z1 z2", etc) in a batchmode key generation file.

* keyedit.c (keyedit_menu): Print standard error message when signing a
revoked key (no new translation).

* getkey.c (merge_selfsigs): Get the default set of key prefs from the
real (not attribute) primary uid.
This commit is contained in:
David Shaw 2002-04-14 01:27:11 +00:00
parent 9d7b26c784
commit 9ef1a80f8d
5 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,18 @@
2002-04-13 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (parse_signature): Minor fix - signatures should
expire at their expiration time and not one second later.
* keygen.c (proc_parameter_file): Allow specifying preferences
string (i.e. "s5 s2 z1 z2", etc) in a batchmode key generation
file.
* keyedit.c (keyedit_menu): Print standard error message when
signing a revoked key (no new translation).
* getkey.c (merge_selfsigs): Get the default set of key prefs from
the real (not attribute) primary uid.
2002-04-12 David Shaw <dshaw@jabberwocky.com> 2002-04-12 David Shaw <dshaw@jabberwocky.com>
* pkclist.c (build_pk_list): Fix bug that allowed a key to be * pkclist.c (build_pk_list): Fix bug that allowed a key to be

View File

@ -1635,7 +1635,7 @@ merge_selfsigs( KBNODE keyblock )
if(k->pkt->pkttype==PKT_PUBLIC_SUBKEY) if(k->pkt->pkttype==PKT_PUBLIC_SUBKEY)
k->pkt->pkt.public_key->is_valid=0; k->pkt->pkt.public_key->is_valid=0;
/* set the preference list of all keys to those of the primary /* set the preference list of all keys to those of the primary real
* user ID. Note: we use these preferences when we don't know by * user ID. Note: we use these preferences when we don't know by
* which user ID the key has been selected. * which user ID the key has been selected.
* fixme: we should keep atoms of commonly used preferences or * fixme: we should keep atoms of commonly used preferences or
@ -1648,6 +1648,7 @@ merge_selfsigs( KBNODE keyblock )
mdc_feature = 0; mdc_feature = 0;
for (k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY; k = k->next) { for (k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY; k = k->next) {
if (k->pkt->pkttype == PKT_USER_ID if (k->pkt->pkttype == PKT_USER_ID
&& !k->pkt->pkt.user_id->attrib_data
&& k->pkt->pkt.user_id->is_primary) { && k->pkt->pkt.user_id->is_primary) {
prefs = k->pkt->pkt.user_id->prefs; prefs = k->pkt->pkt.user_id->prefs;
mdc_feature = k->pkt->pkt.user_id->mdc_feature; mdc_feature = k->pkt->pkt.user_id->mdc_feature;

View File

@ -1051,7 +1051,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
} }
else else
{ {
tty_printf("\n"); tty_printf(_(" Unable to sign.\n"));
break; break;
} }
} }

View File

@ -49,6 +49,7 @@ enum para_name {
pNAMEREAL, pNAMEREAL,
pNAMEEMAIL, pNAMEEMAIL,
pNAMECOMMENT, pNAMECOMMENT,
pPREFERENCES,
pUSERID, pUSERID,
pEXPIREDATE, pEXPIREDATE,
pKEYEXPIRE, /* in n seconds */ pKEYEXPIRE, /* in n seconds */
@ -253,7 +254,7 @@ keygen_set_std_prefs (const char *string)
else if (isspace (*s)) else if (isspace (*s))
s2 = s+1; s2 = s+1;
else { else {
log_info (_("invalid character in string\n")); log_info (_("invalid character in preference string\n"));
return -1; return -1;
} }
} }
@ -1458,6 +1459,9 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
} }
} }
/* Set preferences, if any. */
keygen_set_std_prefs(get_parameter_value( para, pPREFERENCES ));
/* make DEK and S2K from the Passphrase */ /* make DEK and S2K from the Passphrase */
r = get_parameter( para, pPASSPHRASE ); r = get_parameter( para, pPASSPHRASE );
if( r && *r->u.value ) { if( r && *r->u.value ) {
@ -1538,6 +1542,7 @@ read_parameter_file( const char *fname )
{ "Name-Comment", pNAMECOMMENT }, { "Name-Comment", pNAMECOMMENT },
{ "Expire-Date", pEXPIREDATE }, { "Expire-Date", pEXPIREDATE },
{ "Passphrase", pPASSPHRASE }, { "Passphrase", pPASSPHRASE },
{ "Preferences", pPREFERENCES },
{ NULL, 0 } { NULL, 0 }
}; };
FILE *fp; FILE *fp;

View File

@ -1236,7 +1236,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
p=parse_sig_subpkt(sig->hashed,SIGSUBPKT_SIG_EXPIRE,NULL); p=parse_sig_subpkt(sig->hashed,SIGSUBPKT_SIG_EXPIRE,NULL);
if(p) if(p)
sig->expiredate=sig->timestamp+buffer_to_u32(p); sig->expiredate=sig->timestamp+buffer_to_u32(p);
if(sig->expiredate>0 && sig->expiredate<make_timestamp()) if(sig->expiredate && sig->expiredate<=make_timestamp())
sig->flags.expired=1; sig->flags.expired=1;
p=parse_sig_subpkt(sig->hashed,SIGSUBPKT_POLICY,NULL); p=parse_sig_subpkt(sig->hashed,SIGSUBPKT_POLICY,NULL);