From 97c406ae2c186f1795f57d641c2fbb16a547255e Mon Sep 17 00:00:00 2001 From: Doug Engert Date: Mon, 25 Nov 2024 09:58:06 -0600 Subject: [PATCH] minidriver.c - test if ContainerInfo dwVersion must be CONTAINER_INFO_CURRENT_VERSION On branch Minidriver-2 Changes to be committed: modified: minidriver.c --- src/minidriver/minidriver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/minidriver/minidriver.c b/src/minidriver/minidriver.c index ff9198a6af..107cf1ced0 100644 --- a/src/minidriver/minidriver.c +++ b/src/minidriver/minidriver.c @@ -3598,6 +3598,13 @@ DWORD WINAPI CardGetContainerInfo(__in PCARD_DATA pCardData, __in BYTE bContaine ret = SCARD_E_NO_KEY_CONTAINER; goto err; } + if (md_get_config_bool(pCardData, "md_container_version_must_match", FALSE) == TRUE) { + if (pContainerInfo->dwVersion != CONTAINER_INFO_CURRENT_VERSION) { + logprintf(pCardData, 7, "pContainerInfo->dwVersion not CONTAINER_INFO_CURRENT_VERSION\n"); + ret = SCARD_E_NO_KEY_CONTAINER; + goto err; + } + } if (pContainerInfo->dwVersion > CONTAINER_INFO_CURRENT_VERSION) { ret = ERROR_REVISION_MISMATCH; goto err;