mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
converted short invites to compact PGP format for increased robustness
This commit is contained in:
parent
e132ce7072
commit
9312d0cb3a
6 changed files with 187 additions and 169 deletions
|
@ -552,13 +552,13 @@ unsigned short RsCertificate::loc_port_us() const
|
|||
return (int)ipv4_internal_ip_and_port[4]*256 + (int)ipv4_internal_ip_and_port[5] ;
|
||||
}
|
||||
|
||||
bool RsCertificate::cleanCertificate( const std::string& input, std::string& output, Format& format, int& error_code, bool check_content )
|
||||
bool RsCertificate::cleanCertificate( const std::string& input, std::string& output, Format& format, uint32_t& error_code, bool check_content )
|
||||
{
|
||||
if(cleanRadix64(input,output,error_code))
|
||||
{
|
||||
RsPeerDetails details;
|
||||
|
||||
if(rsPeers->parseShortInvite(output,details))
|
||||
if(rsPeers->parseShortInvite(output,details,error_code))
|
||||
{
|
||||
format = RS_CERTIFICATE_SHORT_RADIX;
|
||||
return true;
|
||||
|
@ -584,7 +584,7 @@ std::string RsCertificate::armouredPGPKey() const
|
|||
|
||||
// Yeah, this is simple, and that is what's good about the radix format. Can't be broken ;-)
|
||||
//
|
||||
bool RsCertificate::cleanRadix64(const std::string& instr,std::string& str,int& error_code)
|
||||
bool RsCertificate::cleanRadix64(const std::string& instr,std::string& str,uint32_t& error_code)
|
||||
{
|
||||
error_code = RS_PEER_CERT_CLEANING_CODE_NO_ERROR ;
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
|
||||
static bool cleanCertificate(
|
||||
const std::string& input, std::string& output,
|
||||
RsCertificate::Format& format, int& error_code, bool check_content);
|
||||
RsCertificate::Format& format, uint32_t& error_code, bool check_content);
|
||||
|
||||
const std::set<RsUrl>& locators() const { return mLocators; }
|
||||
|
||||
|
@ -99,7 +99,7 @@ public:
|
|||
|
||||
private:
|
||||
// new radix format
|
||||
static bool cleanRadix64( const std::string& input, std::string& output, int&);
|
||||
static bool cleanRadix64(const std::string& input, std::string& output, uint32_t &);
|
||||
|
||||
static void scan_ip( const std::string& ip_string, unsigned short port,
|
||||
unsigned char *destination_memory );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue