From bf91e16b5d7e0d922c96f95a519c8033ce790b65 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 15 Dec 2020 15:04:20 -0500 Subject: [PATCH] gererate specified number of tags if misssing tag --- libi2pd/Garlic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libi2pd/Garlic.cpp b/libi2pd/Garlic.cpp index 2d08f339..02ded2f4 100644 --- a/libi2pd/Garlic.cpp +++ b/libi2pd/Garlic.cpp @@ -548,7 +548,8 @@ namespace garlic // try to gererate more tags for last tagset if (m_LastTagset) { - for (int i = 0; i < ECIESX25519_MAX_NUM_GENERATED_TAGS; i++) + auto maxTags = std::max (m_NumRatchetInboundTags, ECIESX25519_MAX_NUM_GENERATED_TAGS); + for (int i = 0; i < maxTags; i++) { LogPrint (eLogDebug, "Garlic: Missing ECIES-X25519-AEAD-Ratchet tag was generated"); if (AddECIESx25519SessionNextTag (m_LastTagset) == tag)