From 743fa745b7abcd837358c2f9bd7616495699a24f Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 14 May 2019 14:42:10 -0400 Subject: [PATCH] show b33 address for encrypted LeaseSet2 --- daemon/HTTPServer.cpp | 6 ++++++ libi2pd/Blinding.h | 1 + libi2pd/Destination.h | 1 + 3 files changed, 8 insertions(+) diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp index 20c9f3aa..963fed71 100644 --- a/daemon/HTTPServer.cpp +++ b/daemon/HTTPServer.cpp @@ -354,6 +354,12 @@ namespace http { { s << "Base64:
\r\n
\r\n
\r\n"; + if (dest->IsEncryptedLeaseSet ()) + { + i2p::data::BlindedPublicKey blinded (dest->GetIdentity ()); + s << "B33: " << blinded.ToB33 () << ".32.bi2p
\r\n"; + } + if(dest->GetNumRemoteLeaseSets()) { s << "
\r\n\r\n

\r\n"; diff --git a/libi2pd/Blinding.h b/libi2pd/Blinding.h index 9cfa76d2..6c3671c6 100644 --- a/libi2pd/Blinding.h +++ b/libi2pd/Blinding.h @@ -3,6 +3,7 @@ #include #include +#include #include "Identity.h" namespace i2p diff --git a/libi2pd/Destination.h b/libi2pd/Destination.h index b55a7490..64dd0b58 100644 --- a/libi2pd/Destination.h +++ b/libi2pd/Destination.h @@ -181,6 +181,7 @@ namespace client // for HTTP only int GetNumRemoteLeaseSets () const { return m_RemoteLeaseSets.size (); }; const decltype(m_RemoteLeaseSets)& GetLeaseSets () const { return m_RemoteLeaseSets; }; + bool IsEncryptedLeaseSet () const { return m_LeaseSetType == i2p::data::NETDB_STORE_TYPE_ENCRYPTED_LEASESET2; }; }; class ClientDestination: public LeaseSetDestination