]> WPIA git - cassiopeia.git/commitdiff
upd: more valgrind stuff
authorFelix Dörre <felix@dogcraft.de>
Fri, 2 Dec 2016 23:52:56 +0000 (23:52 +0000)
committerFelix Dörre <felix@dogcraft.de>
Fri, 2 Dec 2016 23:52:56 +0000 (23:52 +0000)
src/crypto/sslUtil.cpp

index a3432ea5253c87026814d3eaf1cfa96dc231d858..7a0c6392ea6f6625f69e37be0befa08bdb8c794c 100644 (file)
@@ -209,7 +209,7 @@ CAConfig::CAConfig( const std::string& name ) : path( "ca/" + name ), name( name
 }
 
 std::string timeToString( std::shared_ptr<ASN1_TIME> time ) {
-    std::shared_ptr<ASN1_GENERALIZEDTIME> gtime( ASN1_TIME_to_generalizedtime( time.get(), 0 ) );
+  std::shared_ptr<ASN1_GENERALIZEDTIME> gtime( ASN1_TIME_to_generalizedtime( time.get(), 0 ), ASN1_GENERALIZEDTIME_free );
     std::string strdate( ( char* ) ASN1_STRING_get0_data( gtime.get() ), ASN1_STRING_length( gtime.get() ) );
 
     logger::notef("openssl formatted me a date: %s", strdate);
@@ -221,8 +221,8 @@ std::string timeToString( std::shared_ptr<ASN1_TIME> time ) {
 }
 
 void extractTimes( std::shared_ptr<X509> target,  std::shared_ptr<SignedCertificate> cert ) {
-    cert->before = timeToString( std::shared_ptr<ASN1_TIME>( X509_get_notBefore( target.get() ), ASN1_TIME_free ) );
-    cert->after = timeToString( std::shared_ptr<ASN1_TIME>( X509_get_notAfter( target.get() ), ASN1_TIME_free ) );
+    cert->before = timeToString( std::shared_ptr<ASN1_TIME>( X509_get_notBefore( target.get() ), [target](auto p){(void)p;} ) );
+    cert->after = timeToString( std::shared_ptr<ASN1_TIME>( X509_get_notAfter( target.get() ), [target](auto p){(void)p;} ) );
 }
 
 bool CAConfig::crlNeedsResign() {