Don't overwrite signing time.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 7 Dec 2001 00:40:53 +0000 (00:40 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 7 Dec 2001 00:40:53 +0000 (00:40 +0000)
CHANGES
crypto/pkcs7/pk7_doit.c

diff --git a/CHANGES b/CHANGES
index 219133ee5d3638fe3f1e419cb5153f6525be05a6..cc1e6cac48ee13341dba0daf84360bd255741f22 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,10 @@
 
  Changes between 0.9.6b and 0.9.6c  [XX xxx XXXX]
 
+  *) Only add signing time to PKCS7 structures if it is not already
+     present.
+     [Steve Henson]
+
   *) Fix crypto/objects/objects.h: "ld-ce" should be "id-ce",
      OBJ_ld_ce should be OBJ_id_ce.
      Also some ip-pda OIDs in crypto/objects/objects.txt were
index bf43d030ade6f2308f56a1a1e096582c33e2b513..2b60cab4afc2c876c055e0f3ef6b708b3bdb0324 100644 (file)
@@ -558,11 +558,15 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
                                ASN1_UTCTIME *sign_time;
                                const EVP_MD *md_tmp;
 
-                               /* Add signing time */
-                               sign_time=X509_gmtime_adj(NULL,0);
-                               PKCS7_add_signed_attribute(si,
-                                       NID_pkcs9_signingTime,
-                                       V_ASN1_UTCTIME,sign_time);
+                               /* Add signing time if not already present */
+                               if (!PKCS7_get_signed_attribute(si,
+                                                       NID_pkcs9_signingTime))
+                                       {
+                                       sign_time=X509_gmtime_adj(NULL,0);
+                                       PKCS7_add_signed_attribute(si,
+                                               NID_pkcs9_signingTime,
+                                               V_ASN1_UTCTIME,sign_time);
+                                       }
 
                                /* Add digest */
                                md_tmp=EVP_MD_CTX_md(&ctx_tmp);