diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-12-07 00:36:32 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-12-07 00:36:32 +0000 |
commit | f3e24baddfdab36524ab8172edf0f7f4b15666be (patch) | |
tree | e0c6044bb4cd77ac618d364941adf3d4178ff0b7 /crypto/pkcs7 | |
parent | a6977ee73d6c1a06c0c609c5b0a489befb5c680c (diff) |
Don't overwrite signing time.
Diffstat (limited to 'crypto/pkcs7')
-rw-r--r-- | crypto/pkcs7/pk7_doit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 5b803b0266..fce4a841a6 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -557,11 +557,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); |