From f2041c7865b832eb44e4385c148d062c5f7ab605 Mon Sep 17 00:00:00 2001 From: Jack Magne Date: Thu, 7 Jun 2018 17:32:27 -0700 Subject: [PATCH] Remove coolkey dependency and have esc work against opensc, port to master. --- esc | 2 + esc-1.1.1-fix1.patch | 8237 ++++++++++++++++++++++++++++++++++++++++++ esc-1.1.1-fix2.patch | 11 + esc.spec | 27 +- 4 files changed, 8270 insertions(+), 7 deletions(-) create mode 100644 esc-1.1.1-fix1.patch create mode 100644 esc-1.1.1-fix2.patch diff --git a/esc b/esc index 34b5c9a..cce19fc 100755 --- a/esc +++ b/esc @@ -44,6 +44,8 @@ COMPREG_DAT=compreg.dat LOCK_FILE=lock PARENT_LOCK_FILE=.parentlock +export OPENSC_CONF=$ESC_PATH/opensc.esc.conf + function isProgRunning { userID=$(whoami) diff --git a/esc-1.1.1-fix1.patch b/esc-1.1.1-fix1.patch new file mode 100644 index 0000000..02a330d --- /dev/null +++ b/esc-1.1.1-fix1.patch @@ -0,0 +1,8237 @@ +diff -up ./esc/opensc.esc.conf.fix1 ./esc/opensc.esc.conf +--- ./esc/opensc.esc.conf.fix1 2018-04-26 11:44:38.429986239 -0700 ++++ ./esc/opensc.esc.conf 2018-04-26 11:44:38.429986239 -0700 +@@ -0,0 +1,48 @@ ++app default { ++ enable_default_driver = true; ++ ++ card_atr ++ 3B:FF:14:00:FF:81:31:FE:45:80:25:A0:00:00:00:56:57:53:43:36:35:30:03:03:38 { ++ pkcs11_enable_InitToken = yes; ++ } ++ ++ card_atr ++ 3B:FF:14:00:FF:81:31:FE:45:80:25:A0:00:00:00:56:57:53:43:36:35:30:01:00:39 { ++ pkcs11_enable_InitToken = yes; ++ } ++ ++ card_atr ++ 3B:FF:14:00:FF:81:31:FE:45:80:25:A0:00:00:00:56:57:53:43:36:35:30:03:00:3B { ++ pkcs11_enable_InitToken = yes; ++ } ++ reader_driver ctapi { ++ } ++ reader_driver pcsc { ++ } ++ reader_driver openct { ++ }; ++ card_drivers = coolkey, cac, piv, default; ++ secure_messaging local_authentic { ++ module_path = /usr/lib64; ++ } ++ framework pkcs15 { ++ builtin_emulators = coolkey, cac, piv; ++ } ++} ++app opensc-pkcs11 { ++ pkcs11 { ++ } ++} ++app onepin-opensc-pkcs11 { ++ pkcs11 { ++ slots_per_card = 1; ++ } ++} ++app tokend { ++ framework tokend { ++ } ++} ++app cardmod { ++ reader_driver cardmod { ++ } ++} +diff -up ./esc/src/app/daemon/manifest.mn.fix1 ./esc/src/app/daemon/manifest.mn +--- ./esc/src/app/daemon/manifest.mn.fix1 2017-07-24 16:46:36.000000000 -0700 ++++ ./esc/src/app/daemon/manifest.mn 2018-04-26 14:55:48.926180480 -0700 +@@ -30,13 +30,13 @@ endif + + + +-DEFINES += -I$(SYS_INC)/nspr4 -I$(SYS_INC)/nss3 -I$(SYS_INC)/$(MOZ_OFFSET)/nspr -I$(SYS_INC)/$(MOZ_OFFSET)/nss ++DEFINES += -I$(SYS_INC)/nspr4 -I$(SYS_INC)/nss3 -I$(SYS_INC)/$(MOZ_OFFSET)/nspr -I$(SYS_INC)/$(MOZ_OFFSET)/nss -I$(SYS_INC)/PCSC -I$(CORE_DEPTH)/src/lib/coolkey + + DEFINES += $(shell pkg-config --cflags xft) + + CPPFLAGS += $(DEFINES) -g + +-LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib -L$(XULRUNNER_LIBS_LDFLAGS) -lnss3 -lnspr4 -lssl3 -lckyapplet $(shell pkg-config --libs xft) ++LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib -L$(XULRUNNER_LIBS_LDFLAGS) -lnss3 -lnspr4 -lssl3 $(shell pkg-config --libs xft) + LDFLAGS += -lckymanager -lhttpchunked -lm -lnss3 -lplc4 -lplds4 -lX11 + # MODULE public and private header directories are implicitly REQUIRED. + +diff -up ./esc/src/app/xpcom/Makefile.sdk.fix1 ./esc/src/app/xpcom/Makefile.sdk +--- ./esc/src/app/xpcom/Makefile.sdk.fix1 2017-07-24 16:46:36.000000000 -0700 ++++ ./esc/src/app/xpcom/Makefile.sdk 2018-04-26 11:44:38.430986233 -0700 +@@ -144,8 +144,8 @@ NSPR_INCLUDE = /usr/include/nspr4 + GECKO_INCLUDES = -I $(GECKO_SDK_PATH)/include -I $(GECKO_INCLUDE_PATH) -I $(NSPR_INCLUDE) -I $(NSS_INCLUDE) -I $(GECKO_INCLUDE_PATH)/xpcom + + +-COOL_INCLUDES = -I $(CORE_INC)/ckymanager -I $(CORE_INC)/httpchuncked +-COOL_LDFLAGS = -L$(CORE_DIST)/lib -lckymanager -lhttpchunked $(CKY_LIB_LDD) -lckyapplet ++COOL_INCLUDES = -I $(CORE_INC)/ckymanager -I $(CORE_INC)/httpchuncked -I /usr/include/PCSC -I $(CORE_DEPTH)/src/lib/coolkey ++COOL_LDFLAGS = -L$(CORE_DIST)/lib -lckymanager -lhttpchunked + + OBJECT = rhCoolKey.o + +@@ -258,6 +258,7 @@ $(DEPLOY_OBJDIR): + + cd $(CORE_DEPTH)/$(DEPLOY_OFFSET)/app/xul/esc; zip -r test.zip * -x *\CVS\* \*.fix*; unzip -d esc test.zip ; rm -f test.zip + $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/install_app.py $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/esc $(DEPLOY_OBJDIR)/esc --appName esc ++ $(NSINSTALL) $(CORE_DEPTH)/opensc.esc.conf $(DEPLOY_OBJDIR)/esc + + ifeq ($(OS_ARCH), Darwin) + mkdir $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_BASE) +diff -up ./esc/src/app/xul/esc/application.ini.fix1 ./esc/src/app/xul/esc/application.ini +--- ./esc/src/app/xul/esc/application.ini.fix1 2017-07-24 16:46:36.000000000 -0700 ++++ ./esc/src/app/xul/esc/application.ini 2018-04-26 11:44:38.431986227 -0700 +@@ -25,7 +25,7 @@ Vendor=RedHat + Name=ESC + ; + ; This field specifies your application's version. This field is optional. +-Version=1.1.0-24 ++Version=1.1.1-1 + ; + ; This field specifies your application's build ID (timestamp). This field is + ; required. +@@ -47,6 +47,6 @@ MinVersion=6.0.0 + ; application requires. It should be specified if your application uses + ; unfrozen interfaces. Specifying 1.8 matches all releases with a version + ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2). +-MaxVersion=50.0.0 ++MaxVersion=60.0.0 + + [Shell] +diff -up ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul.fix1 ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul +--- ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul.fix1 2017-07-24 16:46:36.000000000 -0700 ++++ ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul 2018-04-26 11:44:38.431986227 -0700 +@@ -33,7 +33,6 @@ + +