mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Ported changes from 1.4.
Add copyright notices.
This commit is contained in:
parent
eda26e299f
commit
cd2d9288aa
40 changed files with 596 additions and 322 deletions
58
g10/sign.c
58
g10/sign.c
|
@ -1,6 +1,6 @@
|
|||
/* sign.c - sign data
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
* 2006 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
* 2007 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
|
@ -66,32 +66,17 @@ mk_notation_policy_etc( PKT_signature *sig,
|
|||
struct notation *nd=NULL;
|
||||
struct expando_args args;
|
||||
|
||||
assert(sig->version>=4);
|
||||
|
||||
memset(&args,0,sizeof(args));
|
||||
args.pk=pk;
|
||||
args.sk=sk;
|
||||
|
||||
/* It is actually impossible to get here when making a v3 key
|
||||
signature since keyedit.c:sign_uids will automatically bump a
|
||||
signature with a notation or policy url up to v4, but it is
|
||||
good to do these checks anyway. */
|
||||
|
||||
/* notation data */
|
||||
if(IS_SIG(sig) && opt.sig_notations)
|
||||
{
|
||||
if(sig->version<4)
|
||||
log_error(_("can't put notation data into v3 (PGP 2.x style) "
|
||||
"signatures\n"));
|
||||
else
|
||||
nd=opt.sig_notations;
|
||||
}
|
||||
nd=opt.sig_notations;
|
||||
else if( IS_CERT(sig) && opt.cert_notations )
|
||||
{
|
||||
if(sig->version<4)
|
||||
log_error(_("can't put notation data into v3 (PGP 2.x style) "
|
||||
"key signatures\n"));
|
||||
else
|
||||
nd=opt.cert_notations;
|
||||
}
|
||||
nd=opt.cert_notations;
|
||||
|
||||
if(nd)
|
||||
{
|
||||
|
@ -116,21 +101,9 @@ mk_notation_policy_etc( PKT_signature *sig,
|
|||
|
||||
/* set policy URL */
|
||||
if( IS_SIG(sig) && opt.sig_policy_url )
|
||||
{
|
||||
if(sig->version<4)
|
||||
log_error(_("can't put a policy URL into v3 (PGP 2.x style) "
|
||||
"signatures\n"));
|
||||
else
|
||||
pu=opt.sig_policy_url;
|
||||
}
|
||||
pu=opt.sig_policy_url;
|
||||
else if( IS_CERT(sig) && opt.cert_policy_url )
|
||||
{
|
||||
if(sig->version<4)
|
||||
log_error(_("can't put a policy URL into v3 key (PGP 2.x style) "
|
||||
"signatures\n"));
|
||||
else
|
||||
pu=opt.cert_policy_url;
|
||||
}
|
||||
pu=opt.cert_policy_url;
|
||||
|
||||
for(;pu;pu=pu->next)
|
||||
{
|
||||
|
@ -153,12 +126,7 @@ mk_notation_policy_etc( PKT_signature *sig,
|
|||
|
||||
/* preferred keyserver URL */
|
||||
if( IS_SIG(sig) && opt.sig_keyserver_url )
|
||||
{
|
||||
if(sig->version<4)
|
||||
log_info("can't put a preferred keyserver URL into v3 signatures\n");
|
||||
else
|
||||
pu=opt.sig_keyserver_url;
|
||||
}
|
||||
pu=opt.sig_keyserver_url;
|
||||
|
||||
for(;pu;pu=pu->next)
|
||||
{
|
||||
|
@ -689,8 +657,10 @@ write_signature_packets (SK_LIST sk_list, IOBUF out, gcry_md_hd_t hash,
|
|||
BUG ();
|
||||
|
||||
if (sig->version >= 4)
|
||||
{
|
||||
build_sig_subpkt_from_sig (sig);
|
||||
mk_notation_policy_etc (sig, NULL, sk);
|
||||
mk_notation_policy_etc (sig, NULL, sk);
|
||||
}
|
||||
|
||||
hash_sigversion_to_magic (md, sig);
|
||||
gcry_md_final (md);
|
||||
|
@ -1487,8 +1457,10 @@ make_keysig_packet( PKT_signature **ret_sig, PKT_public_key *pk,
|
|||
sig->expiredate=sig->timestamp+duration;
|
||||
sig->sig_class = sigclass;
|
||||
if( sig->version >= 4 )
|
||||
{
|
||||
build_sig_subpkt_from_sig( sig );
|
||||
mk_notation_policy_etc( sig, pk, sk );
|
||||
mk_notation_policy_etc( sig, pk, sk );
|
||||
}
|
||||
|
||||
/* Crucial that the call to mksubpkt comes LAST before the calls
|
||||
to finalize the sig as that makes it possible for the mksubpkt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue