aboutsummaryrefslogtreecommitdiffstats
path: root/sm/sign.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-01-30 09:12:36 +0000
committerWerner Koch <[email protected]>2004-01-30 09:12:36 +0000
commitfec4dc4c99e1a1eb12b99a5bbc9d995a93bd5227 (patch)
tree470f5a58351c2c70138686b800dd652dfe876f39 /sm/sign.c
parentNew. (diff)
downloadgnupg-fec4dc4c99e1a1eb12b99a5bbc9d995a93bd5227.tar.gz
gnupg-fec4dc4c99e1a1eb12b99a5bbc9d995a93bd5227.zip
* configure.ac: Require libksba 0.9.3 due to another bug fix there.
* sign.c (add_certificate_list): Decrement N for the first cert. * Makefile.am (sbin_SCRIPTS): New, to install addgnupghome. (EXTRA_DIST): Added rfc822parse.c rfc822parse.h gpgparsemail.c which might be useful for debugging.
Diffstat (limited to 'sm/sign.c')
-rw-r--r--sm/sign.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sm/sign.c b/sm/sign.c
index b3e3b5646..3f64c2e5e 100644
--- a/sm/sign.c
+++ b/sm/sign.c
@@ -244,6 +244,7 @@ add_certificate_list (CTRL ctrl, ksba_cms_t cms, ksba_cert_t cert)
ksba_cert_ref (cert);
n = ctrl->include_certs;
+ log_debug ("adding certificates at level %d\n", n);
if (n == -2)
{
not_root = 1;
@@ -252,6 +253,8 @@ add_certificate_list (CTRL ctrl, ksba_cms_t cms, ksba_cert_t cert)
if (n < 0 || n > 50)
n = 50; /* We better apply an upper bound */
+ /* First add my own certificate unless we don't want any certificate
+ included at all. */
if (n)
{
if (not_root && gpgsm_is_root_cert (cert))
@@ -260,7 +263,12 @@ add_certificate_list (CTRL ctrl, ksba_cms_t cms, ksba_cert_t cert)
err = ksba_cms_add_cert (cms, cert);
if (err)
goto ksba_failure;
+ if (n>0)
+ n--;
}
+ /* Walk the chain to include all other certificates. Note that a -1
+ used for N makes sure that there is no limit and all certs get
+ included. */
while ( n-- && !(rc = gpgsm_walk_cert_chain (cert, &next)) )
{
if (not_root && gpgsm_is_root_cert (next))