From 517a7ba3ab57bb2916e7c296283e44b4d32503d2 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 3 Dec 2014 21:01:40 -0500 Subject: [PATCH] BOB setkeys/getkeys --- BOB.cpp | 22 ++++++++++++++++++++++ BOB.h | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/BOB.cpp b/BOB.cpp index 84928125..831bf0a6 100644 --- a/BOB.cpp +++ b/BOB.cpp @@ -310,6 +310,25 @@ namespace client SendReplyOK (m_Keys.GetPublic ().ToBase64 ().c_str ()); } + void BOBCommandSession::SetkeysCommandHandler (const char * operand, size_t len) + { + LogPrint (eLogDebug, "BOB: setkeys"); + m_Keys.FromBase64 (operand); + SendReplyOK ("keys set"); + } + + void BOBCommandSession::GetkeysCommandHandler (const char * operand, size_t len) + { + LogPrint (eLogDebug, "BOB: getkeys"); + SendReplyOK (m_Keys.ToBase64 ().c_str ()); + } + + void BOBCommandSession::GetdestCommandHandler (const char * operand, size_t len) + { + LogPrint (eLogDebug, "BOB: getdest"); + SendReplyOK (m_Keys.GetPublic ().ToBase64 ().c_str ()); + } + void BOBCommandSession::OuthostCommandHandler (const char * operand, size_t len) { LogPrint (eLogDebug, "BOB: outhost"); @@ -354,6 +373,9 @@ namespace client m_CommandHandlers[BOB_COMMAND_SETNICK] = &BOBCommandSession::SetNickCommandHandler; m_CommandHandlers[BOB_COMMAND_GETNICK] = &BOBCommandSession::GetNickCommandHandler; m_CommandHandlers[BOB_COMMAND_NEWKEYS] = &BOBCommandSession::NewkeysCommandHandler; + m_CommandHandlers[BOB_COMMAND_GETKEYS] = &BOBCommandSession::GetkeysCommandHandler; + m_CommandHandlers[BOB_COMMAND_SETKEYS] = &BOBCommandSession::SetkeysCommandHandler; + m_CommandHandlers[BOB_COMMAND_GETDEST] = &BOBCommandSession::GetdestCommandHandler; m_CommandHandlers[BOB_COMMAND_OUTHOST] = &BOBCommandSession::OuthostCommandHandler; m_CommandHandlers[BOB_COMMAND_OUTPORT] = &BOBCommandSession::OutportCommandHandler; m_CommandHandlers[BOB_COMMAND_INHOST] = &BOBCommandSession::InhostCommandHandler; diff --git a/BOB.h b/BOB.h index 771c4e4c..09141a61 100644 --- a/BOB.h +++ b/BOB.h @@ -22,7 +22,10 @@ namespace client const char BOB_COMMAND_STOP[] = "stop"; const char BOB_COMMAND_SETNICK[] = "setnick"; const char BOB_COMMAND_GETNICK[] = "getnick"; - const char BOB_COMMAND_NEWKEYS[] = "newkeys"; + const char BOB_COMMAND_NEWKEYS[] = "newkeys"; + const char BOB_COMMAND_GETKEYS[] = "getkeys"; + const char BOB_COMMAND_SETKEYS[] = "setkeys"; + const char BOB_COMMAND_GETDEST[] = "getdest"; const char BOB_COMMAND_OUTHOST[] = "outhost"; const char BOB_COMMAND_OUTPORT[] = "outport"; const char BOB_COMMAND_INHOST[] = "inhost"; @@ -83,6 +86,9 @@ namespace client void SetNickCommandHandler (const char * operand, size_t len); void GetNickCommandHandler (const char * operand, size_t len); void NewkeysCommandHandler (const char * operand, size_t len); + void SetkeysCommandHandler (const char * operand, size_t len); + void GetkeysCommandHandler (const char * operand, size_t len); + void GetdestCommandHandler (const char * operand, size_t len); void OuthostCommandHandler (const char * operand, size_t len); void OutportCommandHandler (const char * operand, size_t len); void InhostCommandHandler (const char * operand, size_t len);