From 6e4819bad129ea7f3139d5df28fa2953f9aecd76 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 25 Nov 2019 08:26:05 -0800 Subject: [PATCH] msroots: Match original C logic for MSROOTS tag matching --- src/msroots.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msroots.rs b/src/msroots.rs index ac427b3..868f3ad 100644 --- a/src/msroots.rs +++ b/src/msroots.rs @@ -79,7 +79,8 @@ impl MsRoots { ptr = ptr.add(1); } - if tag != TAG_MSROOTS_MID && (tag != TAG_MSROOTS_END || object_id == YKPIV_OBJ_MSROOTS5) + if ((TAG_MSROOTS_MID != tag) && (TAG_MSROOTS_END != tag)) + || ((YKPIV_OBJ_MSROOTS5 == object_id) && (TAG_MSROOTS_END != tag)) { // the current object doesn't contain a valid part of a msroots file