]> WPIA git - cassiopeia.git/blobdiff - src/io/recordHandler.cpp
upd: adding a newline to SPKAC output.
[cassiopeia.git] / src / io / recordHandler.cpp
index 56ebd29c30af6d6506f7e2b61aa985f12892e411..672712813a579197b7bd736bfdcb4c2169503aec 100644 (file)
@@ -38,7 +38,9 @@ public:
     std::vector<std::string> serials;
 
     RecordHandlerSession( DefaultRecordHandler* parent, std::shared_ptr<Signer> signer, std::shared_ptr<SSL_CTX> ctx, std::shared_ptr<BIO> output ) :
-        tbs( new TBSCertificate() ) {
+        sessid( 0 ),
+        lastCommandCount( 0 ),
+        tbs( new TBSCertificate() ){
         this->parent = parent;
         this->signer = signer;
         time_t c_time;
@@ -110,13 +112,13 @@ public:
         case RecordHeader::SignerCommand::SET_CSR:
             tbs->csr_content = data;
             tbs->csr_type = "CSR";
-            ( *log ) << "INFO: CSR read:" << std::endl << tbs->csr_content;
+            ( *log ) << "INFO: CSR read: " << tbs->csr_content << std::endl;
             break;
 
         case RecordHeader::SignerCommand::SET_SPKAC:
             tbs->csr_content = data;
             tbs->csr_type = "SPKAC";
-            ( *log ) << "INFO: SPKAC read:" << std::endl << tbs->csr_content;
+            ( *log ) << "INFO: SPKAC read: " << tbs->csr_content << std::endl;
             break;
 
         case RecordHeader::SignerCommand::SET_SIGNATURE_TYPE:
@@ -128,6 +130,14 @@ public:
             tbs->profile = data;
             break;
 
+        case RecordHeader::SignerCommand::SET_WISH_FROM:
+            tbs->wishFrom = data;
+            break;
+
+        case RecordHeader::SignerCommand::SET_WISH_TO:
+            tbs->wishTo = data;
+            break;
+
         case RecordHeader::SignerCommand::ADD_SAN: {
             size_t pos = data.find( "," );
 
@@ -213,14 +223,8 @@ public:
     }
 };
 
-DefaultRecordHandler::DefaultRecordHandler( std::shared_ptr<Signer> signer, std::shared_ptr<BIO> bio ) :
-    currentSession() {
-
-    this->signer = signer;
-
-    ctx = generateSSLContext( true );
-
-    this->bio = bio;
+DefaultRecordHandler::DefaultRecordHandler( std::shared_ptr<Signer> signer, std::shared_ptr<BIO> bio )
+    : bio( bio ), ctx( generateSSLContext( true ) ), signer( signer ), currentSession() {
 }
 
 void DefaultRecordHandler::reset() {