From: sskaje Date: Sun, 13 Dec 2015 08:31:19 +0000 (+0800) Subject: #56 Feature: certtool --p7-sign support GNUTLS_PKCS7_INCLUDE_CERT X-Git-Tag: gnutls_3_5_0~490 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=981acedc10d41a33c26da6591d812e0b472f7005;p=thirdparty%2Fgnutls.git #56 Feature: certtool --p7-sign support GNUTLS_PKCS7_INCLUDE_CERT --- diff --git a/src/certtool-args.def b/src/certtool-args.def index 99f7b5e110..2f3b515135 100644 --- a/src/certtool-args.def +++ b/src/certtool-args.def @@ -318,12 +318,19 @@ flag = { doc = "This option generates a PKCS #7 structure containing a signature for the provided data. The data are stored within the structure. The signer certificate has to be specified using --load-certificate and --load-privkey."; }; + flag = { name = p7-detached-sign; descrip = "Signs using a detached PKCS #7 structure"; doc = "This option generates a PKCS #7 structure containing a signature for the provided data. The signer certificate has to be specified using --load-certificate and --load-privkey."; }; +flag = { + name = p7-include-cert; + descrip = "The signer's certificate will be included in the cert list."; + doc = "This options works with --p7-sign or --p7-detached-sign"; +}; + flag = { name = p7-time; descrip = "Will include a timestamp in the PKCS #7 structure"; diff --git a/src/certtool.c b/src/certtool.c index 6d338e76dc..d70a4c0829 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -3074,6 +3074,9 @@ void pkcs7_sign(common_info_st * cinfo, unsigned embed) if (HAVE_OPT(P7_TIME)) flags |= GNUTLS_PKCS7_INCLUDE_TIME; + if (HAVE_OPT(P7_INCLUDE_CERT)) + flags |= GNUTLS_PKCS7_INCLUDE_CERT; + ret = gnutls_pkcs7_init(&pkcs7); if (ret < 0) { fprintf(stderr, "p7_init: %s\n", gnutls_strerror(ret));