6 #include "db/database.h"
8 #include "crypto/simpleOpensslSigner.h"
9 #include "crypto/remoteSigner.h"
10 #include "crypto/sslUtil.h"
12 #include "io/slipBio.h"
13 #include "io/recordHandler.h"
23 extern std::string serialPath;
25 int main( int argc, const char* argv[] ) try {
32 path = "/etc/cacert/cassiopeia/cassiopeia.conf";
37 if( parseConfig( path ) != 0 ) {
41 std::shared_ptr<int> ssl_lib = ssl_lib_ref;
43 if( serialPath == "" ) {
44 std::cout << "Error: no serial device is given" << std::endl;
48 std::shared_ptr<BIO> conn = openSerial( serialPath );
49 std::shared_ptr<BIO> slip1( BIO_new( toBio<SlipBIO>() ), BIO_free );
50 static_cast<SlipBIO*>( slip1->ptr )->setTarget( std::shared_ptr<OpensslBIO>( new OpensslBIOWrapper( conn ) ) );
52 DefaultRecordHandler* dh = new DefaultRecordHandler( std::shared_ptr<Signer>( new SimpleOpensslSigner( ) ), slip1 );
57 //} catch( const std::exception &ch ) {
58 //std::cout << "Real exception: " << typeid(ch).name() << ", " << ch.what() << std::endl;
59 } catch( const std::string& ch ) {
60 std::cout << "Exception: " << ch << std::endl;
61 } catch( char const* ch ) {
62 std::cout << "Exception: " << ch << std::endl;
68 } catch(std::exception& e) {
69 std::cerr << "Fatal Error: " << e.what() << "!\n";
72 std::cerr << "Fatal Error: Unknown Exception!\n";