From 4ab566bb23198a884bb09a5a7b1f1a718dc77640 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 18 Dec 2019 23:03:05 +0100 Subject: [PATCH] debian/patches: Add 0002_fix-channels-smartcard-fix-statusw-call.patch. Fix smartcard login failures. (Closes: #919281). --- ...-channels-smartcard-fix-statusw-call.patch | 46 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 47 insertions(+) create mode 100644 debian/patches/0002_fix-channels-smartcard-fix-statusw-call.patch diff --git a/debian/patches/0002_fix-channels-smartcard-fix-statusw-call.patch b/debian/patches/0002_fix-channels-smartcard-fix-statusw-call.patch new file mode 100644 index 0000000..f363730 --- /dev/null +++ b/debian/patches/0002_fix-channels-smartcard-fix-statusw-call.patch @@ -0,0 +1,46 @@ +From a311075202865d22b87ec2ea8d1e32fa11868012 Mon Sep 17 00:00:00 2001 +From: Bernhard Miklautz +Date: Wed, 10 Jul 2019 18:36:34 +0200 +Subject: [PATCH] fix [channels/smartcard]: fix StatusW_Call + +According to 2.2.2.18 Status_Call cbAtrLen is unused an must be ignored +upon receipt. +--- + channels/smartcard/client/smartcard_operations.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/channels/smartcard/client/smartcard_operations.c ++++ b/channels/smartcard/client/smartcard_operations.c +@@ -1204,15 +1204,19 @@ + Status_Call* call = operation->call; + DWORD cbAtrLen; + +- if (call->cbAtrLen > 32) +- call->cbAtrLen = 32; ++ /** ++ * [MS-RDPESC] ++ * According to 2.2.2.18 Status_Call cbAtrLen is unused an must be ignored upon receipt. ++ */ ++ cbAtrLen = call->cbAtrLen = 32; ++ ++ call->cchReaderLen; + + if (call->fmszReaderNamesIsNULL) + cchReaderLen = 0; + else + cchReaderLen = SCARD_AUTOALLOCATE; + +- cbAtrLen = call->cbAtrLen; + ZeroMemory(ret.pbAtr, 32); + status = ret.ReturnCode = SCardStatusW(operation->hCard, + call->fmszReaderNamesIsNULL ? NULL : (LPWSTR) &mszReaderNames, +@@ -1231,8 +1235,7 @@ + ret.cBytes = cchReaderLen; + #endif + +- if (call->cbAtrLen) +- ret.cbAtrLen = cbAtrLen; ++ ret.cbAtrLen = cbAtrLen; + } + + smartcard_trace_status_return(smartcard, &ret, TRUE); diff --git a/debian/patches/series b/debian/patches/series index 83bed9d..95f6b06 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 1001_spelling-fixes.patch 0001_CVE-2019-17177.patch +0002_fix-channels-smartcard-fix-statusw-call.patch