Schimmelreiter / oscam-smod

modern & emu based oscam, but in-line with the latest trunk too
GNU General Public License v3.0
23 stars 30 forks source link

PCSC isnt working #1

Closed mfu-mcosys closed 5 years ago

mfu-mcosys commented 6 years ago

tvh /tmp/oscam-smod # make pcsc .... CardRdrs : PHOENIX INTERNAL SC8IN1 MP35 SMARGO DB2COM STAPI STAPI5 STINGER DRECAS PCSC .... tvh /tmp/oscam-smod # Distribution/oscam-Schimmelreiter11397-x86_64-pc-linux-gnu-ssl-pcsc -V |grep -i pcsc Compiler: x86_64-pc-linux-gnu-ssl-pcsc cardreader_pcsc: no

with oscam-1.20-unstable_svn-r0 it is working

ghost commented 6 years ago

Hi I have a similar problem. For testing I've tried to compile oscam-smod with PCSC support like I always do with regular oscam but the final result gives me cardreader_pcsc: no

Like @mfu-mcosys said, PCSC is OK on default oscam, running on a openwrt router.

mike22437120 commented 6 years ago

error of the pcsc reader, cardreader_pcsc: no

root@ubunntu:~/Downloads/oscam-smod# make USE_PCSC=1 -j4 +------------------------------------------------------------------------------- | OSCam ver: Schimmelreiter rev: 11425 target: x86_64-linux-gnu-pcsc | Tools: | CROSS = | CC = gcc | Settings: | CONF_DIR = /usr/local/etc | CC_OPTS = -O2 -ggdb -pipe -ffunction-sections -fdata-sections | CC_WARN = -W -Wall -Wshadow -Wredundant-decls -Wstrict-prototypes -Wold-style-definition | CFLAGS = -fexpensive-optimizations -mmmx -msse -msse2 -msse3 -DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC | LDFLAGS = -Wl,--gc-sections -DWITH_PCSC=1 -I/usr/include/PCSC -I/usr/include/../local/include/PCSC | LIBS = -lpcsclite -lm -lpthread -ldl | UseFlags = USE_PCSC=1 | Config: | Addons : WEBIF WEBIF_LIVELOG WEBIF_JQUERY TOUCH HAVE_DVBAPI READ_SDT_CHARSETS IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CW_CYCLE_CHECK IPV6SUPPORT WITH_EMU | Protocols: CAMD35 CAMD35_TCP NEWCAMD CCCAM CCCSHARE GBOX RADEGAST SCAM SERIAL CONSTCW PANDORA GHTTP | Readers : NAGRA IRDETO CONAX CRYPTOWORKS SECA VIACCESS VIDEOGUARD DRE TONGFANG BULCRYPT GRIFFIN DGCRYPT | CardRdrs : PHOENIX INTERNAL SC8IN1 MP35 SMARGO DB2COM STAPI STINGER DRECAS PCSC | Compiler : gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 | Config : build/x86_64-linux-gnu-pcsc/config.mak | Binary : Distribution/oscam-Schimmelreiter11425-x86_64-linux-gnu-pcsc +------------------------------------------------------------------------------- CC cscrypt/bn_ctx.c CC cscrypt/bn_asm.c CC cscrypt/bn_add.c CC cscrypt/aes.c CC cscrypt/bn_div.c CC cscrypt/bn_exp.c CC cscrypt/bn_lib.c CC cscrypt/bn_mul.c CC cscrypt/bn_print.c CC cscrypt/bn_shift.c CC cscrypt/bn_sqr.c CC cscrypt/bn_word.c CC cscrypt/mem.c CC cscrypt/des.c CC cscrypt/mdc2.c CC cscrypt/i_cbc.c CC cscrypt/i_ecb.c CC cscrypt/i_skey.c CC cscrypt/md5.c CC cscrypt/rc6.c CC cscrypt/sha1.c CC cscrypt/sha256.c CC cscrypt/aescbc.c CC csctapi/atr.c CC csctapi/icc_async.c CC csctapi/io_serial.c CC csctapi/protocol_t0.c In file included from csctapi/icc_async.c:40:0: csctapi/cardlist.h:28:126: warning: overflow in implicit constant conversion [-Woverflow] vf_d02 = { "Vodafone D0x Ix2", 0, 12,"3B 9F 21 0E 49 52 44 45 54 4F 20 41 43 53 03 84 55 FF 80 6D", 59, 0x6660A9AE55A4847B, "", "\x8A\x54\x46\x88\x67\x15\x9C\x11\x88\xD1\x3A\xCE\x7D\xF3\x48\xFA\x08\xBD\xF8\xBE\x33\xF1\xB2\xF7\x2F\x74\xFB\xCD\x18\x4C\x82\x55\x19\xE5\x17\xE3\x49\x4A\x6D\xD8\xCF\x04\x66\x30\x45\x61\x11\xF9\x52\x97\x9D\xEC\xCF\xF5\x17\x6D\x89\x0A\xE9\x3F\x4E\x26\x77\x11", "", "" }, ^ In file included from csctapi/icc_async.c:40:0: csctapi/cardlist.h: In function ‘findatr’: csctapi/cardlist.h:139:3: warning: implicit declaration of function ‘parse_aes_keys’ [-Wimplicit-function-declaration] parse_aes_keys(reader, tntviav5.aeskeys); ^ CC csctapi/protocol_t1.c csctapi/icc_async.c: At top level: csctapi/icc_async.c:155:13: warning: ‘calculate_changerom_cmd’ defined but not used [-Wunused-function] static void calculate_changerom_cmd(struct s_reader reader, const ATR atr, uint8_t *cmd) ^ CC csctapi/ifd_db2com.c CC csctapi/ifd_mp35.c CC csctapi/ifd_pcsc.c CC csctapi/ifd_phoenix.c CC csctapi/ifd_drecas.c CC csctapi/ifd_sci.c CC csctapi/ifd_sc8in1.c CC csctapi/ifd_smargo.c CC csctapi/ifd_stinger.c CC module-anticasc.c CC minilzo/minilzo.c CC module-cacheex.c CC module-camd35-cacheex.c CC module-camd35.c CC module-cccam-cacheex.c CC module-cccshare.c CC module-cccam.c CC module-constcw.c CC module-emulator.c CC module-emulator-osemu.c CC ffdecsa/ffdecsa.c CC module-emulator-stream.c CC module-csp.c CC module-cw-cycle-check.c CC module-dvbapi-chancache.c CC module-dvbapi.c CC module-gbox-helper.c CC module-gbox-sms.c CC module-gbox-remm.c CC module-gbox-cards.c CC module-gbox.c CC module-ird-guess.c CC module-monitor.c CC module-newcamd.c CC module-newcamd-des.c CC module-pandora.c CC module-ghttp.c CC module-radegast.c CC module-scam.c CC module-serial.c CC module-stat.c CC module-webif-lib.c CC module-webif-tpl.c CC module-webif.c CC webif/pages.c CC reader-common.c CC reader-bulcrypt.c CC reader-conax.c CC reader-cryptoworks.c CC reader-dgcrypt.c CC reader-dre.c CC reader-dre-cas.c CC reader-dre-common.c CC reader-dre-st20.c CC reader-griffin.c CC reader-irdeto.c CC reader-nagra.c CC reader-seca.c CC reader-tongfang.c CC reader-viaccess.c CC reader-videoguard-common.c CC reader-videoguard1.c CC reader-videoguard12.c CC reader-videoguard2.c CC oscam-aes.c CC oscam-array.c CC oscam-hashtable.c CC oscam-cache.c CC oscam-chk.c CC oscam-client.c CC oscam-conf.c CC oscam-conf-chk.c CC oscam-conf-mk.c CC oscam-config-null.c oscam-config-null.c: In function ‘conf_file’: oscam-config-null.c:26:7: warning: declaration of ‘tmp_conf’ shadows a global declaration [-Wshadow] int tmp_conf; ^ In file included from oscam-config-null.c:6:0: oscam-config-null.h:6:5: note: shadowed declaration is here int tmp_conf; ^ oscam-config-null.c:39:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(fd,buffer,strlen(buffer)); ^ oscam-config-null.c:72:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(fd,buffer,strlen(buffer)); ^ oscam-config-null.c:88:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(fd,buffer,strlen(buffer)); ^ oscam-config-null.c:105:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(fd,buffer,strlen(buffer)); ^ CC oscam-config-account.c CC oscam-config-global.c CC oscam-config-reader.c CC oscam-config.c CC oscam-ecm.c CC oscam-emm.c CC oscam-emm-cache.c CC oscam-failban.c CC oscam-files.c CC oscam-garbage.c CC oscam-lock.c CC oscam-log.c CC oscam-log-reader.c CC oscam-net.c CC oscam-llist.c CC oscam-reader.c CC oscam-simples.c CC oscam-string.c CC oscam-time.c CC oscam-work.c CC oscam.c CONF build/x86_64-linux-gnu-pcsc/config.c LINK Distribution/oscam-Schimmelreiter11425-x86_64-linux-gnu-pcsc.debug STRIP Distribution/oscam-Schimmelreiter11425-x86_64-linux-gnu-pcsc

Schimmelreiter commented 6 years ago

I can reproduce the warnings, but not the final result ...


Version:        oscam-Schimmelreiter-r11425
Compiler:       x86_64-linux-gnu-pcsc
...
cardreader_pcsc:                         yes
cardreader_smartreader:                  no
cardreader_db2com:                       no
cardreader_stapi:                        no
cardreader_stapi5:                       no
cardreader_stinger:                      no```
mike22437120 commented 6 years ago

how to do this?

Schimmelreiter commented 6 years ago

I just entered the same as you did: make USE_PCSC=1 -j4

mike22437120 commented 6 years ago

OK one step by step 1 install the ubuntu 18.04 2 apt install ssh zlib1g-dev gawk gcc-multilibflex git-core gettext libudev-dev build-essential cmake subversion gcclibusb-dev libssl-dev opensc pcscd libccid dialog g++ libpcsclite-devlibusb-dev libusb-1.0-0-dev git -y 3 git oscam-smod 4 make USE_PCSC=1

anything else i should to do?

Schimmelreiter commented 6 years ago

Try this: sudo apt install -y libpcsclite-dev libpcsclite1

mike22437120 commented 6 years ago

error...... cardreader_mp35: yes cardreader_smargo: yes cardreader_pcsc: no cardreader_smartreader: yes cardreader_db2com: yes

Schimmelreiter commented 6 years ago

No clue then ... As shown above, it works for me.

root:~# dpkg --get-selections | grep pcsc libpcsclite-dev install libpcsclite1:amd64 install

mike22437120 commented 6 years ago

can you test it via ssh? send me your mail, i will send you the ip and username root@ubunntu:~/Downloads/oscam-smod/build# dpkg --get-selections | grep pcsc libpcsc-perl install libpcsclite-dev install libpcsclite1:amd64 install pcsc-tools install pcscd

Schimmelreiter commented 6 years ago

Well, I doubt it will make any difference if I enter the same as you. You simply seem to be missing some pre-requisites on your machine.

Note that the other two members of this discussion appear to be cross-compiling, which makes a huge difference (The libs/dev files have to exist in the cross compiler env then).

mike22437120 commented 6 years ago

the offical oscam is ok now, IP 110.180.102.55 8888 oscam nagra

Unix starttime: 1530374257 Starttime: 30.06.2018 23:57:37 Version: oscam-1.20-unstable_svn-r Compiler: x86_64-linux-gnu Box type: generic (generic) PID: 20068 TempDir: /tmp/.oscam ConfigDir: /usr/local/etc/ WebifPort: 8888

GBox tmp_dir: not defined using: /tmp/.oscam value read during start up, not refreshed if changed later in webif!

Web interface support: yes LiveLog support: yes jQuery support intern: yes Touch interface support: yes SSL support: no DVB API support: yes DVB API with AZBOX support: no DVB API with MCA support: no DVB API with COOLAPI support: no DVB API with COOLAPI2 support: no DVB API with STAPI support: no DVB API with STAPI5 support: no DVB API read-sdt charsets: yes Irdeto guessing: yes Anti-cascading support: yes Debug mode: yes Monitor: yes Loadbalancing support: yes Cache exchange support: yes CW Cycle Check support: yes LCD support: no LED support: no Clockfix with realtime clock: yes IPv6 support: no

camd 3.3x: no camd 3.5 UDP: yes camd 3.5 TCP: yes newcamd: yes CCcam: yes CCcam share: yes gbox: yes radegast: yes scam: yes serial: yes constant CW: yes Pandora: yes ghttp: yes

Reader support: yes

Nagra: yes Irdeto: yes Conax: yes Cryptoworks: yes Seca: yes Viaccess: yes NDS Videoguard: yes DRE Crypt: yes TONGFANG: yes Bulcrypt: yes Griffin: yes DGCrypt: yes

cardreader_phoenix: yes cardreader_drecas: yes cardreader_internal_azbox: no cardreader_internal_coolapi: no cardreader_internal_coolapi2: no cardreader_internal_sci: yes cardreader_sc8in1: yes cardreader_mp35: yes cardreader_smargo: yes cardreader_pcsc: yes cardreader_smartreader: yes cardreader_db2com: yes cardreader_stapi: no cardreader_stapi5: no cardreader_stinger: yes

mike22437120 commented 6 years ago

Unix starttime: 1530375815 Starttime: 01.07.2018 00:23:35 Version: oscam-Schimmelreiter-r11425 Compiler: x86_64-linux-gnu-pcsc

cardreader_mp35: yes cardreader_smargo: yes cardreader_pcsc: no cardreader_smartreader: no cardreader_db2com: yes cardreader_stapi: no

ghost commented 6 years ago

Note that the other two members of this discussion appear to be cross-compiling, which makes a huge difference (The libs/dev files have to exist in the cross compiler env then).

Yes, I am crosscompiling but libs/dev are in the right place, at least the regular oscam finds them and compiles OK with PCSC, LIBUSB and SSL support. No luck with oscam-smod, always no PCSC support.

mfu-mcosys commented 6 years ago

forget to post the solution... sed -i "s/\/\/#define CARDREADER_PCSC/#define CARDREADER_PCSC/g" config.h

:)

mike22437120 commented 6 years ago

@Schimmelreiter @mfu-mcosys add the code at the end of the config.h

ifdef WITH_PCSC

define CARDREADER_PCSC 1

endif

mike22437120 commented 6 years ago

why do you disable the pcsc reader?

ifdef WITH_PCSC

//#define CARDREADER_PCSC 1

endif

Schimmelreiter commented 6 years ago

Probably because the main target(s) for oscam-smod are the various oe-alliance images and PCSC support might have failed for all or single platforms supported by the oe-alliance.

It will require some test builds and maybe changes to the oscam-smod recipe on oe-a core before I can change this setting.

Schimmelreiter commented 5 years ago

This issue is now obsolete