]> WPIA git - cassiopeia.git/blobdiff - src/apps/client.cpp
fix: Make CppCheck happy by fixing the code
[cassiopeia.git] / src / apps / client.cpp
index a066d87589b38a0c4222287b7371c71b9c791219..7c5bf0888b5a9bb3ac6996e7e02cd1ec19ca2aa7 100644 (file)
@@ -78,7 +78,7 @@ int main( int argc, const char* argv[] ) {
     std::shared_ptr<JobProvider> jp( new MySQLJobProvider( sqlHost, sqlUser, sqlPass, sqlDB ) );
     std::shared_ptr<BIO> b = openSerial( serialPath );
     std::shared_ptr<BIO> slip1( BIO_new( toBio<SlipBIO>() ), BIO_free );
-    ( ( SlipBIO* )slip1->ptr )->setTarget( std::shared_ptr<OpensslBIO>( new OpensslBIOWrapper( b ) ) );
+    static_cast<SlipBIO*>( slip1->ptr )->setTarget( std::shared_ptr<OpensslBIO>( new OpensslBIOWrapper( b ) ) );
     std::shared_ptr<RemoteSigner> sign( new RemoteSigner( slip1, generateSSLContext( false ) ) );
     // std::shared_ptr<Signer> sign( new SimpleOpensslSigner() );
 
@@ -125,6 +125,8 @@ int main( int argc, const char* argv[] ) {
         if( job->task == "sign" ) {
             try {
                 std::shared_ptr<TBSCertificate> cert = jp->fetchTBSCert( job );
+                cert->wishFrom = job->from;
+                cert->wishTo = job->to;
                 log << "INFO: message digest: " << cert->md << std::endl;
                 log << "INFO: profile id: " << cert->profile << std::endl;
 
@@ -168,7 +170,7 @@ int main( int argc, const char* argv[] ) {
                 continue;
             } catch( const char* c ) {
                 log << "ERROR: " << c << std::endl;
-            } catch( std::string c ) {
+            } catch( std::string& c ) {
                 log << "ERROR: " << c << std::endl;
             }
 
@@ -176,7 +178,7 @@ int main( int argc, const char* argv[] ) {
                 jp->failJob( job );
             } catch( const char* c ) {
                 log << "ERROR: " << c << std::endl;
-            } catch( std::string c ) {
+            } catch( std::string& c ) {
                 log << "ERROR: " << c << std::endl;
             }
         } else if( job->task == "revoke" ) {