]> WPIA git - cassiopeia.git/blobdiff - src/crypto/simpleOpensslSigner.cpp
fmt: extract lambdas to make them better formatted
[cassiopeia.git] / src / crypto / simpleOpensslSigner.cpp
index d5371ba26301497f853497f7e4c9aa1e05dc9167..6cf10d060a6039e785095ea652ea5ba280ba46db 100644 (file)
@@ -60,11 +60,10 @@ std::pair<std::shared_ptr<BIGNUM>, std::string> SimpleOpensslSigner::nextSerial(
         throw std::runtime_error( "Big number math failed while fetching random data for serial number." );
     }
 
-    std::shared_ptr<char> serStr = std::shared_ptr<char>(
-        BN_bn2hex( serial.get() ),
-        []( char* ref ) {
-            OPENSSL_free( ref );
-        } );
+    auto freeMem = []( char *ref ) {
+        OPENSSL_free( ref );
+    };
+    std::shared_ptr<char> serStr = std::shared_ptr<char>( BN_bn2hex( serial.get() ), freeMem );
 
     writeFile( ca->path + "/serial", serStr.get() );