]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
#56 Feature: certtool --p7-sign support GNUTLS_PKCS7_INCLUDE_CERT
authorsskaje <sskaje@gmail.com>
Sun, 13 Dec 2015 08:31:19 +0000 (16:31 +0800)
committersskaje <sskaje@gmail.com>
Sun, 13 Dec 2015 08:31:19 +0000 (16:31 +0800)
src/certtool-args.def
src/certtool.c

index 99f7b5e11086226a315ce6b6bc6e48dc6dfe2dab..2f3b51513505b6b56bff923d16c6d39b1f112c8d 100644 (file)
@@ -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";
index 6d338e76dc3abdc324faeccbf5fc95061fb66ecc..d70a4c0829793a81c7660ec92e04e8c091f32225 100644 (file)
@@ -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));