TWIN inbound: validate HMAC and local_prefix before handoff
Add HMAC verification (msg.verify) and local_prefix equality check in Reflector::twinPendingFrameReceived, after the role check and before handing the connection off to TwinLink::acceptInboundConnection. HMAC is checked first (fail-fast, avoids leaking prefix info on bad secret). Expose secret() and localPrefix() as const accessors on TwinLink.
This commit is contained in:
1 parent
4b6346d4ab
commit
9b748d1bdc
2 files changed
+21
-1
No files matched your search
@@ -95,6 +95,8 @@ class TwinLink
|
||||
bool isActive(void) const;
|
||||
const std::string& partnerHost(void) const { return m_peer_host; }
|
||||
uint16_t partnerPort(void) const { return m_peer_port; }
|
||||
const std::string& secret(void) const { return m_secret; }
|
||||
const std::string& localPrefix(void) const { return m_local_prefix; }
|
||||
|
||||
private:
|
||||
using FramedTcpClient =
|
||||
|
||||
Reference in new issue
Block a user