diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 58f95e486..fbe1ce488 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -441,12 +441,23 @@ bool p3PeerMgrIMPL::haveOnceConnected() /*******************************************************************/ /*******************************************************************/ -bool p3PeerMgrIMPL::addFriend(const std::string &id, const std::string &gpg_id, uint32_t netMode, uint32_t visState, time_t lastContact) +bool p3PeerMgrIMPL::addFriend(const std::string& input_id, const std::string& input_gpg_id, uint32_t netMode, uint32_t visState, time_t lastContact) { bool notifyLinkMgr = false; + std::string id = input_id ; + std::string gpg_id = input_gpg_id ; - rslog(RSL_WARNING, p3peermgrzone, "p3PeerMgr::addFriend() id: " + id); + rslog(RSL_WARNING, p3peermgrzone, "p3PeerMgr::addFriend() id: " + id); + // For safety, make sure ssl_id is lower case and GPG id is upper case. + // + for(uint32_t i=0;i= 'A' && id[i] <= 'F') + id[i] += 'a' - 'A' ; + + for(uint32_t i=0;i= 'a' && gpg_id[i] <= 'f') + gpg_id[i] += 'A' - 'a' ; { RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/