mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
first working version !
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5123 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
afc23f39c8
commit
42687f32aa
2 changed files with 19 additions and 6 deletions
|
@ -585,6 +585,12 @@ bool AuthGPG::DoOwnSignature(const void *data, unsigned int datalen, void *buf_s
|
|||
/* import to GnuPG and other Certificates */
|
||||
bool AuthGPG::VerifySignature(const void *data, int datalen, const void *sig, unsigned int siglen, const std::string &withfingerprint)
|
||||
{
|
||||
if(withfingerprint.length() != 40)
|
||||
{
|
||||
std::cerr << "WARNING: Still need to implement signature verification from complete keyring." << std::endl;
|
||||
return false ;
|
||||
}
|
||||
|
||||
return PGPHandler::VerifySignBin((unsigned char*)data,datalen,(unsigned char*)sig,siglen,PGPFingerprintType::fromFingerprint_hex(withfingerprint)) ;
|
||||
}
|
||||
|
||||
|
@ -614,6 +620,11 @@ bool AuthGPG::GeneratePGPCertificate(const std::string& name,
|
|||
/**** These Two are common */
|
||||
std::string AuthGPG::getGPGName(const std::string &id)
|
||||
{
|
||||
if(id.length() != 16)
|
||||
{
|
||||
std::cerr << "Wrong string passed to getGPGDetails: \"" << id << "\"" << std::endl;
|
||||
return std::string() ;
|
||||
}
|
||||
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
|
||||
|
||||
const PGPCertificateInfo *info = PGPHandler::getCertificateInfo(PGPIdType::fromUserId_hex(id)) ;
|
||||
|
@ -646,7 +657,6 @@ std::string AuthGPG::getGPGOwnId()
|
|||
|
||||
std::string AuthGPG::getGPGOwnName()
|
||||
{
|
||||
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
|
||||
return getGPGName(mOwnGpgId.toStdString()) ;
|
||||
}
|
||||
|
||||
|
@ -707,6 +717,12 @@ bool AuthGPG::getGPGDetails(const std::string& id, RsPeerDetails &d)
|
|||
{
|
||||
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
|
||||
|
||||
if(id.length() != 16)
|
||||
{
|
||||
std::cerr << "Wrong string passed to getGPGDetails: \"" << id << "\"" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
|
||||
const PGPCertificateInfo *pc = PGPHandler::getCertificateInfo(PGPIdType::fromUserId_hex(id)) ;
|
||||
|
||||
if(pc == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue