Skip to content

Commit 18e16b3

Browse files
Add backward version support on the server side
The server now also supports clients using the previous communication protocol 4:4 in addition to 4:5. Protocol 4:5 was introduced with pcsc-lite 2.3.0 in Aug 2024. Protocol 4:4 was introduced with pcsc-lite 1.8.24 in Oct 2018. Protocol 4:5 adds the command CMD_GET_READER_EVENTS. This command will not be used by older clients. They will just work as if the server was also using protocol version 4:4.
1 parent c4dbe7b commit 18e16b3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/winscard_msg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5252
#define PROTOCOL_VERSION_MINOR 5
5353
/** Minor version the client also supports */
5454
#define PROTOCOL_VERSION_MINOR_CLIENT_BACKWARD 4
55+
/** Minor version the server also supports */
56+
#define PROTOCOL_VERSION_MINOR_SERVER_BACKWARD 4
5557

5658
/**
5759
* @brief Information transmitted in \ref CMD_VERSION Messages.

src/winscard_svc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,11 @@ static void * ContextThread(LPVOID newContext)
407407
veStr.major, veStr.minor);
408408
Log3(PCSC_LOG_ERROR, "Server protocol is %d:%d",
409409
PROTOCOL_VERSION_MAJOR, PROTOCOL_VERSION_MINOR);
410-
veStr.rv = SCARD_E_SERVICE_STOPPED;
410+
411+
if (veStr.minor < PROTOCOL_VERSION_MINOR_SERVER_BACKWARD)
412+
veStr.rv = SCARD_E_SERVICE_STOPPED;
413+
else
414+
Log1(PCSC_LOG_INFO, "Enable backward compatibility");
411415
}
412416

413417
/* set the server protocol version */

0 commit comments

Comments
 (0)