mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-22 14:15:08 -05:00
make peer detail gui work for the gpg and the ssl id
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2011 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
41600dc3cf
commit
dabe44356a
@ -456,6 +456,11 @@ bool AuthGPG::storeAllKeys_locked()
|
|||||||
|
|
||||||
/* store in map */
|
/* store in map */
|
||||||
mKeyList[nu.id] = nu;
|
mKeyList[nu.id] = nu;
|
||||||
|
|
||||||
|
//store own key
|
||||||
|
if (nu.id == mOwnGpgId) {
|
||||||
|
mOwnGpgCert = nu;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GPG_ERR_NO_ERROR != gpgme_op_keylist_end(CTX))
|
if (GPG_ERR_NO_ERROR != gpgme_op_keylist_end(CTX))
|
||||||
@ -913,6 +918,19 @@ bool AuthGPG::getPGPDetails(std::string id, RsPeerDetails &d)
|
|||||||
d.validLvl = it->second.validLvl;
|
d.validLvl = it->second.validLvl;
|
||||||
d.ownsign = it->second.ownsign;
|
d.ownsign = it->second.ownsign;
|
||||||
d.gpgSigners = it->second.signers;
|
d.gpgSigners = it->second.signers;
|
||||||
|
|
||||||
|
//did the peer signed me ?
|
||||||
|
d.hasSignedMe = false;
|
||||||
|
std::list<std::string>::iterator signersIt;
|
||||||
|
for(signersIt = mOwnGpgCert.signers.begin(); signersIt != mOwnGpgCert.signers.end() ; ++signersIt) {
|
||||||
|
if (*signersIt == d.id) {
|
||||||
|
d.hasSignedMe = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::cerr << "AuthGPG::getPGPDetails() get details for : " << id << std::endl;
|
std::cerr << "AuthGPG::getPGPDetails() get details for : " << id << std::endl;
|
||||||
std::cerr << "AuthGPG::getPGPDetails() Name : " << it->second.name << std::endl;
|
std::cerr << "AuthGPG::getPGPDetails() Name : " << it->second.name << std::endl;
|
||||||
return true;
|
return true;
|
||||||
|
@ -91,7 +91,8 @@ class RsPeerDetails
|
|||||||
uint32_t trustLvl;
|
uint32_t trustLvl;
|
||||||
uint32_t validLvl;
|
uint32_t validLvl;
|
||||||
|
|
||||||
bool ownsign; /* we have signed certificate */
|
bool ownsign; /* we have signed the remote peer GPG key */
|
||||||
|
bool hasSignedMe; /* the remote peer has signed my GPG key */
|
||||||
|
|
||||||
/* Network details (only valid if friend) */
|
/* Network details (only valid if friend) */
|
||||||
uint32_t state;
|
uint32_t state;
|
||||||
|
@ -301,7 +301,10 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* get from mAuthMgr (first) */
|
/* get from gpg (first), to fill in the sign and trust details */
|
||||||
|
this->getPGPDetails(AuthSSL::getAuthSSL()->getGPGId(id), d);
|
||||||
|
|
||||||
|
//get the ssl details
|
||||||
sslcert authDetail;
|
sslcert authDetail;
|
||||||
if (!AuthSSL::getAuthSSL()->getCertDetails(id, authDetail))
|
if (!AuthSSL::getAuthSSL()->getCertDetails(id, authDetail))
|
||||||
{
|
{
|
||||||
@ -310,17 +313,12 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
|
|||||||
|
|
||||||
d.fpr = authDetail.fpr;
|
d.fpr = authDetail.fpr;
|
||||||
d.id = authDetail.id;
|
d.id = authDetail.id;
|
||||||
d.name = authDetail.name;
|
//d.name = authDetail.name;
|
||||||
d.email = authDetail.email;
|
//d.email = authDetail.email;
|
||||||
d.location = authDetail.location;
|
d.location = authDetail.location;
|
||||||
d.org = authDetail.org;
|
d.org = authDetail.org;
|
||||||
d.gpgSigners = authDetail.signers;
|
|
||||||
|
|
||||||
d.issuer = authDetail.issuer;
|
d.issuer = authDetail.issuer;
|
||||||
|
|
||||||
d.ownsign = AuthGPG::getAuthGPG()->isPGPSigned(AuthSSL::getAuthSSL()->getGPGId(id));
|
|
||||||
|
|
||||||
|
|
||||||
/* generate */
|
/* generate */
|
||||||
d.authcode = "AUTHCODE";
|
d.authcode = "AUTHCODE";
|
||||||
|
|
||||||
|
@ -378,15 +378,7 @@ void NetworkDialog::insertConnect()
|
|||||||
item -> setText(1, QString::fromStdString(detail.name));
|
item -> setText(1, QString::fromStdString(detail.name));
|
||||||
|
|
||||||
/* (2) has me auth */
|
/* (2) has me auth */
|
||||||
bool hasSignedMe = false;
|
if (detail.hasSignedMe)
|
||||||
std::list<std::string>::iterator signersIt;
|
|
||||||
for(signersIt = ownGPGDetails.gpgSigners.begin(); signersIt != ownGPGDetails.gpgSigners.end() ; ++signersIt) {
|
|
||||||
if (*signersIt == detail.id) {
|
|
||||||
hasSignedMe = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hasSignedMe)
|
|
||||||
item -> setText(2, tr("Has authenticated me"));
|
item -> setText(2, tr("Has authenticated me"));
|
||||||
else
|
else
|
||||||
item -> setText(2, tr("Unknown"));
|
item -> setText(2, tr("Unknown"));
|
||||||
@ -413,7 +405,7 @@ void NetworkDialog::insertConnect()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (hasSignedMe)
|
if (detail.hasSignedMe)
|
||||||
{
|
{
|
||||||
backgrndcolor=Qt::magenta;
|
backgrndcolor=Qt::magenta;
|
||||||
item -> setIcon(0,(QIcon(IMAGE_TRUSTED)));
|
item -> setIcon(0,(QIcon(IMAGE_TRUSTED)));
|
||||||
|
@ -136,6 +136,17 @@ void ConfCertDialog::loadDialog()
|
|||||||
ui.ipAddressList->clear();
|
ui.ipAddressList->clear();
|
||||||
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
|
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
|
||||||
ui.ipAddressList->addItem(QString::fromStdString(*it));
|
ui.ipAddressList->addItem(QString::fromStdString(*it));
|
||||||
|
|
||||||
|
ui.orgloc->show();
|
||||||
|
ui.label_11->show();
|
||||||
|
ui.country->show();
|
||||||
|
ui.label_8->show();
|
||||||
|
ui.lastcontact->show();
|
||||||
|
ui.label_7->show();
|
||||||
|
ui.version->show();
|
||||||
|
ui.label_3->show();
|
||||||
|
|
||||||
|
ui.groupBox->show();
|
||||||
} else {
|
} else {
|
||||||
ui.orgloc->hide();
|
ui.orgloc->hide();
|
||||||
ui.label_11->hide();
|
ui.label_11->hide();
|
||||||
@ -170,18 +181,8 @@ void ConfCertDialog::loadDialog()
|
|||||||
ui.signed_already_label->hide();
|
ui.signed_already_label->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasSignedMe = false;
|
if (detail.hasSignedMe) {
|
||||||
RsPeerDetails ownGPGDetails ;
|
ui.is_signing_me->setText(tr("Peer has acepted me as a friend and did signed my GPG key"));
|
||||||
rsPeers->getPGPDetails(rsPeers->getPGPOwnId(), ownGPGDetails);
|
|
||||||
std::list<std::string>::iterator signersIt;
|
|
||||||
for(signersIt = ownGPGDetails.gpgSigners.begin(); signersIt != ownGPGDetails.gpgSigners.end() ; ++signersIt) {
|
|
||||||
if (*signersIt == detail.id) {
|
|
||||||
hasSignedMe = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hasSignedMe) {
|
|
||||||
ui.is_signing_me->setText(tr("Peer has acepted me as a friend and did not signed my GPG key"));
|
|
||||||
} else {
|
} else {
|
||||||
ui.is_signing_me->setText(tr("Peer has not acepted me as a friend and did not signed my GPG key"));
|
ui.is_signing_me->setText(tr("Peer has not acepted me as a friend and did not signed my GPG key"));
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="stabWidget">
|
<widget class="QTabWidget" name="stabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
@ -256,6 +256,12 @@
|
|||||||
<layout class="QVBoxLayout" name="_9">
|
<layout class="QVBoxLayout" name="_9">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Key signing settings</string>
|
<string>Key signing settings</string>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
Reference in New Issue
Block a user