From 1742a72fe0a8ec0a0ea33356753673542e6046a8 Mon Sep 17 00:00:00 2001
From: orignal <i2porignal@yandex.ru>
Date: Wed, 17 Sep 2014 20:43:47 -0400
Subject: [PATCH] use Tag<32> for SSU key

---
 RouterInfo.h | 4 ++--
 SSU.cpp      | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/RouterInfo.h b/RouterInfo.h
index 3ea77df0..3ac0f52d 100644
--- a/RouterInfo.h
+++ b/RouterInfo.h
@@ -61,7 +61,7 @@ namespace data
 			{
 				boost::asio::ip::address iHost;
 				int iPort;
-				uint8_t iKey[32];
+				Tag<32> iKey;
 				uint32_t iTag;
 			};
 
@@ -73,7 +73,7 @@ namespace data
 				uint64_t date;
 				uint8_t cost;
 				// SSU only
-				uint8_t key[32]; // intro key for SSU
+				Tag<32> key; // intro key for SSU
 				std::vector<Introducer> introducers;
 			};
 			
diff --git a/SSU.cpp b/SSU.cpp
index 77885e89..3c8d5247 100644
--- a/SSU.cpp
+++ b/SSU.cpp
@@ -271,7 +271,7 @@ namespace ssu
 		payload += 2;
 		*payload = 0; // challenge
 		payload++;	
-		memcpy (payload, address->key, 32);
+		memcpy (payload, (const uint8_t *)address->key, 32);
 		payload += 32;
 		CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator ();
 		*(uint32_t *)payload = htobe32 (rnd.GenerateWord32 ()); // nonce	
@@ -694,13 +694,13 @@ namespace ssu
 		{
 			// we are client
 			auto address = m_RemoteRouter->GetSSUAddress ();
-			return address ? address->key : nullptr;
+			return address ? (const uint8_t *)address->key : nullptr;
 		}
 		else
 		{
 			// we are server
 			auto address = i2p::context.GetRouterInfo ().GetSSUAddress ();
-			return address ? address->key : nullptr;
+			return address ? (const uint8_t *)address->key : nullptr;
 		}
 	}