CI+ protocol implementation in minisatip

Support forum for minisatip
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: CI+ protocol implementation in minisatip

Post by cata »

Code: Select all

Each of the Local TSs is assigned a Local TS identifier (LTS_id) by the Host to identify it uniquely. The LTS_id
replaces the fixed value of 0x47 in the sync byte field of the TS packet header of every TS packet passed from the Host
to the CICAM. The Host shall set the sync byte field in the TS packet header to carry the LTS_id of each corresponding
TS packet sent to the CICAM. The value of LTS_id shall be unique for each Local TS and shall not change while the
Local TS is selected to be descrambled and while it is being sent over the TS interface. It is recommended that LTS_id
values assigned by the Host start from 0x47, i.e. the LTS_id of the first Local TS is set to 0x47, the LTS_id of the
second Local TS is set to 0x48, and so on.
Since the Local TS sync byte may deviate from the fixed standard value of 0x47, this recurring byte value shall not be
relied upon for the detection of the first byte of each TS packet. The MISTRT and MOSTRT control signals of the TS
Interface (see annex A of CENELEC EN 50221 [1]) perform this function and shall be used to determine the start of a
TS packet. 
As far as I know most likely only Digital Devices might be able to support this thru software. It needs also a CI CAM that can do the above.
But thanks for pointing this out as I am implementing the DDCI module.

Other than that, all other hardware I know of, connects tuner X to CI X directly, so you cannot actually route the stream from tuner Y to CI X as the connection is done in hardware.
borgel
Posts: 2
Joined: Thu Dec 28, 2017 3:51 pm

Re: CI+ protocol implementation in minisatip

Post by borgel »

Hi, the link has expired, can you put it up again? Or is it somewhere on github..?
Yuri
Posts: 68
Joined: Thu Oct 01, 2015 7:26 pm

Re: CI+ protocol implementation in minisatip

Post by Yuri »

Link updated
borgel
Posts: 2
Joined: Thu Dec 28, 2017 3:51 pm

Re: CI+ protocol implementation in minisatip

Post by borgel »

Thank you very much :)
sumulu
Posts: 4
Joined: Sun Feb 18, 2018 8:50 pm

Re: CI+ protocol implementation in minisatip

Post by sumulu »

Hi Yuri,

I got some errors. original version of "ca.c" works.

Code: Select all

root@raspberrypi:~/minisatip# make
make -C src
make[1]: Entering directory '/root/minisatip/src'
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c minisatip.c -o ../build/minisatip.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c socketworks.c -o ../build/socketworks.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c stream.c -o ../build/stream.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c adapter.c -o ../build/adapter.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c utils.c -o ../build/utils.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c dvbapi.c -o ../build/dvbapi.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c ca.c -o ../build/ca.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c pmt.c -o ../build/pmt.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c tables.c -o ../build/tables.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c satipc.c -o ../build/satipc.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -c dvb.c -o ../build/dvb.o
gcc -Wall -Wno-switch -ggdb -fPIC   -DDISABLE_DVBAES -DDISABLE_DVBCSA -DDISABLE_NETCVCLIENT -DDISABLE_DDCI  -o ../minisatip  ../build/minisatip.o  ../build/socketworks.o  ../build/stream.o  ../build/adapter.o  ../build/utils.o  ../build/dvbapi.o  ../build/ca.o  ../build/pmt.o  ../build/tables.o  ../build/satipc.o  ../build/dvb.o  -lpthread -lrt -ldvben50221 -ldvbapi -lucsi
../build/ca.o: In function `aes_xcbc_mac_init':
/root/minisatip/src/ca.c:541: undefined reference to `AES_set_encrypt_key'
/root/minisatip/src/ca.c:547: undefined reference to `AES_ecb_encrypt'
/root/minisatip/src/ca.c:551: undefined reference to `AES_set_encrypt_key'
../build/ca.o: In function `aes_xcbc_mac_process':
/root/minisatip/src/ca.c:565: undefined reference to `AES_ecb_encrypt'
../build/ca.o: In function `aes_xcbc_mac_done':
/root/minisatip/src/ca.c:593: undefined reference to `AES_ecb_encrypt'
../build/ca.o: In function `pkcs_1_mgf1':
/root/minisatip/src/ca.c:632: undefined reference to `SHA1'
../build/ca.o: In function `pkcs_1_pss_encode':
/root/minisatip/src/ca.c:685: undefined reference to `SHA1'
../build/ca.o: In function `dh_gen_exp':
/root/minisatip/src/ca.c:747: undefined reference to `DH_new'
/root/minisatip/src/ca.c:749: undefined reference to `BN_bin2bn'
/root/minisatip/src/ca.c:750: undefined reference to `BN_bin2bn'
/root/minisatip/src/ca.c:751: undefined reference to `DH_set0_pqg'
/root/minisatip/src/ca.c:752: undefined reference to `DH_set_flags'
/root/minisatip/src/ca.c:754: undefined reference to `DH_generate_key'
/root/minisatip/src/ca.c:756: undefined reference to `DH_get0_key'
/root/minisatip/src/ca.c:757: undefined reference to `BN_num_bits'
/root/minisatip/src/ca.c:766: undefined reference to `BN_bn2bin'
/root/minisatip/src/ca.c:768: undefined reference to `DH_free'
../build/ca.o: In function `dh_mod_exp':
/root/minisatip/src/ca.c:781: undefined reference to `BN_bin2bn'
/root/minisatip/src/ca.c:782: undefined reference to `BN_bin2bn'
/root/minisatip/src/ca.c:783: undefined reference to `BN_bin2bn'
/root/minisatip/src/ca.c:784: undefined reference to `BN_CTX_new'
/root/minisatip/src/ca.c:786: undefined reference to `BN_new'
/root/minisatip/src/ca.c:787: undefined reference to `BN_mod_exp'
/root/minisatip/src/ca.c:788: undefined reference to `BN_CTX_free'
/root/minisatip/src/ca.c:790: undefined reference to `BN_num_bits'
/root/minisatip/src/ca.c:799: undefined reference to `BN_bn2bin'
/root/minisatip/src/ca.c:801: undefined reference to `BN_free'
/root/minisatip/src/ca.c:802: undefined reference to `BN_free'
/root/minisatip/src/ca.c:803: undefined reference to `BN_free'
/root/minisatip/src/ca.c:804: undefined reference to `BN_free'
../build/ca.o: In function `dh_dhph_signature':
/root/minisatip/src/ca.c:835: undefined reference to `SHA1'
/root/minisatip/src/ca.c:843: undefined reference to `RSA_private_encrypt'
../build/ca.o: In function `element_set_certificate':
/root/minisatip/src/ca.c:1031: undefined reference to `i2d_X509'
../build/ca.o: In function `element_set_hostid_from_certificate':
/root/minisatip/src/ca.c:1050: undefined reference to `OBJ_txt2nid'
/root/minisatip/src/ca.c:1060: undefined reference to `X509_get_subject_name'
/root/minisatip/src/ca.c:1061: undefined reference to `X509_NAME_get_text_by_NID'
../build/ca.o: In function `generate_key_seed':
/root/minisatip/src/ca.c:1464: undefined reference to `SHA256_Init'
/root/minisatip/src/ca.c:1465: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1466: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1467: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1468: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1469: undefined reference to `SHA256_Final'
../build/ca.o: In function `generate_SAK_SEK':
/root/minisatip/src/ca.c:1489: undefined reference to `AES_set_encrypt_key'
/root/minisatip/src/ca.c:1492: undefined reference to `AES_ecb_encrypt'
../build/ca.o: In function `sac_crypt':
/root/minisatip/src/ca.c:1511: undefined reference to `AES_set_encrypt_key'
/root/minisatip/src/ca.c:1513: undefined reference to `AES_set_decrypt_key'
/root/minisatip/src/ca.c:1515: undefined reference to `AES_cbc_encrypt'
../build/ca.o: In function `verify_cb':
/root/minisatip/src/ca.c:1522: undefined reference to `X509_STORE_CTX_get_error'
/root/minisatip/src/ca.c:1533: undefined reference to `X509_STORE_CTX_get_error'
../build/ca.o: In function `rsa_privatekey_open':
/root/minisatip/src/ca.c:1550: undefined reference to `PEM_read_RSAPrivateKey'
../build/ca.o: In function `certificate_open':
/root/minisatip/src/ca.c:1573: undefined reference to `PEM_read_X509'
../build/ca.o: In function `certificate_validate':
/root/minisatip/src/ca.c:1589: undefined reference to `X509_STORE_CTX_new'
/root/minisatip/src/ca.c:1591: undefined reference to `X509_STORE_CTX_init'
/root/minisatip/src/ca.c:1592: undefined reference to `X509_STORE_CTX_set_verify_cb'
/root/minisatip/src/ca.c:1593: undefined reference to `X509_STORE_CTX_set_flags'
/root/minisatip/src/ca.c:1595: undefined reference to `X509_verify_cert'
/root/minisatip/src/ca.c:1599: undefined reference to `X509_STORE_CTX_get_error'
/root/minisatip/src/ca.c:1599: undefined reference to `X509_verify_cert_error_string'
/root/minisatip/src/ca.c:1602: undefined reference to `X509_STORE_CTX_free'
../build/ca.o: In function `certificate_load_and_check':
/root/minisatip/src/ca.c:1614: undefined reference to `X509_STORE_new'
/root/minisatip/src/ca.c:1621: undefined reference to `X509_STORE_load_locations'
/root/minisatip/src/ca.c:1640: undefined reference to `X509_free'
/root/minisatip/src/ca.c:1645: undefined reference to `X509_STORE_load_locations'
/root/minisatip/src/ca.c:1648: undefined reference to `X509_free'
../build/ca.o: In function `certificate_import_and_check':
/root/minisatip/src/ca.c:1659: undefined reference to `d2i_X509'
/root/minisatip/src/ca.c:1669: undefined reference to `X509_free'
/root/minisatip/src/ca.c:1673: undefined reference to `X509_STORE_add_cert'
../build/ca.o: In function `generate_akh':
/root/minisatip/src/ca.c:1761: undefined reference to `SHA256_Init'
/root/minisatip/src/ca.c:1762: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1763: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1764: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1765: undefined reference to `SHA256_Final'
../build/ca.o: In function `generate_uri_confirm':
/root/minisatip/src/ca.c:1896: undefined reference to `SHA256_Init'
/root/minisatip/src/ca.c:1897: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1898: undefined reference to `SHA256_Final'
/root/minisatip/src/ca.c:1901: undefined reference to `SHA256_Init'
/root/minisatip/src/ca.c:1902: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1903: undefined reference to `SHA256_Update'
/root/minisatip/src/ca.c:1904: undefined reference to `SHA256_Final'
../build/ca.o: In function `check_new_key':
/root/minisatip/src/ca.c:1936: undefined reference to `AES_set_encrypt_key'
/root/minisatip/src/ca.c:1938: undefined reference to `AES_ecb_encrypt'
../build/ca.o: In function `decrypt2':
/root/minisatip/src/ca.c:3351: undefined reference to `EVP_CIPHER_CTX_new'
/root/minisatip/src/ca.c:3359: undefined reference to `EVP_aes_128_cbc'
/root/minisatip/src/ca.c:3359: undefined reference to `EVP_DecryptInit_ex'
/root/minisatip/src/ca.c:3365: undefined reference to `EVP_DecryptUpdate'
/root/minisatip/src/ca.c:3370: undefined reference to `EVP_CIPHER_CTX_free'
collect2: error: ld returned 1 exit status
Makefile:134: recipe for target '../minisatip' failed
make[1]: *** [../minisatip] Error 1
make[1]: Leaving directory '/root/minisatip/src'
Makefile:6: recipe for target 'minisatip' failed
make: *** [minisatip] Error 2
I use the last version of Raspbian Stretch (2017-11-29)

What's wrong?
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: CI+ protocol implementation in minisatip

Post by cata »

You need libssl-dev and libcrypto
enigma13
Posts: 1
Joined: Mon Aug 27, 2018 4:42 pm

Re: CI+ protocol implementation in minisatip

Post by enigma13 »

Hi all,

I'm searching the file ca.c for ci+, all the links above are broken and google gives no result :(
If someone can send me the link via private message, would be great.

PS: I don't need the certificates, found it with google :)
sumulu
Posts: 4
Joined: Sun Feb 18, 2018 8:50 pm

Re: CI+ protocol implementation in minisatip

Post by sumulu »

Mirror-Link with certificates:
http://www.share-online.biz/dl/FIWT5KIPNY5B
Micha_123
Posts: 2
Joined: Wed Jan 23, 2019 9:34 am

Re: CI+ protocol implementation in minisatip

Post by Micha_123 »

it dont work with Sky CI+ module. (also channels where no pin is needet)

i replaced the ca.c putted the certs in the Right Folder

compiled without Errors, startet the minisatip and Nothing, Alphacrypt module works fine, but the SkyCI+ dont work, the will be no bin files created in the home Directory :(
Micha_123
Posts: 2
Joined: Wed Jan 23, 2019 9:34 am

Re: CI+ protocol implementation in minisatip

Post by Micha_123 »

now it works :D there file are created in the root home Directory :D


it will be fine to define SkyCI+ pin, there is also a Plugin for dreamboxes called autopin Maybe it helps to implement it
Post Reply