mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
commit
297907ef81
23 changed files with 334 additions and 89 deletions
|
@ -431,12 +431,25 @@ 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 RsCertificate::cleanCertificate(const std::string& input,std::string& output,Format& format,int& error_code,bool check_content)
|
||||
{
|
||||
if(cleanCertificate(input,output,error_code))
|
||||
{
|
||||
format = RS_CERTIFICATE_RADIX ;
|
||||
return true ;
|
||||
|
||||
if(!check_content)
|
||||
return true ;
|
||||
|
||||
try
|
||||
{
|
||||
RsCertificate c(input) ;
|
||||
return true ;
|
||||
}
|
||||
catch(uint32_t err_code)
|
||||
{
|
||||
error_code = err_code ;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false ;
|
||||
|
|
|
@ -41,7 +41,7 @@ class RsCertificate
|
|||
const unsigned char *pgp_key() const { return binary_pgp_key ; }
|
||||
size_t pgp_key_size() const { return binary_pgp_key_size ; }
|
||||
|
||||
static bool cleanCertificate(const std::string& input,std::string& output,RsCertificate::Format& format,int& error_code) ;
|
||||
static bool cleanCertificate(const std::string& input, std::string& output, RsCertificate::Format& format, int& error_code, bool check_content) ;
|
||||
|
||||
private:
|
||||
static bool cleanCertificate(const std::string& input,std::string& output,int&) ; // new radix format
|
||||
|
|
|
@ -1214,7 +1214,7 @@ bool p3Peers::cleanCertificate(const std::string &certstr, std::string &cleanCer
|
|||
{
|
||||
RsCertificate::Format format ;
|
||||
|
||||
return RsCertificate::cleanCertificate(certstr,cleanCert,format,error_code) ;
|
||||
return RsCertificate::cleanCertificate(certstr,cleanCert,format,error_code,true) ;
|
||||
}
|
||||
|
||||
bool p3Peers::saveCertificateToFile(const RsPeerId &id, const std::string &/*fname*/)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue