mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 17:51:26 -05:00
removed old/unused files
This commit is contained in:
parent
b53e75ae82
commit
98bf2922cb
@ -1,408 +0,0 @@
|
|||||||
/*
|
|
||||||
* libretroshare/src/ : authgpgtest.cc
|
|
||||||
*
|
|
||||||
* GPG interface for RetroShare.
|
|
||||||
*
|
|
||||||
* Copyright 2009-2010 by Robert Fernie.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License Version 2 as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
* USA.
|
|
||||||
*
|
|
||||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
||||||
*
|
|
||||||
* This is *THE* auth manager. It provides the web-of-trust via
|
|
||||||
* gpgme, and authenticates the certificates that are managed
|
|
||||||
* by the sublayer AuthSSL.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "pqi/authgpgtest.h"
|
|
||||||
|
|
||||||
AuthGPGtest::AuthGPGtest()
|
|
||||||
{
|
|
||||||
mOwnGPGId = "TEST_DUMMY_OWN_GPG_ID";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param ids list of gpg certificate ids (note, not the actual certificates)
|
|
||||||
*/
|
|
||||||
bool AuthGPGtest::availableGPGCertificatesWithPrivateKeys(std::list<std::string> &ids)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::availableGPGCertificatesWithPrivateKeys()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::printKeys()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::printKeys()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 1 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 1: Initialisation.... As we are switching to OpenPGP the init functions
|
|
||||||
* will be different. Just move the initialisation functions over....
|
|
||||||
*
|
|
||||||
* As GPGMe requires external calls to the GPG executable, which could potentially
|
|
||||||
* be expensive, We'll want to cache the GPG keys in this class.
|
|
||||||
* This should be done at initialisation, and saved in a map.
|
|
||||||
* (see storage at the end of the class)
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
bool AuthGPGtest::active()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::active()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialize */
|
|
||||||
bool AuthGPGtest::InitAuth()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::InitAuth()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Init by generating new Own PGP Cert, or selecting existing PGP Cert */
|
|
||||||
int AuthGPGtest::GPGInit(const std::string& ownId)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::GPGInit(): new OwnId: " << ownId;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
mOwnGPGId = ownId;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::CloseAuth()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::CloseAuth()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::GeneratePGPCertificate(std::string name, std::string email, std::string passwd, std::string &pgpId, std::string &errString)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::GeneratePGPCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 3 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 3: These are some of the most commonly used functions in Retroshare.
|
|
||||||
*
|
|
||||||
* More commonly used functions.
|
|
||||||
*
|
|
||||||
* provide access to details in cache list.
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
std::string getGPGName(const std::string &pgp_id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGName()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return "DUMMY_NAME";
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getGPGEmail(const std::string &pgp_id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGEmail()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return "DUMMY_EMAIL";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* PGP web of trust management */
|
|
||||||
std::string AuthGPGtest::getGPGOwnId()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGOwnId()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return mOwnGPGId;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string AuthGPGtest::getGPGOwnName()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGOwnName()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return "DUMMY_OWN_NAME";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
std::string AuthGPGtest::getGPGOwnEmail()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGOwnEmail()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return "DUMMY_OWN_EMAIL";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool AuthGPGtest::getGPGDetails(const std::string& id, RsPeerDetails &d)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGDetails()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::getGPGAllList(std::list<std::string> &ids)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGAllList()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::getGPGValidList(std::list<std::string> &ids)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGValidList()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::getGPGAcceptedList(std::list<std::string> &ids)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGAcceptedList()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::getGPGSignedList(std::list<std::string> &ids)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGSignedList()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::isGPGValid(const std::string& id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::isGPGValid()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::isGPGSigned(const std::string& id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::isGPGSigned()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::isGPGAccepted(const std::string& id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::isGPGAccepted()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isGPGId(const std::string &id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::isGPGId()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 4 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 4: Loading and Saving Certificates. (Strings and Files)
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
bool AuthGPGtest::LoadCertificateFromString(const std::string& pem, std::string &gpg_id,
|
|
||||||
std::string& error_string)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::LoadCertificateFromString()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string AuthGPGtest::SaveCertificateToString(const std::string& id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::SaveCertificateToString()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return "NOT_A_CERTIFICATE";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 6 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 6: Authentication, Trust and Signing.
|
|
||||||
*
|
|
||||||
* This is some of the harder functions, but they should have been
|
|
||||||
* done in gpgroot already.
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
bool AuthGPGtest::setAcceptToConnectGPGCertificate(const std::string& gpg_id,
|
|
||||||
bool acceptance)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::setAcceptToConnectGPGCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::SignCertificateLevel0(const std::string& id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::SignCertificateLevel0()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::RevokeCertificate(const std::string& id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::RevokeCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool TrustCertificate(const std::string &id, int trustlvl)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::TrustCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
void AuthGPGtest::run()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
bool AuthGPGtest::TrustCertificateNone(std::string id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::TrustCertificateNone()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::TrustCertificateMarginally(std::string id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::TrustCertificateMarginally()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::TrustCertificateFully(std::string id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::TrustCertificateFully()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool AuthGPGtest::TrustCertificate(std::string id, int trustlvl)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::TrustCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 7 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 7: Signing Data.
|
|
||||||
*
|
|
||||||
* There should also be Encryption Functions... (do later).
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
#if 0
|
|
||||||
bool AuthGPGtest::SignData(std::string input, std::string &sign)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::SignData()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::SignData(const void *data, const uint32_t len, std::string &sign)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::SignData()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::SignDataBin(std::string input, unsigned char *sign, unsigned int *signlen)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::SignDataBin()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool AuthGPGtest::SignDataBin(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::SignDataBin()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::VerifySignBin(const void*, uint32_t, unsigned char*, unsigned int, const std::string& withfingerprint)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::VerifySignBin()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::decryptText(gpgme_data_t CIPHER, gpgme_data_t PLAIN)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::decryptText()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGimpl::addService(AuthGPGService *service)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::addService()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string AuthGPGtest::getGPGName(const std::string & pgp_id)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::getGPGName()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return std::string("");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::TrustCertificate(const std::string & id, int trustlvl)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::isGPGId(const std::string & id)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string AuthGPGtest::getGPGEmail(const std::string & pgp_id)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthGPGtest::encryptText(gpgme_data_t PLAIN, gpgme_data_t CIPHER)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthGPGtest::encryptText()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
@ -1,160 +0,0 @@
|
|||||||
/*
|
|
||||||
* libretroshare/src/ : authgpgtest.h
|
|
||||||
*
|
|
||||||
* GPG interface for RetroShare.
|
|
||||||
*
|
|
||||||
* Copyright 2009-2010 by Robert Fernie.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License Version 2 as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
* USA.
|
|
||||||
*
|
|
||||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
||||||
*
|
|
||||||
* This is *THE* auth manager. It provides the web-of-trust via
|
|
||||||
* gpgme, and authenticates the certificates that are managed
|
|
||||||
* by the sublayer AuthSSL.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef RS_GPG_AUTH_TEST_HEADER
|
|
||||||
#define RS_GPG_AUTH_TEST_HEADER
|
|
||||||
|
|
||||||
#include "pqi/authgpg.h"
|
|
||||||
|
|
||||||
/* override the default AuthGPG */
|
|
||||||
void setAuthGPG(AuthGPG *newgpg);
|
|
||||||
|
|
||||||
class AuthGPGtest: public AuthGPG
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
AuthGPGtest();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param ids list of gpg certificate ids (note, not the actual certificates)
|
|
||||||
*/
|
|
||||||
virtual bool availableGPGCertificatesWithPrivateKeys(std::list<std::string> &ids);
|
|
||||||
virtual bool printKeys();
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 1 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 1: Initialisation.... As we are switching to OpenPGP the init functions
|
|
||||||
* will be different. Just move the initialisation functions over....
|
|
||||||
*
|
|
||||||
* As GPGMe requires external calls to the GPG executable, which could potentially
|
|
||||||
* be expensive, We'll want to cache the GPG keys in this class.
|
|
||||||
* This should be done at initialisation, and saved in a map.
|
|
||||||
* (see storage at the end of the class)
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
virtual bool active();
|
|
||||||
|
|
||||||
/* Initialize */
|
|
||||||
virtual bool InitAuth ();
|
|
||||||
virtual void run();
|
|
||||||
|
|
||||||
/* Init by generating new Own PGP Cert, or selecting existing PGP Cert */
|
|
||||||
virtual int GPGInit(const std::string& ownId);
|
|
||||||
virtual bool CloseAuth();
|
|
||||||
virtual bool GeneratePGPCertificate(std::string name, std::string email, std::string passwd, std::string &pgpId, std::string &errString);
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 3 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 3: These are some of the most commonly used functions in Retroshare.
|
|
||||||
*
|
|
||||||
* More commonly used functions.
|
|
||||||
*
|
|
||||||
* provide access to details in cache list.
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
virtual std::string getGPGName(const std::string &pgp_id);
|
|
||||||
virtual std::string getGPGEmail(const std::string &pgp_id);
|
|
||||||
|
|
||||||
/* PGP web of trust management */
|
|
||||||
virtual std::string getGPGOwnId();
|
|
||||||
virtual std::string getGPGOwnName();
|
|
||||||
|
|
||||||
//virtual std::string getGPGOwnEmail();
|
|
||||||
virtual bool getGPGDetails(const std::string& id, RsPeerDetails &d);
|
|
||||||
virtual bool getGPGAllList(std::list<std::string> &ids);
|
|
||||||
virtual bool getGPGValidList(std::list<std::string> &ids);
|
|
||||||
virtual bool getGPGAcceptedList(std::list<std::string> &ids);
|
|
||||||
virtual bool getGPGSignedList(std::list<std::string> &ids);
|
|
||||||
virtual bool isGPGValid(const std::string& id);
|
|
||||||
virtual bool isGPGSigned(const std::string& id);
|
|
||||||
virtual bool isGPGAccepted(const std::string& id);
|
|
||||||
virtual bool isGPGId(const std::string &id);
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 4 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 4: Loading and Saving Certificates. (Strings and Files)
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
virtual bool LoadCertificateFromString(const std::string& pem, std::string &gpg_id,
|
|
||||||
std::string& error_string);
|
|
||||||
virtual std::string SaveCertificateToString(const std::string& id);
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 6 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 6: Authentication, Trust and Signing.
|
|
||||||
*
|
|
||||||
* This is some of the harder functions, but they should have been
|
|
||||||
* done in gpgroot already.
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
virtual bool setAcceptToConnectGPGCertificate(const std::string& gpg_id,
|
|
||||||
bool acceptance); //don't act on the gpg key, use a seperate set
|
|
||||||
virtual bool SignCertificateLevel0(const std::string& id);
|
|
||||||
virtual bool RevokeCertificate(const std::string& id); /* Particularly hard - leave for later */
|
|
||||||
//virtual bool TrustCertificateNone(std::string id);
|
|
||||||
//virtual bool TrustCertificateMarginally(std::string id);
|
|
||||||
//virtual bool TrustCertificateFully(std::string id);
|
|
||||||
virtual bool TrustCertificate(const std::string &id, int trustlvl); //trustlvl is 2 for none, 3 for marginal and 4 for full trust
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
/************************* STAGE 7 ***********************************************/
|
|
||||||
/*********************************************************************************/
|
|
||||||
/*****
|
|
||||||
* STAGE 7: Signing Data.
|
|
||||||
*
|
|
||||||
* There should also be Encryption Functions... (do later).
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
//virtual bool SignData(std::string input, std::string &sign);
|
|
||||||
//virtual bool SignData(const void *data, const uint32_t len, std::string &sign);
|
|
||||||
//virtual bool SignDataBin(std::string input, unsigned char *sign, unsigned int *signlen);
|
|
||||||
virtual bool SignDataBin(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen);
|
|
||||||
virtual bool VerifySignBin(const void*, uint32_t, unsigned char*, unsigned int, const std::string& withfingerprint);
|
|
||||||
virtual bool decryptText(gpgme_data_t CIPHER, gpgme_data_t PLAIN);
|
|
||||||
virtual bool encryptText(gpgme_data_t PLAIN, gpgme_data_t CIPHER);
|
|
||||||
//END of PGP public functions
|
|
||||||
|
|
||||||
virtual bool addService(AuthGPGService *service);
|
|
||||||
private:
|
|
||||||
|
|
||||||
std::string mOwnGPGId;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,223 +0,0 @@
|
|||||||
/*
|
|
||||||
* libretroshare/src/pqi: authssltest.cc
|
|
||||||
*
|
|
||||||
* 3P/PQI network interface for RetroShare.
|
|
||||||
*
|
|
||||||
* Copyright 2004-2008 by Robert Fernie.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License Version 2 as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
* USA.
|
|
||||||
*
|
|
||||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "pqi/authssltest.h"
|
|
||||||
|
|
||||||
AuthSSLtest::AuthSSLtest()
|
|
||||||
{
|
|
||||||
mOwnId = "abcdtestid12345678";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialisation Functions (Unique) */
|
|
||||||
bool AuthSSLtest::validateOwnCertificate(X509 *x509, EVP_PKEY *pkey)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::validateOwnCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool AuthSSLtest::active()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::active()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int AuthSSLtest::InitAuth(const char *srvr_cert, const char *priv_key,
|
|
||||||
const char *passwd)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::InitAuth()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::CloseAuth()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::AuthSSLtest::CloseAuth()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********** Overloaded Functions from p3AuthMgr **********/
|
|
||||||
|
|
||||||
/* get Certificate Id */
|
|
||||||
std::string AuthSSLtest::OwnId()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::OwnId";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return mOwnId;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string AuthSSLtest::getOwnLocation()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::getOwnLocation";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return "TestVersion";
|
|
||||||
}
|
|
||||||
|
|
||||||
//bool getAllList(std::list<std::string> &ids);
|
|
||||||
//bool getAuthenticatedList(std::list<std::string> &ids);
|
|
||||||
//bool getUnknownList(std::list<std::string> &ids);
|
|
||||||
//bool getSSLChildListOfGPGId(std::string gpg_id, std::list<std::string> &ids);
|
|
||||||
|
|
||||||
/* get Details from the Certificates */
|
|
||||||
//bool isAuthenticated(std::string id);
|
|
||||||
//virtual std::string getName(std::string id);
|
|
||||||
//std::string getIssuerName(std::string id);
|
|
||||||
//std::string getGPGId(SSL_id id);
|
|
||||||
//bool getCertDetails(std::string id, sslcert &cert);
|
|
||||||
|
|
||||||
/* Load/Save certificates */
|
|
||||||
std::string AuthSSLtest::SaveOwnCertificateToString()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::SaveOwnCertificateToString()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Sign / Encrypt / Verify Data */
|
|
||||||
bool AuthSSLtest::SignData(std::string input, std::string &sign)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::SignData()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::SignData(const void *data, const uint32_t len, std::string &sign)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::SignData()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool AuthSSLtest::SignDataBin(std::string, unsigned char*, unsigned int*)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::SignDataBin()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::SignDataBin(const void*, uint32_t, unsigned char*, unsigned int*)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::SignDataBin()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::VerifyOwnSignBin(const void*, uint32_t, unsigned char*, unsigned int)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::VerifyOwnSignBin()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::VerifySignBin(const void *data, const uint32_t len,
|
|
||||||
unsigned char *sign, unsigned int signlen, SSL_id sslId)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::VerifySignBin()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// return : false if encrypt failed
|
|
||||||
bool AuthSSLtest::encrypt(void *&out, int &outlen, const void *in, int inlen, std::string peerId)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::encrypt()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// return : false if decrypt fails
|
|
||||||
bool AuthSSLtest::decrypt(void *&out, int &outlen, const void *in, int inlen)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::decrypt()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
X509* AuthSSLtest::SignX509ReqWithGPG(X509_REQ *req, long days)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::SignX509ReqWithGPG";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::AuthX509WithGPG(X509 *x509)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::AuthX509WithGPG()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int AuthSSLtest::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::VerifyX509Callback()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::ValidateCertificate(X509 *x509, std::string &peerId)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::ValidateCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SSL_CTX *AuthSSLtest::getCTX()
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::getCTX()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Restored these functions: */
|
|
||||||
bool AuthSSLtest::FailedCertificate(X509 *x509, bool incoming)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::FailedCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthSSLtest::CheckCertificate(std::string peerId, X509 *x509)
|
|
||||||
{
|
|
||||||
std::cerr << "AuthSSLtest::CheckCertificate()";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
|||||||
/*
|
|
||||||
* libretroshare/src/pqi: authssltest.h
|
|
||||||
*
|
|
||||||
* 3P/PQI network interface for RetroShare.
|
|
||||||
*
|
|
||||||
* Copyright 2009-2010 by Robert Fernie.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License Version 2 as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
* USA.
|
|
||||||
*
|
|
||||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MRK_AUTH_SSL_TEST_HEADER
|
|
||||||
#define MRK_AUTH_SSL_TEST_HEADER
|
|
||||||
|
|
||||||
#include "pqi/authssl.h"
|
|
||||||
|
|
||||||
void setAuthSSL(AuthSSL *newssl);
|
|
||||||
|
|
||||||
class AuthSSLtest: public AuthSSL
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
AuthSSLtest();
|
|
||||||
/* Initialisation Functions (Unique) */
|
|
||||||
virtual bool validateOwnCertificate(X509 *x509, EVP_PKEY *pkey);
|
|
||||||
|
|
||||||
virtual bool active();
|
|
||||||
virtual int InitAuth(const char *srvr_cert, const char *priv_key,
|
|
||||||
const char *passwd);
|
|
||||||
virtual bool CloseAuth();
|
|
||||||
|
|
||||||
/*********** Overloaded Functions from p3AuthMgr **********/
|
|
||||||
|
|
||||||
/* get Certificate Id */
|
|
||||||
virtual std::string OwnId();
|
|
||||||
virtual std::string getOwnLocation();
|
|
||||||
//virtual bool getAllList(std::list<std::string> &ids);
|
|
||||||
//virtual bool getAuthenticatedList(std::list<std::string> &ids);
|
|
||||||
//virtual bool getUnknownList(std::list<std::string> &ids);
|
|
||||||
//virtual bool getSSLChildListOfGPGId(std::string gpg_id, std::list<std::string> &ids);
|
|
||||||
|
|
||||||
/* get Details from the Certificates */
|
|
||||||
//virtual bool isAuthenticated(std::string id);
|
|
||||||
//virtual std::string getName(std::string id);
|
|
||||||
//virtual std::string getIssuerName(std::string id);
|
|
||||||
//virtual std::string getGPGId(SSL_id id);
|
|
||||||
//virtual bool getCertDetails(std::string id, sslcert &cert);
|
|
||||||
|
|
||||||
/* Load/Save certificates */
|
|
||||||
virtual std::string SaveOwnCertificateToString();
|
|
||||||
|
|
||||||
/* Sign / Encrypt / Verify Data */
|
|
||||||
virtual bool SignData(std::string input, std::string &sign);
|
|
||||||
virtual bool SignData(const void *data, const uint32_t len, std::string &sign);
|
|
||||||
|
|
||||||
virtual bool SignDataBin(std::string, unsigned char*, unsigned int*);
|
|
||||||
virtual bool SignDataBin(const void*, uint32_t, unsigned char*, unsigned int*);
|
|
||||||
virtual bool VerifyOwnSignBin(const void*, uint32_t, unsigned char*, unsigned int);
|
|
||||||
virtual bool VerifySignBin(const void *data, const uint32_t len,
|
|
||||||
unsigned char *sign, unsigned int signlen, SSL_id sslId);
|
|
||||||
|
|
||||||
// return : false if encrypt failed
|
|
||||||
virtual bool encrypt(void *&out, int &outlen, const void *in, int inlen, std::string peerId);
|
|
||||||
// return : false if decrypt fails
|
|
||||||
virtual bool decrypt(void *&out, int &outlen, const void *in, int inlen);
|
|
||||||
|
|
||||||
|
|
||||||
virtual X509* SignX509ReqWithGPG(X509_REQ *req, long days);
|
|
||||||
virtual bool AuthX509WithGPG(X509 *x509);
|
|
||||||
|
|
||||||
|
|
||||||
virtual int VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx);
|
|
||||||
virtual bool ValidateCertificate(X509 *x509, std::string &peerId); /* validate + get id */
|
|
||||||
|
|
||||||
public: /* SSL specific functions used in pqissl/pqissllistener */
|
|
||||||
virtual SSL_CTX *getCTX();
|
|
||||||
|
|
||||||
/* Restored these functions: */
|
|
||||||
virtual bool FailedCertificate(X509 *x509, bool incoming); /* store for discovery */
|
|
||||||
virtual bool CheckCertificate(std::string peerId, X509 *x509); /* check that they are exact match */
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
std::string mOwnId;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // MRK_AUTH_SSL_TEST_HEADER
|
|
@ -1,151 +0,0 @@
|
|||||||
#ifndef RETROSHARE_POSTED_GUI_INTERFACE_H
|
|
||||||
#define RETROSHARE_POSTED_GUI_INTERFACE_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* libretroshare/src/retroshare: rsposted.h
|
|
||||||
*
|
|
||||||
* RetroShare C++ Interface.
|
|
||||||
*
|
|
||||||
* Copyright 2008-2012 by Robert Fernie.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License Version 2 as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
* USA.
|
|
||||||
*
|
|
||||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <string>
|
|
||||||
#include <list>
|
|
||||||
#include <retroshare/rsidentityVEG.h>
|
|
||||||
|
|
||||||
/* The Main Interface Class - for information about your Peers */
|
|
||||||
class RsPostedVEG;
|
|
||||||
extern RsPostedVEG *rsPostedVEG;
|
|
||||||
|
|
||||||
|
|
||||||
class RsPostedGroup
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RsGroupMetaData mMeta;
|
|
||||||
RsPostedGroup() { return; }
|
|
||||||
};
|
|
||||||
|
|
||||||
class RsPostedMsg
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RsPostedMsg(uint32_t t)
|
|
||||||
:postedType(t) { return; }
|
|
||||||
|
|
||||||
RsMsgMetaData mMeta;
|
|
||||||
uint32_t postedType;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define RSPOSTED_MSGTYPE_POST 0x0001
|
|
||||||
#define RSPOSTED_MSGTYPE_VOTE 0x0002
|
|
||||||
#define RSPOSTED_MSGTYPE_COMMENT 0x0004
|
|
||||||
|
|
||||||
#define RSPOSTED_PERIOD_YEAR 1
|
|
||||||
#define RSPOSTED_PERIOD_MONTH 2
|
|
||||||
#define RSPOSTED_PERIOD_WEEK 3
|
|
||||||
#define RSPOSTED_PERIOD_DAY 4
|
|
||||||
#define RSPOSTED_PERIOD_HOUR 5
|
|
||||||
|
|
||||||
#define RSPOSTED_VIEWMODE_LATEST 1
|
|
||||||
#define RSPOSTED_VIEWMODE_TOP 2
|
|
||||||
#define RSPOSTED_VIEWMODE_HOT 3
|
|
||||||
#define RSPOSTED_VIEWMODE_COMMENTS 4
|
|
||||||
|
|
||||||
|
|
||||||
class RsPostedPost: public RsPostedMsg
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RsPostedPost(): RsPostedMsg(RSPOSTED_MSGTYPE_POST)
|
|
||||||
{
|
|
||||||
mMeta.mMsgFlags = RSPOSTED_MSGTYPE_POST;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string mLink;
|
|
||||||
std::string mNotes;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class RsPostedVote: public RsPostedMsg
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RsPostedVote(): RsPostedMsg(RSPOSTED_MSGTYPE_VOTE)
|
|
||||||
{
|
|
||||||
mMeta.mMsgFlags = RSPOSTED_MSGTYPE_VOTE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class RsPostedComment: public RsPostedMsg
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RsPostedComment(): RsPostedMsg(RSPOSTED_MSGTYPE_COMMENT)
|
|
||||||
{
|
|
||||||
mMeta.mMsgFlags = RSPOSTED_MSGTYPE_COMMENT;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string mComment;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const RsPostedGroup &group);
|
|
||||||
std::ostream &operator<<(std::ostream &out, const RsPostedPost &post);
|
|
||||||
std::ostream &operator<<(std::ostream &out, const RsPostedVote &vote);
|
|
||||||
std::ostream &operator<<(std::ostream &out, const RsPostedComment &comment);
|
|
||||||
|
|
||||||
|
|
||||||
class RsPostedVEG: public RsTokenServiceVEG
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
RsPostedVEG() { return; }
|
|
||||||
virtual ~RsPostedVEG() { return; }
|
|
||||||
|
|
||||||
/* Specific Service Data */
|
|
||||||
virtual bool getGroup(const uint32_t &token, RsPostedGroup &group) = 0;
|
|
||||||
virtual bool getPost(const uint32_t &token, RsPostedPost &post) = 0;
|
|
||||||
virtual bool getComment(const uint32_t &token, RsPostedComment &comment) = 0;
|
|
||||||
|
|
||||||
virtual bool submitGroup(uint32_t &token, RsPostedGroup &group, bool isNew) = 0;
|
|
||||||
virtual bool submitPost(uint32_t &token, RsPostedPost &post, bool isNew) = 0;
|
|
||||||
virtual bool submitVote(uint32_t &token, RsPostedVote &vote, bool isNew) = 0;
|
|
||||||
virtual bool submitComment(uint32_t &token, RsPostedComment &comment, bool isNew) = 0;
|
|
||||||
|
|
||||||
// Special Ranking Request.
|
|
||||||
virtual bool requestRanking(uint32_t &token, std::string groupId) = 0;
|
|
||||||
virtual bool getRankedPost(const uint32_t &token, RsPostedPost &post) = 0;
|
|
||||||
|
|
||||||
virtual bool extractPostedCache(const std::string &str, uint32_t &votes, uint32_t &comments) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Control Ranking Calculations.
|
|
||||||
virtual bool setViewMode(uint32_t mode) = 0;
|
|
||||||
virtual bool setViewPeriod(uint32_t period) = 0;
|
|
||||||
virtual bool setViewRange(uint32_t first, uint32_t count) = 0;
|
|
||||||
|
|
||||||
// exposed for testing...
|
|
||||||
virtual float calcPostScore(const RsMsgMetaData &meta) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user