]> WPIA git - cassiopeia.git/commitdiff
fix: Use the long way to get a formatted date
authorBenny Baumann <BenBE@geshi.org>
Sun, 22 Mar 2015 09:52:16 +0000 (10:52 +0100)
committerFelix Dörre <felix@dogcraft.de>
Sun, 22 Mar 2015 09:56:11 +0000 (10:56 +0100)
src/crypto/simpleOpensslSigner.cpp

index f4da68216541ef630df600615698705054f5d1ea..914d26e459fff0b9c8b994d2044c4d2392e31834 100644 (file)
@@ -202,8 +202,20 @@ std::shared_ptr<SignedCertificate> SimpleOpensslSigner::sign( std::shared_ptr<TB
 
         c.setTimes( from, to );
         signlog << "FINE: Setting validity period successful:" << std::endl;
-        signlog << "FINE: - Valid not before: " << timeToString(from) << std::endl;
-        signlog << "FINE: - Valid not after:  " << timeToString(to) << std::endl;
+        {
+            struct tm* timeobj;
+            std::vector<char> timebuf;
+
+            timeobj = gmtime(&from);
+            timebuf.resize(128);
+            timebuf.resize(std::strftime(const_cast<char *>(timebuf.data()), timebuf.size(), "%F %T %Z", timeobj));
+            signlog << "FINE: - Valid not before: " << std::string(timebuf.cbegin(), timebuf.cend()) << std::endl;
+
+            timeobj = gmtime(&to);
+            timebuf.resize(128);
+            timebuf.resize(std::strftime(const_cast<char *>(timebuf.data()), timebuf.size(), "%F %T %Z", timeobj));
+            signlog << "FINE: - Valid not after:  " << std::string(timebuf.cbegin(), timebuf.cend()) << std::endl;
+        }
     }
 
     signlog << "INFO: Setting extensions:" << std::endl;