]> WPIA git - cassiopeia.git/blobdiff - src/apps/signer.cpp
chg: Build two binaries for the signer
[cassiopeia.git] / src / apps / signer.cpp
diff --git a/src/apps/signer.cpp b/src/apps/signer.cpp
new file mode 100644 (file)
index 0000000..551f13f
--- /dev/null
@@ -0,0 +1,42 @@
+#include <iostream>
+#include <fstream>
+#include <streambuf>
+
+#include "database.h"
+#include "mysql.h"
+#include "simpleOpensslSigner.h"
+#include "util.h"
+#include "bios.h"
+#include "slipBio.h"
+#include "remoteSigner.h"
+#include "sslUtil.h"
+#include "config.h"
+#include "recordHandler.h"
+
+#ifdef NO_DAEMON
+#define DAEMON false
+#else
+#define DAEMON true
+#endif
+
+int handlermain( int argc, const char* argv[] );
+
+int main( int argc, const char* argv[] ) {
+    ( void ) argc;
+    ( void ) argv;
+
+    std::string path;
+
+    if( DAEMON ) {
+        path = "/etc/cacert/cassiopeia/cassiopeia.conf";
+    } else {
+        path = "config.txt";
+    }
+
+
+    if( parseConfig( path ) != 0 ) {
+        return -1;
+    }
+
+    return handlermain( argc, argv );
+}