|
|
@@ -19,7 +19,7 @@ |
|
|
|
#include "../CodeDweller/base64codec.hpp" |
|
|
|
// #include "tcp_watchdog.hpp" No longer using TCPWatchdog -- see below _M |
|
|
|
|
|
|
|
using namespace std; |
|
|
|
namespace cd = codedweller; |
|
|
|
|
|
|
|
///// utilities //////////////////////////////////////////////////////////////// |
|
|
|
|
|
|
@@ -200,7 +200,7 @@ void snfNETmgr::sendSample( |
|
|
|
//-- <msg...> |
|
|
|
|
|
|
|
XML << "<msg size=\'" << ScanData.ScanSize << "'>" << endl; // Starting with the msg element. |
|
|
|
to_base64 EncodedMessageData( |
|
|
|
cd::to_base64 EncodedMessageData( |
|
|
|
reinterpret_cast<const char*>(MessageBuffer), MessageLength); // Encode the message to base64. |
|
|
|
|
|
|
|
const int SampleLineLength = 64; // 64 bytes per line is good. |
|
|
@@ -501,7 +501,7 @@ void snfNETmgr::sync() { |
|
|
|
|
|
|
|
CurrentThreadState(SYNC_Compute_Response); |
|
|
|
|
|
|
|
from_base64 DecodedChallenge(Challenge.snf_sync_challenge_txt); // Decode the challenge. |
|
|
|
cd::from_base64 DecodedChallenge(Challenge.snf_sync_challenge_txt); // Decode the challenge. |
|
|
|
|
|
|
|
//--- Prepare the secret. |
|
|
|
|
|
|
@@ -524,7 +524,7 @@ void snfNETmgr::sync() { |
|
|
|
|
|
|
|
PadBuffer NewPad = OneTimePad(); // Grab a new Pad (default size). |
|
|
|
|
|
|
|
base64buffer ResponseBin; // With the key now established, |
|
|
|
cd::base64buffer ResponseBin; // With the key now established, |
|
|
|
for(unsigned int i = 0; i < NewPad.size(); i++) // encrypt the one time pad for |
|
|
|
ResponseBin.push_back( // transfer. |
|
|
|
ResponseGenerator.Encrypt(NewPad[i])); |
|
|
@@ -544,7 +544,7 @@ void snfNETmgr::sync() { |
|
|
|
|
|
|
|
//--- Encode our response as base64 and send it. |
|
|
|
|
|
|
|
to_base64 ResponseTxt(ResponseBin); // Encode the cyphertext as base64. |
|
|
|
cd::to_base64 ResponseTxt(ResponseBin); // Encode the cyphertext as base64. |
|
|
|
string ResponseTxtString; // Create a handy string and place |
|
|
|
ResponseTxtString.assign(ResponseTxt.begin(), ResponseTxt.end()); // the base 64 text into it. |
|
|
|
|