From f94d03465a25a04937b2d6a05da0fa3857cefcf3 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 3 Nov 2020 15:38:25 -0500 Subject: [PATCH] don't create transit tunnel if decyrption failed --- libi2pd/I2NPProtocol.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libi2pd/I2NPProtocol.cpp b/libi2pd/I2NPProtocol.cpp index 4dbb4e18..3cc254e6 100644 --- a/libi2pd/I2NPProtocol.cpp +++ b/libi2pd/I2NPProtocol.cpp @@ -361,8 +361,9 @@ namespace i2p { LogPrint (eLogDebug, "I2NP: Build request record ", i, " is ours"); BN_CTX * ctx = BN_CTX_new (); - i2p::context.DecryptTunnelBuildRecord (record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET, clearText, ctx); + bool success = i2p::context.DecryptTunnelBuildRecord (record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET, clearText, ctx); BN_CTX_free (ctx); + if(!success) return false; uint8_t retCode = 0; bool isECIES = i2p::context.IsECIES (); // replace record to reply