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() );
log << "FINE: CERTIFICATE LOG: " << res->log << std::endl;
log << "FINE: CERTIFICATE:" << std::endl << res->certificate << std::endl;
std::string fn = writeBackFile( job->target.c_str(), res->certificate, keyDir );
+ if( fn.empty() ) {
+ log << "ERROR: Writeback of the certificate failed." << std::endl;
+ jp->failJob( job );
+ continue;
+ }
+
res->crt_name = fn;
- jp->writeBack( job, res );
+ jp->writeBack( job, res ); //! \FIXME: Check return value
log << "FINE: signing done." << std::endl;
if( DAEMON ) {
continue;
} catch( const char* c ) {
log << "ERROR: " << c << std::endl;
- } catch( std::string c ) {
+ } catch( std::string& c ) {
log << "ERROR: " << c << std::endl;
}
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" ) {