mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-15 18:09:32 -04:00
further log cleanings
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2239 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f14f4f58d7
commit
6f1e4623ab
11 changed files with 38 additions and 15 deletions
|
@ -135,7 +135,9 @@ bool ftFileProvider::getFileData(uint64_t offset, uint32_t &chunk_size, void *da
|
||||||
|
|
||||||
if (1 != fread(data, data_size, 1, fd))
|
if (1 != fread(data, data_size, 1, fd))
|
||||||
{
|
{
|
||||||
std::cerr << "ftFileProvider::getFileData() Failed to get data. Data_size=" << data_size << ", base_loc=" << base_loc << " !";
|
#ifdef DEBUG_FT_FILE_PROVIDER
|
||||||
|
std::cerr << "ftFileProvider::getFileData() Failed to get data. Data_size=" << data_size << ", base_loc=" << base_loc << " !" << std::endl;
|
||||||
|
#endif
|
||||||
//free(data); No!! It's already freed upwards in ftDataMultiplex::locked_handleServerRequest()
|
//free(data); No!! It's already freed upwards in ftDataMultiplex::locked_handleServerRequest()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -731,7 +731,7 @@ bool AuthGPG::VerifySignature_locked(const void *data, int datalen, const void *
|
||||||
|
|
||||||
if(siglen==73)
|
if(siglen==73)
|
||||||
{
|
{
|
||||||
std::cerr << "Reducing to 72 to overcome an old bug." << std::endl ;
|
//std::cerr << "Reducing to 72 to overcome an old bug." << std::endl ;
|
||||||
siglen=72 ;
|
siglen=72 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,7 +1114,7 @@ std::string AuthGPG::SaveCertificateToString(std::string id)
|
||||||
gpgme_data_write (gpgmeData, "", 1); // to be able to convert it into a string
|
gpgme_data_write (gpgmeData, "", 1); // to be able to convert it into a string
|
||||||
|
|
||||||
fflush (NULL);
|
fflush (NULL);
|
||||||
showData (gpgmeData);
|
//showData (gpgmeData);
|
||||||
|
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char *export_txt = gpgme_data_release_and_get_mem(gpgmeData, &len);
|
char *export_txt = gpgme_data_release_and_get_mem(gpgmeData, &len);
|
||||||
|
|
|
@ -2167,7 +2167,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
X509_NAME_oneline(X509_get_issuer_name(X509_STORE_CTX_get_current_cert(ctx)), buf, 256);
|
X509_NAME_oneline(X509_get_issuer_name(X509_STORE_CTX_get_current_cert(ctx)), buf, 256);
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
printf("issuer= %s\n", buf);
|
printf("issuer= %s\n", buf);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef AUTHSSL_DEBUG
|
#ifdef AUTHSSL_DEBUG
|
||||||
fprintf(stderr, "Doing REAL PGP Certificates\n");
|
fprintf(stderr, "Doing REAL PGP Certificates\n");
|
||||||
|
@ -2175,24 +2177,30 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||||
/* do the REAL Authentication */
|
/* do the REAL Authentication */
|
||||||
if (!AuthX509(X509_STORE_CTX_get_current_cert(ctx)))
|
if (!AuthX509(X509_STORE_CTX_get_current_cert(ctx)))
|
||||||
{
|
{
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback() X509 not authenticated.\n");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback() X509 not authenticated.\n");
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::string pgpid = getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer);
|
std::string pgpid = getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer);
|
||||||
if (!AuthGPG::getAuthGPG()->isGPGAccepted(pgpid) && pgpid != AuthGPG::getAuthGPG()->getGPGOwnId())
|
if (!AuthGPG::getAuthGPG()->isGPGAccepted(pgpid) && pgpid != AuthGPG::getAuthGPG()->getGPGOwnId())
|
||||||
{
|
{
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback() pgp key not signed by ourself : \n");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback() pgp key not signed by ourself : \n");
|
||||||
fprintf(stderr, "issuer pgpid : ");
|
fprintf(stderr, "issuer pgpid : ");
|
||||||
fprintf(stderr, "%s\n",pgpid.c_str());
|
fprintf(stderr, "%s\n",pgpid.c_str());
|
||||||
fprintf(stderr, "\n AuthGPG::getAuthGPG()->getGPGOwnId() : ");
|
fprintf(stderr, "\n AuthGPG::getAuthGPG()->getGPGOwnId() : ");
|
||||||
fprintf(stderr, "%s\n",AuthGPG::getAuthGPG()->getGPGOwnId().c_str());
|
fprintf(stderr, "%s\n",AuthGPG::getAuthGPG()->getGPGOwnId().c_str());
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
preverify_ok = true;
|
preverify_ok = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
fprintf(stderr, "Failing Normal Certificate!!!\n");
|
fprintf(stderr, "Failing Normal Certificate!!!\n");
|
||||||
|
#endif
|
||||||
preverify_ok = false;
|
preverify_ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2214,7 +2222,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||||
char *peer_id_in_context = (char*) SSL_get_ex_data(ssl, AuthSSL::ex_data_ctx_index);
|
char *peer_id_in_context = (char*) SSL_get_ex_data(ssl, AuthSSL::ex_data_ctx_index);
|
||||||
if (std::string(certId.c_str()) != std::string(peer_id_in_context)) {
|
if (std::string(certId.c_str()) != std::string(peer_id_in_context)) {
|
||||||
//the connection was asked for a given peer and get connected top another peer
|
//the connection was asked for a given peer and get connected top another peer
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context not the same as cert, aborting connection.");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context not the same as cert, aborting connection.");
|
||||||
|
#endif
|
||||||
preverify_ok = false;
|
preverify_ok = false;
|
||||||
|
|
||||||
//tranfer the ip address to the new peer
|
//tranfer the ip address to the new peer
|
||||||
|
@ -2224,7 +2234,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||||
mConnMgr->setAddressList(certId, detail.getIpAddressList());
|
mConnMgr->setAddressList(certId, detail.getIpAddressList());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context is the same as cert, continung connection.");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback peer id in context is the same as cert, continung connection.");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2238,7 +2250,9 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||||
peerConnectState detail;
|
peerConnectState detail;
|
||||||
if (mConnMgr->getFriendNetStatus(certId, detail)) {
|
if (mConnMgr->getFriendNetStatus(certId, detail)) {
|
||||||
if (detail.state & RS_PEER_CONNECTED && !(detail.connecttype & RS_NET_CONN_TUNNEL)) {
|
if (detail.state & RS_PEER_CONNECTED && !(detail.connecttype & RS_NET_CONN_TUNNEL)) {
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback this peer is already connected, refuse a new connection.");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback this peer is already connected, refuse a new connection.");
|
||||||
|
#endif
|
||||||
preverify_ok = false;
|
preverify_ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2246,11 +2260,14 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AUTHSSL_DEBUG
|
||||||
if (preverify_ok) {
|
if (preverify_ok) {
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback returned true.\n");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback returned true.\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "AuthSSL::VerifyX509Callback returned false.\n");
|
fprintf(stderr, "AuthSSL::VerifyX509Callback returned false.\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return preverify_ok;
|
return preverify_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,7 @@ int pqiperson::notifyEvent(NetInterface *ni, int newState)
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, out.str());
|
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, out.str());
|
||||||
it->second->reset();
|
it->second->reset();
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Active pqi : not resetting." << std::endl;
|
//std::cerr << "Active pqi : not resetting." << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -349,8 +349,8 @@ int pqistore::readPkt(RsItem **item_out)
|
||||||
}
|
}
|
||||||
|
|
||||||
// create packet, based on header.
|
// create packet, based on header.
|
||||||
std::cerr << "Read Data Block -> Incoming Pkt(";
|
//std::cerr << "Read Data Block -> Incoming Pkt(";
|
||||||
std::cerr << blen + extralen << ")" << std::endl;
|
//std::cerr << blen + extralen << ")" << std::endl;
|
||||||
uint32_t readbytes = extralen + blen;
|
uint32_t readbytes = extralen + blen;
|
||||||
|
|
||||||
RsItem *item = rsSerialiser->deserialise(block, &readbytes);
|
RsItem *item = rsSerialiser->deserialise(block, &readbytes);
|
||||||
|
|
|
@ -488,10 +488,8 @@ bool p3Peers::getGPGSignedList(std::list<std::string> &ids)
|
||||||
bool p3Peers::getGPGAcceptedList(std::list<std::string> &ids)
|
bool p3Peers::getGPGAcceptedList(std::list<std::string> &ids)
|
||||||
{
|
{
|
||||||
#ifdef P3PEERS_DEBUG
|
#ifdef P3PEERS_DEBUG
|
||||||
std::cerr << "p3Peers::getPGPOthersList()" << std::endl;
|
std::cerr << "p3Peers::getGPGAcceptedList()" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//TODO implement an additional list of GPG keys that are accepted even if not signed
|
|
||||||
AuthGPG::getAuthGPG()->getGPGAcceptedList(ids);
|
AuthGPG::getAuthGPG()->getGPGAcceptedList(ids);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -511,7 +509,7 @@ bool p3Peers::getSSLChildListOfGPGId(std::string gpg_id, std::list<std::string>
|
||||||
peerConnectState pcs;
|
peerConnectState pcs;
|
||||||
for (std::list<std::string>::iterator it = friendsIds.begin(); it != friendsIds.end(); it++) {
|
for (std::list<std::string>::iterator it = friendsIds.begin(); it != friendsIds.end(); it++) {
|
||||||
#ifdef P3PEERS_DEBUG
|
#ifdef P3PEERS_DEBUG
|
||||||
std::cerr << "p3Peers::getSSLChildListOfGPGId() iterating over friends id : " << gpg_id << std::endl;
|
std::cerr << "p3Peers::getSSLChildListOfGPGId() iterating over friends id : " << *it << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (mConnMgr->getFriendNetStatus(*it, pcs) && pcs.gpg_id == gpg_id) {
|
if (mConnMgr->getFriendNetStatus(*it, pcs) && pcs.gpg_id == gpg_id) {
|
||||||
#ifdef P3PEERS_DEBUG
|
#ifdef P3PEERS_DEBUG
|
||||||
|
@ -896,7 +894,9 @@ bool p3Peers::loadDetailsFromStringCert(std::string certstr, RsPeerDetails &pd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef P3PEERS_DEBUG
|
||||||
std::cerr << "Parsing cert for sslid, location, ext and local address details. : " << certstr << std::endl;
|
std::cerr << "Parsing cert for sslid, location, ext and local address details. : " << certstr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
//let's parse the ssl id
|
//let's parse the ssl id
|
||||||
parsePosition = certstr.find(CERT_SSL_ID);
|
parsePosition = certstr.find(CERT_SSL_ID);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "serialiser/rsbaseserial.h"
|
#include "serialiser/rsbaseserial.h"
|
||||||
#include "serialiser/rstlvbase.h"
|
#include "serialiser/rstlvbase.h"
|
||||||
|
|
||||||
#define RSSERIAL_DEBUG 1
|
//#define RSSERIAL_DEBUG 1
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
|
@ -632,7 +632,9 @@ bool CUPnPService::Execute(
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#ifdef UPNP_DEBUG
|
||||||
std::cerr << ActionName << "(";
|
std::cerr << ActionName << "(";
|
||||||
|
#endif
|
||||||
bool firstTime = true;
|
bool firstTime = true;
|
||||||
// Check for correct Argument/Value pairs
|
// Check for correct Argument/Value pairs
|
||||||
const CUPnPAction &action = *(itAction->second);
|
const CUPnPAction &action = *(itAction->second);
|
||||||
|
|
|
@ -300,7 +300,6 @@ void MessengerWindow::insertPeers()
|
||||||
|
|
||||||
//add the gpg friends
|
//add the gpg friends
|
||||||
for(it = gpgFriends.begin(); it != gpgFriends.end(); it++) {
|
for(it = gpgFriends.begin(); it != gpgFriends.end(); it++) {
|
||||||
std::cerr << "" << *it << std::endl;
|
|
||||||
// if (*it == rsPeers->getGPGOwnId()) {
|
// if (*it == rsPeers->getGPGOwnId()) {
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -326,6 +326,9 @@ void PeersDialog::updateDisplay()
|
||||||
/* get the list of peers from the RsIface. */
|
/* get the list of peers from the RsIface. */
|
||||||
void PeersDialog::insertPeers()
|
void PeersDialog::insertPeers()
|
||||||
{
|
{
|
||||||
|
#ifdef PEERS_DEBUG
|
||||||
|
std::cerr << "PeersDialog::insertPeers() called." << std::endl;
|
||||||
|
#endif
|
||||||
std::list<std::string> gpgFriends;
|
std::list<std::string> gpgFriends;
|
||||||
std::list<std::string>::iterator it;
|
std::list<std::string>::iterator it;
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ void NotifyQt::UpdateGUI()
|
||||||
|
|
||||||
/* id the name */
|
/* id the name */
|
||||||
std::string name = rsPeers->getPeerName(id);
|
std::string name = rsPeers->getPeerName(id);
|
||||||
std::cerr << "NotifyQT got message for peer id : " << id << "; name : " << name << std::endl;
|
//std::cerr << "NotifyQT got message for peer id : " << id << "; name : " << name << std::endl;
|
||||||
std::string realmsg = "<strong>" + name + "</strong>";
|
std::string realmsg = "<strong>" + name + "</strong>";
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue