Sfoglia il codice sorgente

snfNETmgr not using namespace std

master
Pete McNeil 4 anni fa
parent
commit
28ae11eac4
2 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 5
    5
      snfNETmgr.cpp
  2. 3
    3
      snfNETmgr.hpp

+ 5
- 5
snfNETmgr.cpp Vedi File

@@ -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.


+ 3
- 3
snfNETmgr.hpp Vedi File

@@ -20,13 +20,13 @@
#include "snfLOGmgr.hpp"
#include "snfGBUdbmgr.hpp"

//namespace cd = codedweller;

class snfScanData; // Declare snfScanData;
class snfLOGmgr; // Declare snfLOGmgr;
class snfGBUdbmgr; // Declare snfGBUdbmgr;

using namespace std;

typedef vector<unsigned char> PadBuffer; // Holds one time pads etc.
typedef std::vector<unsigned char> PadBuffer; // Holds one time pads etc.
const unsigned int SNFHandshakeSize = 8; // Size of an SNF Handshake.
const unsigned int SNFChallengeSize = 32; // Size of an SNF Challenge.
const unsigned int SNFPadSize = 16; // Size of an SNF One Time Pad.

Loading…
Annulla
Salva