FreeBSD Bugzilla – Attachment 163130 Details for
Bug 204552
security/openct: Don't truncate received APDU when talking to pcsc-lite 1.8.14
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Bump PORTREVISION to 2
openct.patch (text/plain), 2.18 KB, created by
Marcin Cieślak
on 2015-11-15 00:34:20 UTC
(
hide
)
Description:
Bump PORTREVISION to 2
Filename:
MIME Type:
Creator:
Marcin Cieślak
Created:
2015-11-15 00:34:20 UTC
Size:
2.18 KB
patch
obsolete
>diff -ruN -x work openct.mod2/Makefile openct/Makefile >--- openct.mod2/Makefile 2015-11-15 01:25:03.000000000 +0100 >+++ openct/Makefile 2015-11-15 01:21:41.000000000 +0100 >@@ -3,7 +3,7 @@ > > PORTNAME= openct > PORTVERSION= 0.6.20 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= security > MASTER_SITES= SF/opensc/${PORTNAME} > >diff -ruN -x work openct.mod2/files/patch-src_pcsc_pcsc.c openct/files/patch-src_pcsc_pcsc.c >--- openct.mod2/files/patch-src_pcsc_pcsc.c 1970-01-01 01:00:00.000000000 +0100 >+++ openct/files/patch-src_pcsc_pcsc.c 2015-11-15 01:23:54.000000000 +0100 >@@ -0,0 +1,50 @@ >+--- src/pcsc/pcsc.c.orig 2007-05-25 21:11:45 UTC >++++ src/pcsc/pcsc.c >+@@ -25,6 +25,7 @@ >+ #ifdef DEBUG_IFDH >+ #include <syslog.h> >+ #endif >++#include <limits.h> >+ #ifdef __APPLE__ >+ #include <PCSC/wintypes.h> >+ #include <PCSC/pcsclite.h> >+@@ -390,6 +391,10 @@ IFDHTransmitToICC(DWORD Lun, SCARD_IO_HE >+ ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; >+ slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; >+ >++ if (TxLength > USHRT_MAX) { >++ (*RxLength) = 0; >++ return IFD_PROTOCOL_NOT_SUPPORTED; >++ } >+ #ifdef HAVE_PTHREAD >+ pthread_mutex_lock(&ifdh_context_mutex[ctn]); >+ #endif >+@@ -399,7 +404,7 @@ IFDHTransmitToICC(DWORD Lun, SCARD_IO_HE >+ #endif >+ dad = (UCHAR) ((slot == 0) ? 0x00 : slot + 1); >+ sad = 0x02; >+- lr = (unsigned short)(*RxLength); >++ lr = (*RxLength > USHRT_MAX) ? USHRT_MAX : (unsigned short)(*RxLength); >+ lc = (unsigned short)TxLength; >+ >+ ret = CT_data(ctn, &dad, &sad, lc, TxBuffer, &lr, RxBuffer); >+@@ -438,6 +443,10 @@ IFDHControl(DWORD Lun, PUCHAR TxBuffer, >+ ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; >+ slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; >+ >++ if (TxLength > USHRT_MAX) { >++ (*RxLength) = 0; >++ return IFD_PROTOCOL_NOT_SUPPORTED; >++ } >+ #ifdef HAVE_PTHREAD >+ pthread_mutex_lock(&ifdh_context_mutex[ctn]); >+ #endif >+@@ -447,7 +456,7 @@ IFDHControl(DWORD Lun, PUCHAR TxBuffer, >+ #endif >+ dad = 0x01; >+ sad = 0x02; >+- lr = (unsigned short)(*RxLength); >++ lr = (*RxLength > USHRT_MAX) ? USHRT_MAX : (unsigned short)(*RxLength); >+ lc = (unsigned short)TxLength; >+ >+ ret = CT_data(ctn, &dad, &sad, lc, TxBuffer, &lr, RxBuffer);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204552
: 163130