Skip to content

Commit

Permalink
Merge branch 'oscam-svn' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
oscam-emu committed Sep 28, 2020
2 parents 119cb36 + 226500f commit be8465d
Show file tree
Hide file tree
Showing 122 changed files with 6,508 additions and 871 deletions.
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ project (OSCam C)

#----------------------- minimum version of cmake to use ------------

# if you want to switch to 2.6 min, please look at the escaped definitions
# later in this file (the add_definitions in 2.6 don't need to be escaped),
# and remove the CMP0005 policy.
# the CMP0003 could also be removed for cmake 2.6
cmake_minimum_required (VERSION 2.4)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0005 OLD)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
cmake_minimum_required(VERSION 2.8.9)

cmake_policy(SET CMP0003 NEW)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()

#----------------------- detect system ------------------------------

Expand Down Expand Up @@ -198,7 +198,7 @@ elseif (OSCamOperatingSystem MATCHES "FriendlyARM")
endif (OSCamOperatingSystem MATCHES "Linux")

set (CS_CONFDIR ${DEFAULT_CS_CONFDIR} CACHE STRING "Default path for the config files")
add_definitions ("-DCS_CONFDIR=\\\"${CS_CONFDIR}\\\"")
add_definitions ("-DCS_CONFDIR=\"${CS_CONFDIR}\"")


#----------------------- subdirectories ------------------------------
Expand Down
1 change: 1 addition & 0 deletions Distribution/doc/html/oscam.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ <H2>OPTIONS</H2>
<BR>&nbsp;&nbsp;<B>1024</B>&nbsp;=&nbsp;client&nbsp;ECM&nbsp;logging
<BR>&nbsp;&nbsp;<B>2048</B>&nbsp;=&nbsp;CSP&nbsp;logging
<BR>&nbsp;&nbsp;<B>4096</B>&nbsp;=&nbsp;CWC&nbsp;logging
<BR>&nbsp;&nbsp;<B>8192</B>&nbsp;=&nbsp;CW&nbsp;Cache&nbsp;logging
<BR>&nbsp;<B>65535</B>&nbsp;=&nbsp;debug&nbsp;all
</DL>

Expand Down
20 changes: 10 additions & 10 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License
=======

OSCam: Open Source CAM
Copyright (C) 2009-2015 OSCam developers
Copyright (C) 2009-2020 OSCam developers

OSCam is based on the Streamboard mp-cardserver 0.9d by dukat and
has been extended and worked on by many more since then.
Expand All @@ -32,21 +32,21 @@ Version history
===============

OSCam history is accessible through Trac timeline at:
http://www.streamboard.tv/oscam/timeline/
https://trac.streamboard.tv/oscam/timeline


Repositories
============

SVN repository:
svn checkout http://www.streamboard.tv/svn/oscam/trunk oscam-svn
svn checkout https://svn.streamboard.tv/oscam/trunk oscam-svn


Building OSCam from source
==========================

- Get the lastest sources from SVN
svn checkout http://www.streamboard.tv/svn/oscam/trunk oscam-trunk
svn checkout https://svn.streamboard.tv/oscam/trunk oscam-trunk

- Go to oscam-trunk directory.

Expand All @@ -64,7 +64,7 @@ Building OScam for different CPUs (cross-compilation)
First you need to install the target CPU toolchain. Already built toolchains
for various architectures can be downloaded from:

http://www.streamboard.tv/oscam/wiki/crosscompiling/
https://trac.streamboard.tv/oscam/wiki/crosscompiling

In order to cross compile OSCam you need to set CROSS variable when
running make. For example to compile for SH4 architecture you need
Expand All @@ -90,11 +90,11 @@ OSCam supports building with the following external dependencies:

For STAPI support you need to download liboscam_stapi.a library and place
it in stapi directory under oscam/ root dir. liboscam_stapi.a can be downloaded
from: http://www.streamboard.tv/wbb2/thread.php?threadid=28854
from: https://board.streamboard.tv

For STAPI5 support you need to download liboscam_stapi5.a library and place
it in stapi directory under oscam/ root dir. liboscam_stapi5.a can be downloaded
from: http://www.streamboard.tv/wbb2/thread.php?postid=541107#post541107
from: https://board.streamboard.tv

For more information and examples on using the build system, run `make help`.

Expand All @@ -105,11 +105,11 @@ Help and Support
man pages and configuration examples are in Distribution/doc directory.

You may visit our Trac system for tracking and filling bug reports.
http://www.streamboard.tv/oscam/
https://trac.streamboard.tv/oscam/newticket

If you experience any problems with OSCam, feel free to post in our support
forum under (mainly German and English language) at:
http://www.streamboard.tv/wbb2/portal.php
https://board.streamboard.tv/forum/

Configuration wiki:
http://www.streamboard.tv/wiki/index.php/OSCam/
https://wiki.streamboard.tv/wiki/OSCam
4 changes: 2 additions & 2 deletions README.config
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Examples:
./config.sh -D card_readers -E CARDREADER_INTERNAL

Available options:
addons: WEBIF WEBIF_LIVELOG WEBIF_JQUERY TOUCH WITH_SSL HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT
addons: WEBIF WEBIF_LIVELOG WEBIF_JQUERY TOUCH WITH_SSL HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT
protocols: MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP
readers: READER_NAGRA READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT
readers: READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT
card_readers: CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STINGER

1 change: 1 addition & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define WITH_DEBUG 1
#define WITH_LB 1
//#define CS_CACHEEX 1
//#define CS_CACHEEX_AIO 1
//#define CW_CYCLE_CHECK 1
//#define LCDSUPPORT 1
//#define LEDSUPPORT 1
Expand Down
5 changes: 4 additions & 1 deletion config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

addons="WEBIF WEBIF_LIVELOG WEBIF_JQUERY TOUCH WITH_SSL HAVE_DVBAPI WITH_NEUTRINO READ_SDT_CHARSETS IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_EMU WITH_SOFTCAM"
addons="WEBIF WEBIF_LIVELOG WEBIF_JQUERY TOUCH WITH_SSL HAVE_DVBAPI WITH_NEUTRINO READ_SDT_CHARSETS IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_EMU WITH_SOFTCAM"
protocols="MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP"
readers="READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT"
card_readers="CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STAPI5 CARDREADER_STINGER CARDREADER_DRECAS"
Expand All @@ -20,6 +20,7 @@ CONFIG_WITH_DEBUG=y
CONFIG_MODULE_MONITOR=y
CONFIG_WITH_LB=y
# CONFIG_CS_CACHEEX=n
# CONFIG_CS_CACHEEX_AIO=n
# CONFIG_CW_CYCLE_CHECK=n
# CONFIG_LCDSUPPORT=n
# CONFIG_LEDSUPPORT=n
Expand Down Expand Up @@ -300,6 +301,7 @@ update_deps() {
disabled WEBIF && disable_opt WEBIF_JQUERY >/dev/null
enabled MODULE_CCCSHARE && enable_opt MODULE_CCCAM >/dev/null
enabled_any CARDREADER_DB2COM CARDREADER_MP35 CARDREADER_SC8IN1 CARDREADER_STINGER && enable_opt CARDREADER_PHOENIX >/dev/null
enabled CS_CACHEEX_AIO && enable_opt CS_CACHEEX >/dev/null
enabled WITH_EMU && enable_opt READER_VIACCESS >/dev/null
enabled WITH_EMU && enable_opt MODULE_NEWCAMD >/dev/null
disabled WITH_EMU && disable_opt WITH_SOFTCAM >/dev/null
Expand Down Expand Up @@ -465,6 +467,7 @@ menu_addons() {
MODULE_MONITOR "Monitor" $(check_test "MODULE_MONITOR") \
WITH_LB "Loadbalancing" $(check_test "WITH_LB") \
CS_CACHEEX "Cache exchange" $(check_test "CS_CACHEEX") \
CS_CACHEEX_AIO "Cache exchange aio (depend on Cache exchange)" $(check_test "CS_CACHEEX_AIO") \
CW_CYCLE_CHECK "CW Cycle Check" $(check_test "CW_CYCLE_CHECK") \
LCDSUPPORT "LCD support" $(check_test "LCDSUPPORT") \
LEDSUPPORT "LED support" $(check_test "LEDSUPPORT") \
Expand Down
2 changes: 1 addition & 1 deletion cscrypt/bn.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CSCRYPT_BN_H_

#if defined(WITH_SSL) || defined(WITH_LIBCRYPTO)
# include <openssl/bn.h>
#include <openssl/bn.h>
#else
/* crypto/bn/bn.h */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
Expand Down
2 changes: 0 additions & 2 deletions cscrypt/bn_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,10 @@ int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
ap = a->d;
bp = b->d;
rp = r->d;
carry = 0;

carry = bn_add_words(rp, ap, bp, min);
rp += min;
ap += min;
bp += min;
i = min;

if(carry)
Expand Down
4 changes: 1 addition & 3 deletions cscrypt/bn_exp.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
BN_CTX *ctx)
{
int i, j, bits, ret = 0, wstart, wend, window, wvalue, ts = 0;
int i, j = 0, bits, ret = 0, wstart = 0, wend = 0, window, wvalue = 0, ts = 0;
int start = 1;
BIGNUM *d;
BIGNUM val[TABLE_SIZE];
Expand Down Expand Up @@ -207,9 +207,7 @@ int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
start = 1; /* This is used to avoid multiplication etc
* when there is only the value '1' in the
* buffer. */
wvalue = 0; /* The 'value' of the window */
wstart = bits - 1; /* The top bit of the window */
wend = 0; /* The bottom bit of the window */

if(!BN_one(r)) { goto err; }

Expand Down
10 changes: 2 additions & 8 deletions cscrypt/bn_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,11 @@ void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
* l is the low words of the output.
* t needs to be n2*3
*/
void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
BN_ULONG *t)
void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2, BN_ULONG *t)
{
int i, n;
int c1, c2;
int neg, oneg, zero;
int neg = 0, oneg;
BN_ULONG ll, lc, *lp, *mp;

# ifdef BN_COUNT
Expand All @@ -439,7 +438,6 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
n = n2 / 2;

/* Calculate (al-ah)*(bh-bl) */
neg = zero = 0;
c1 = bn_cmp_words(&(a[0]), &(a[n]), n);
c2 = bn_cmp_words(&(b[n]), &(b[0]), n);
switch(c1 * 3 + c2)
Expand All @@ -449,7 +447,6 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
bn_sub_words(&(r[n]), &(b[0]), &(b[n]), n);
break;
case -3:
zero = 1;
break;
case -2:
bn_sub_words(&(r[0]), &(a[n]), &(a[0]), n);
Expand All @@ -459,15 +456,13 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
case -1:
case 0:
case 1:
zero = 1;
break;
case 2:
bn_sub_words(&(r[0]), &(a[0]), &(a[n]), n);
bn_sub_words(&(r[n]), &(b[0]), &(b[n]), n);
neg = 1;
break;
case 3:
zero = 1;
break;
case 4:
bn_sub_words(&(r[0]), &(a[0]), &(a[n]), n);
Expand Down Expand Up @@ -513,7 +508,6 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
else
{
bn_add_words(&(t[n2]), lp, &(t[0]), n);
neg = 0;
}

if(l != NULL)
Expand Down
5 changes: 2 additions & 3 deletions cscrypt/bn_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ char *BN_bn2dec(const BIGNUM *a)
}
else
{
i = 0;
while(!BN_is_zero(t))
{
*lp = BN_div_word(t, BN_DEC_CONV);
Expand Down Expand Up @@ -160,7 +159,8 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
{
BIGNUM *ret = NULL;
BN_ULONG l = 0;
int neg = 0, h, m, i, j, k, c;
int neg = 0, h, i, j, k, c;
int m = 0;
int num;

if((a == NULL) || (*a == '\0')) { return (0); }
Expand Down Expand Up @@ -192,7 +192,6 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
if(bn_expand(ret, i * 4) == NULL) { goto err; }

j = i; /* least significant 'hex' */
m = 0;
h = 0;
while(j > 0)
{
Expand Down
3 changes: 1 addition & 2 deletions cscrypt/des.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ static uint32_t _lrotr(uint32_t i)

static void des_encrypt_int(uint32_t* data, const uint32_t* ks, int8_t do_encrypt)
{
uint32_t l,r,t,u;
uint32_t l=0,r=0,t=0,u=0;
int32_t i;

u=data[0];
Expand Down Expand Up @@ -708,7 +708,6 @@ static void des_encrypt_int(uint32_t* data, const uint32_t* ks, int8_t do_encryp

data[0]=l;
data[1]=r;
l=r=t=u=0;
}

void des(uint8_t* data, const uint32_t* schedule, int8_t do_encrypt)
Expand Down
5 changes: 2 additions & 3 deletions cscrypt/i_cbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int encrypt)
{
register unsigned long tin0, tin1;
register unsigned long tout0, tout1, xor0, xor1;
register unsigned long tin0=0, tin1=0;
register unsigned long tout0=0, tout1=0, xor0=0, xor1=0;
register long l = length;
unsigned long tin[2];

Expand Down Expand Up @@ -138,7 +138,6 @@ void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
l2n(xor0, iv);
l2n(xor1, iv);
}
tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
tin[0] = tin[1] = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions cscrypt/i_ecb.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const char *idea_options(void)
void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
IDEA_KEY_SCHEDULE *ks)
{
unsigned long l0, l1, d[2];
unsigned long l0 = 0, l1 = 0, d[2];

n2l(in, l0);
d[0] = l0;
Expand All @@ -85,5 +85,5 @@ void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
l2n(l0, out);
l1 = d[1];
l2n(l1, out);
l0 = l1 = d[0] = d[1] = 0;
d[0] = d[1] = 0;
}
7 changes: 4 additions & 3 deletions cscrypt/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "../globals.h"
#include "../oscam-string.h"

#include "md5.h"

Expand Down Expand Up @@ -306,7 +307,7 @@ char *__md5_crypt(const char *pw, const char *salt, char *passwd)
sp = salt;

/* If it starts with the magic string, then skip that */
__md5__magic_len = strlen(__md5__magic);
__md5__magic_len = cs_strlen(__md5__magic);
if(!strncmp(sp, __md5__magic, __md5__magic_len))
{ sp += __md5__magic_len; }

Expand All @@ -320,7 +321,7 @@ char *__md5_crypt(const char *pw, const char *salt, char *passwd)
MD5_Init(&ctx);

/* The password first, since that is what is most unknown */
pw_len = strlen(pw);
pw_len = cs_strlen(pw);
MD5_Update(&ctx, (const unsigned char *)pw, pw_len);

/* Then our magic string */
Expand Down Expand Up @@ -380,7 +381,7 @@ char *__md5_crypt(const char *pw, const char *salt, char *passwd)
MD5_Final(final, &ctx1);
}

p = passwd + strlen(passwd);
p = passwd + cs_strlen(passwd);

final[16] = final[5];
for(i = 0 ; i < 5 ; i++)
Expand Down
2 changes: 1 addition & 1 deletion cscrypt/md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define _CSCRYPT_MD5_H

#if defined(WITH_SSL) || defined(WITH_LIBCRYPTO)
# include <openssl/md5.h>
#include <openssl/md5.h>
#else
#define MD5_DIGEST_LENGTH 16

Expand Down

0 comments on commit be8465d

Please sign in to comment.