mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Add ConnectFriendWizard improvement.
Add cert details in friendCertCleanLabel tooltip. Use qss for background color of friendCertCleanLabel. Add Known IP in final view.
This commit is contained in:
parent
e8b97405b9
commit
a072b151f5
7 changed files with 57 additions and 36 deletions
|
@ -552,26 +552,24 @@ 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, uint32_t& error_code, bool check_content )
|
||||
bool RsCertificate::cleanCertificate( const std::string& input, std::string& output, Format& format, uint32_t& error_code, bool check_content, RsPeerDetails& details)
|
||||
{
|
||||
if(cleanRadix64(input,output,error_code))
|
||||
{
|
||||
RsPeerDetails details;
|
||||
|
||||
if(rsPeers->parseShortInvite(output,details,error_code))
|
||||
{
|
||||
format = RS_CERTIFICATE_SHORT_RADIX;
|
||||
return true;
|
||||
}
|
||||
if(rsPeers->parseShortInvite(output,details,error_code))
|
||||
{
|
||||
format = RS_CERTIFICATE_SHORT_RADIX;
|
||||
return true;
|
||||
}
|
||||
|
||||
//Clear details. As parseShortInvite may make it dirty.
|
||||
details = RsPeerDetails();
|
||||
format = RS_CERTIFICATE_RADIX;
|
||||
|
||||
if(!check_content) return true;
|
||||
|
||||
uint32_t errCode;
|
||||
auto crt = RsCertificate::fromString(input, errCode);
|
||||
error_code = static_cast<int>(errCode);
|
||||
return crt != nullptr;
|
||||
return rsPeers->loadDetailsFromStringCert(input,details,error_code);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
|
||||
static bool cleanCertificate(
|
||||
const std::string& input, std::string& output,
|
||||
RsCertificate::Format& format, uint32_t& error_code, bool check_content);
|
||||
RsCertificate::Format& format, uint32_t& error_code, bool check_content, RsPeerDetails& details);
|
||||
|
||||
const std::set<RsUrl>& locators() const { return mLocators; }
|
||||
|
||||
|
|
|
@ -887,7 +887,7 @@ public:
|
|||
// Certificate utils
|
||||
virtual bool cleanCertificate(
|
||||
const std::string& certstr, std::string& cleanCert,
|
||||
bool& is_short_format, uint32_t& error_code ) = 0;
|
||||
bool& is_short_format, uint32_t& error_code, RsPeerDetails& details) = 0;
|
||||
virtual std::string saveCertificateToString(const RsPeerId &id) = 0;
|
||||
|
||||
virtual bool signGPGCertificate(const RsPgpId &gpg_id,const std::string& gpg_passphrase) = 0;
|
||||
|
|
|
@ -1758,11 +1758,11 @@ bool p3Peers::loadDetailsFromStringCert( const std::string &certstr,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool p3Peers::cleanCertificate(const std::string &certstr, std::string &cleanCert,bool& is_short_format,uint32_t& error_code)
|
||||
bool p3Peers::cleanCertificate(const std::string &certstr, std::string &cleanCert,bool& is_short_format,uint32_t& error_code,RsPeerDetails& details)
|
||||
{
|
||||
RsCertificate::Format format ;
|
||||
|
||||
bool res = RsCertificate::cleanCertificate(certstr,cleanCert,format,error_code,true) ;
|
||||
bool res = RsCertificate::cleanCertificate(certstr,cleanCert,format,error_code,true,details) ;
|
||||
|
||||
if(format == RsCertificate::RS_CERTIFICATE_RADIX)
|
||||
is_short_format = false;
|
||||
|
|
|
@ -163,7 +163,7 @@ public:
|
|||
virtual bool loadPgpKeyFromBinaryData( const unsigned char *bin_key_data,uint32_t bin_key_len, RsPgpId& gpg_id, std::string& error_string ) override;
|
||||
virtual bool loadDetailsFromStringCert(const std::string &cert, RsPeerDetails &pd, uint32_t& error_code) override;
|
||||
|
||||
virtual bool cleanCertificate(const std::string &certstr, std::string &cleanCert, bool &is_short_format, uint32_t& error_code) override;
|
||||
virtual bool cleanCertificate(const std::string &certstr, std::string &cleanCert, bool &is_short_format, uint32_t& error_code, RsPeerDetails& details) override;
|
||||
virtual std::string saveCertificateToString(const RsPeerId &id) override;
|
||||
|
||||
virtual bool signGPGCertificate(const RsPgpId &id,const std::string& gpg_passphrase) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue