Publishing details

Changelog

oscam (1.20-10797~r10569-utopic) utopic; urgency=medium

  * [r10569]

    copy emm to send in emm.html
    optimized loop


  * [r10568]

    [gbx] code restructuring
    	- Centralize converting gbx caprovid functions in helper module
    	- unify add card functions
    	- move ecm checksum to helper
    	- remove caid and provid from card (use caprovid only)
    	- rename provid_1 to caprovid




  * [r10567]

    boxtype info patch

    http://www.streamboard.tv/wbb2/thread.php?postid=536576#post536576




  * [r10566]

    Move csystem.active flag into struct s_reader.

    This is the only thing that is modified in `struct s_cardsystem`.

    Moving this flag into `struct s_reader` would allow us to start
    using pointer to card system ops, instead of copying the ops into
    every `struct s_reader`.


  * [r10565]

    Constify ->desc field in ops structures.

    desc is always initialized with static strings, so adding const
    communicates this correctly.


  * [r10564]

    Remove ->active field from struct s_module.

    It is only set in one place but it is never used anywhere.


  * [r10563]

    Fix regression introduced in r10557 (try 2).

    This reverts r10162 and should fix fixes regression introduced
    in r10557.

    r10562 was not the right fix. The right fix was to return the
    caid when the list is empty.

    This should fix ticket #4123 and #4142.


  * [r10562]

    Fix regression introduced in r10557.

    This fixes regression introduced in r10557. chk_caid() func was
    broken when I rewrote it and since it is pretty central to the whole
    filtering the results were not pretty.

    This should fix ticket #4123.


  * [r10561]

    smargo: Introduce is_smargo_reader() macro and use it where needed.

    This reduces direct manipulation of crdr.desc field.


  * [r10560]

    smargo: Remove smargo prefixes in log messages rdr_log() already adds them.


  * [r10559]

    Do not leak caidtab when freeing accounts.

    Fix leak introduced in r10557. Account's caidtab was not cleared.


  * [r10558]

    Replace cs_log() with rdr_log() where we have reader context.

    This is not a complete solution, I only changed the places where
    reader desc was already used in the logging message. There are
    a lot of places (in modules) where we have reader context but
    we're using cs_log(). If somebody wants to replace such cs_log()
    calls with rdr_log(), grep for D_READER in modules-*.c


  * [r10557]

    Convert caidtab to dynarray.

    Less code, smaller data structures, smaller binary size and added
    tests for the functionality.

    {{{
     Structures:
       struct s_caidtab | -176
       struct s_reader  | -168
       struct s_client  | -176
       struct s_auth    | -176
       struct s_config  | -520

     Binary:
      add/remove: 3/1 grow/shrink: 10/10 up/down: 577/-1679 (-1102)
    }}}

    caidtab is used by the following config settings:
     ACCOUNT: caid
      READER: caid
      GLOBAL: lb_noproviderforcaid
      GLOBAL: double_check_caid
      GLOBAL: cwcycle_check_caid

    Now each of theses can hold more than 32 values which was the old
    hard coded limit.


  * [r10556]

    [gbx] Minor change regarding pointer handling in reinit proxy.




  * [r10555]

    [gbx] Be even more pessimistic. Addition to 10554.




  * [r10554]

    [gbx] Protect against null pointer deref. Thx gfto.




  * [r10553]

    Convert caidvaluetab to dynarray.

    Less code, smaller data structures, smaller binary size and added
    tests for the functionality.

    {{{
     Structures:
       struct s_caidvaluetab |  -50
       struct s_auth         |  -56

     Binary size:
       add/remove: 3/0 grow/shrink: 4/5 up/down: 285/-872 (-587)
    }}}

    caidvaluetab is used by the following config settings:
      ACCOUNT: lb_nbest_percaid
       GLOBAL: lb_nbest_percaid
       GLOBAL: lb_retrylimits
       GLOBAL: cacheex_mode1_delay
       GLOBAL: fallbacktimeout_percaid

    Now each of theses can hold more than 16 values which was the old
    hard coded limit.


  * [r10552]

    Machine info

    Azbox fix should now cover premium and premium+


  * [r10551]

    Machine Info

    More solid for azbox


  * [r10550]

    Machine info

    Azbox premium


  * [r10549]

    [gbx] Another small addition for r10547.




  * [r10548]

    [gbx] Minor fix for r10547.




  * [r10547]

    [gbx] Move call to init_local_gbox as proposed here:
    http://www.streamboard.tv/wbb2/thread.php?postid=536529#post536529




  * [r10546]

    webif: Change return type of tpl_{addVar,addMsg,printf} to void.

    The return value of these functions was used in only one place (and
    it's usage was fishy). I'm changing the return type to void because
    nothing that these functions can return is currently useful.


  * [r10545]

    webif: Make tpl_addTmp() static and remove it from public headers.

    This function is used only in module-webif-tpl.c. It should not be public.


  * [r10544]

    Update copyright years.

    We have made changes in 2014 and 2015 (and we'll probably make even
    more changes in 2015). So update the years to correctly reflect that
    the code was changed.


  * [r10543]

    If oscam is not running on "generic" device, show the type and name in webif.


  * [r10542]

    Allow boxtype_is() to check for "generic" box type.

    Also return const declaration for box{type,name}_get() functions. const
    is needed because the string returned by these functions should not be
    changed. Using const makes the compiler work for us and warn if we try
    to change the result of box{type,name}_get().


  * [r10541]

    Free stb_boxname when oscam exists.


  * [r10540]

    webif: constify some parameters in template functions.

    This makes it clear that these parameters are not going to be changed.


  * [r10539]

    Machine Info

    Webif cosmetic


  * [r10538]

    Machine info

    Display Machine type into webif status page.
    If not known Machine is generic
    If boxname known Machine is boxname
    If boxtype known and not boxname Machine is boxtype


  * [r10537]

    Patch by ultra47:

    Final patch of configuriable showing of emm in emm.html?label=XXX

    Default set in Config part WebIf:
    httpemmuclean (unique emm) => showing and filtering to a size of 256kb, over them cleaning and backup
    httpemmsclean (shared)     => not showing
    httpemmgclean (global)     => not showing

    Settings for parameter "httpemmsclean, httpemmgclean, httpemmuclean"
    -1 => no showing
    0 => only show emm file
    >1 => show filtered and cleaning (if the size higher as settings) emm file


  * [r10536]

    Machine info

    Extra protection for not cleared parameters


  * [r10535]

    Machine info

    forgot one line


  * [r10534]

    Machine info

    extra fix


  * [r10533]

    Machine Info

    Correction about one name


  * [r10532]

    Machine info

    Added boxname where it's relevant (cosmetic)


  * [r10531]

    [gbx] Minor changes



  * [r10530]

    Machine info

    Print correct info by boxtype if boxtype present. Also the final used variable will have the boxtype.


  * [r10529]

    build: Add needed libraries when building pcsc under cygwin.

    This fixes ticket #4118. The patch is inspired by patch posted by
    routerunner in this ticket.


  * [r10528]

    [gbx] small internal change for calling some card functions




  * [r10527]

    - tryfix newcamd



  * [r10526]

    Reduce camd35/cccam cacheex code differences.

    No code changes just code movement.


  * [r10525]

    Reduce camd35/cccam cacheex code differences.

    This helps reduce the diff.


  * [r10524]

    Reduce camd35/cccam cacheex code differences.

    This helps reduce the diff.


  * [r10523]

    Reduce camd35/cccam cacheex code differences.

    We already have log prefixes, so remove the artificial text difference
    in logging messages.


  * [r10522]

    Reduce camd35/cccam cacheex code differences.

    Reduce the differences by using simple var.


  * [r10521]

    Reduce camd35/cccam cacheex code differences.

    No code changes just code movement.


  * [r10520]

    - Fix for broken VDR support introduced in r10519



  * [r10519]

    DVBApi:

    - On sleepsend stop decoding the channel!
    - Some rework to avoid receiver internal bufferoverflow



  * [r10518]

    move Spam to debug


  * [r10517]

    hide another Spam from init log


  * [r10516]

    [gbx] fix compiler warnings. Thx ni_hao. Fix #4116




  * [r10515]

    - Fix detection of changed host ip for Cs357 connections



  * [r10514]

    [gbx] small addition to r10513




  * [r10513]

    [gbx] Unify list of cards. Move all card specific functionality into separate files.
    Refer to http://www.streamboard.tv/wbb2/thread.php?threadid=43066




  * [r10512]

    don't Spam on nonexistent irrelevant files


  * [r10511]

    tests: Build tests binary by using standard build system machinery.

    This fixes the build under OS X and also allows the tests to cover
    all oscam functionality (once the tests are written of course).

    Note that the binary that build by `make tests` now would be called
    `tests.bin` (previously it was called `tests`). You can override
    that name using an undocumented TESTS_BIN `make` parameter, so
    `make tests TESTS_BIN=blah` would build the tests binary called
    `blah`.


  * [r10510]

    - Move reader emmcache usage detection in function and use it!



  * [r10509]

    New values for parameter 'emmcache'.


  * [r10508]

    - Add Atemio Nemesis to fixed readerspeed of 4.5 Mhz (due to usage of TDA8024)



  * [r10507]

    Sci

    extra fix


  * [r10506]

    Sci

    another small fix on autospeed


  * [r10505]

    Sci vu+

    Forgot the autospeed 1 this could still clock other speeds according to atr tables. For vu+ usseless and even could trigger bug for cards with higher max fs. The vu+ can only run at 4.5 Mhz.


  * [r10504]

    Rewrite ftab parsing and generation functions.

    This commit affects these settings:
     - account:  chid, ident
     - reader: chid, ident, fallback_percaid, localcards

    Makes the code smaller and easier to follow. bloatcheck reports
    binary size savings:
    {{{
     add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-1237 (-1237)
     function                                     old     new   delta
     mk_t_ftab                                    426     351     -75
     ftab_fn                                      446     201    -245
     chk_ftab                                    1524     607    -917
    }}}

    Also add tests for the parser and generator.


  * [r10503]

    tests: Small text change.


  * [r10502]

    Move functions for dynamic array manipulations in oscam-array.{c,h}


  * [r10501]

    tests: Check if clone functions work as expected.


  * [r10500]

    Rename array functions clear_XXX() to XXX_clear()

    This is preparation for unifying array functions.


  * [r10499]

    Rename clone_ftab() to ftab_clone()

    This is preparation for unifying array functions.


  * [r10498]

    Rename clone_ttab() to tuntab_clone().

    This is preparation for unifying array functions.


  * [r10497]

    Refactor code to reduce duplication.

    Introduce array_clone() and use it to prevent copy + paste code.


  * [r10496]

    Refactor code to reduce duplication.

    Introduce array_clear() and use it to prevent copy + paste code.


  * [r10495]

    Refactor code to reduce duplication.

    Introduce array_add() and use it to prevent copy + paste code.


  * [r10494]

    Rename ftab_add_filter() to ftab_add()

    This follows the style of the other TYPE_add() functions.


  * [r10493]

    Exit early if there is nothing to be done in the cfg settings generator.


  * [r10492]

    Rename some variables to make the code easier to understand.


  * [r10491]

    - tryfix dvbapi emm freezing



  * [r10490]

    vg: Clear entitlements before adding new ones.

    Patch by Mandos. This fixes ticket #4115.


  * [r10489]

    Rewrite tuntab (betatunnel) conf parsing and generation functions.

    Makes the code smaller and easier to follow. bloatcheck reports
    binary size savings:
    {{{
     add/remove: 1/0 grow/shrink: 0/2 up/down: 82/-489 (-407)
     function                                     old     new   delta
     tuntab_add                                     -      82     +82
     mk_t_tuntab                                  451     288    -163
     chk_tuntab                                   808     482    -326
    }}}

    Also add tests for 'betatunnel' parser/generator.


  * [r10488]

    - Small fix for dvbapi: only init emm filter values for firstrun on non-running channels



  * [r10487]

    - Fix for emmcache lastseen
    - Some recode for emm handling without emmcache / emmstat



  * [r10486]

    EMM:

    Reworked the emmcache and emmstats once more!

    usecache = 0,x,x  = disable usage of emmcache and emmstats
    usecache = 1,x,x  = enable emmcache, emmstats and save to file if oscam is stopped
    usecache = 2,x,x  = enable emmcache, emmstats but dont save to file if oscam is stopped




  * [r10485]

    Do not increase the number of entries in the dynarray if allocation fails.


  * [r10484]

    Rewrite ecm header whitelist code.

    Change the structure that tracked ecm header whitelist and rewrite
    the related code. Now it is a lot simpler (68 lines less code) and
    closer to ecm whitelist parser and generator.

    Tests module was updated with support for ecm header white list.

    There is a positive effect on binary size as well (-440 bytes).

    {{{
     add/remove: 4/2 grow/shrink: 3/1 up/down: 1639/-2079 (-440)
     function                                     old     new   delta
     chk_ecm_hdr_whitelist                          -     699    +699
     mk_t_ecm_hdr_whitelist                         -     555    +555
     static.ecm_ratelimit_findspace              2499    2685    +186
     ecm_hdr_whitelist_add                          -     113    +113
     matching_reader                             1973    2008     +35
     clear_ecm_hdr_whitelist                        -      34     +34
     static.ecm_ratelimit_check                  2728    2745     +17
     static.free_reader_ecm_headerwhitelist        66       -     -66
     mk_t_ecmheaderwhitelist                      669       -    -669
     ecmheaderwhitelist_fn                       1473     129   -1344
    }}}

    A negative is that after the rewrite the ecm header whitelist structure
    takes a bit more memory than before.


  * [r10483]

    Add 'tests' to .gitignore


  * [r10482]

    - Errorhandling for emmstat, emmcache and channelcache saving: on error remove created file!



  * [r10481]

    tests: Integrate test vectors into test structure.


  * [r10480]

    Make ecm whitelist parser easier to understand.

    Rename some variables and small code cleanup.


  * [r10479]

    Improve ecm whitelist parser and generator.

    Invalid values (0xffff) are reset to zero and now you can have
    filters that have only ident (provider_id) defined. For example
    this is valid filter: `@123456:11,22,33` that will match provider
    with id 123456 and ecm lengths 0x11, 0x22 and 0x33.


  * [r10478]

    Add test module for oscam config entries parsers and generators.

    We have lots of custom parsers and generators for our config file
    settings. Unfortunately there are no test vectors for them or any
    kind of test infrastructure which makes improving them or adding
    features much harder that it needs to be.

    This commit introduces stand alone `tests` module. The purpose of
    this module (the code is in `tests.c`) is to collect test vectors
    and to test them.

    The module is stand-alone and it is built as separate binary by
    using `make tests`.


  * [r10477]

    - fix semicolon typo



  * [r10476]

    - Dont load/save any channelcache on dbox2 since they will crash



  * [r10475]

    - Dont load/save any emmstat or cache on dbox2 since they will crash



  * [r10474]

    - Add dbox2 to recognized boxtypes



  * [r10473]

    sci

    vu+  extra char was not needed


  * [r10472]

    Sci

    fixed speed 4.50 for all vu boxes


  * [r10471]

    Do not initialize openssl twice when ghttp module is enabled.


  * [r10470]

    webif/ghttp/ssl: Do not leak memory allocated by openssl.

    This patch does several related things:
    1. Moves SSL initialization in one place (using it from two threads
       can cause undefined behaviour).
    2. Clean openssl allocated context if ssl initialization in
       webif failed for some reason (not founding certificate file for
       example).
    3. Clear memory after openssl error functions are called.


  * [r10469]

    dvbapi: Fix memset() with reversed parameters.


  * [r10468]

    Rename boxtype() function to boxtype_is().

    This prevents old (and broken) compilers from warning about it.

    {{{
     oscam.c: In function 'init_machine_info':
     oscam.c:706:7: warning: declaration of 'boxtype' shadows a global declaration [-Wshadow]
     globals.h:2042:6: warning: shadowed declaration is here [-Wshadow]
     oscam.c: In function 'boxtype':
     oscam.c:762:26: warning: declaration of ‘boxtype’ shadows a global declaration [-Wshadow]
     oscam.c:762:6: warning: shadowed declaration is here [-Wshadow]
    }}}

    Fixes ticket #4112.


  * [r10467]

    Do not work directly with stb_boxtype.

    stb_boxtype is possible to be NULL, in which case using strcasecmp()
    or similar functions would cause segfault. This patch defines two new
    functions for dealing with stb_boxtype.

      boxtype(X) checks if stb_boxtype equals X.
      boxtype_get() returns the detected box type string.

    As a nice side effect (in addition to cleaner and safer code) we shave
    off a bit of binary size.

    bloatcheck reports:
    {{{
     add/remove: 2/0 grow/shrink: 0/3 up/down: 63/-255 (-192)
     function                                     old     new   delta
     boxtype                                        -      43     +43
     boxtype_get                                    -      20     +20
     dvbapi_ioctl                                 367     359      -8
     Sci_Deactivate                               251     235     -16
     cardreader_init                             1784    1553    -231
    }}}


  * [r10466]

    Sci

    set sci in function off boxtype by a couple of dm boxes.
    Vuduo2 set to the only speed it is clocked.


  * [r10465]

    some webif fixes for commit 10403


  * [r10464]

    updated doc for read_old_classes


  * [r10463]

    dvbapi:

    - More fix for receiver internal bufferoverflow
    - Skip executing of specific emm filter handlingcode if ecm is being handled!



  * [r10462]

    Added default value for 'read_old_classes'.


  * [r10461]

    Added new parameter 'read_old_classes' to documentation.


  * [r10460]

    Do not rely on the compiler to clear the whole structure when using short initializer

    This prevents the compiler from complaining about:
    {{{
     oscam-conf-chk.c: In function 'chk_ecm_whitelist':
     oscam-conf-chk.c:504: warning: missing initializer
     oscam-conf-chk.c:504: warning: (near initialization for 'new_ecm_whitelist.ewdata')
     oscam-conf-chk.c:508: warning: missing initializer
     oscam-conf-chk.c:508: warning: (near initialization for 'd.caid')
    }}}

    Reported by AbrahaM.


  * [r10459]

    Rewrite ecm whitelist code.

    Change the structure that tracked ecm whitelist and rewrite the
    related code. Now it is a lot simpler (160 lines less code).
    There is a positive effect on binary size as well (-1.2k).

    bloatcheck report:
    {{{
     add/remove: 4/2 grow/shrink: 0/5 up/down: 1059/-2357 (-1298)
     function                                     old     new   delta
     chk_ecm_whitelist                              -     533    +533
     mk_t_ecm_whitelist                             -     425    +425
     ecm_whitelist_add                              -      67     +67
     clear_ecm_whitelist                            -      34     +34
     static.ecm_ratelimit_check                  2745    2728     -17
     matching_reader                             2043    1973     -70
     static.free_reader_ecm_whitelist             149       -    -149
     static.ecm_ratelimit_findspace              2685    2499    -186
     update_ecmlen_from_stat                      709     340    -369
     mk_t_ecmwhitelist                            463       -    -463
     ecmwhitelist_fn                             1232     129   -1103
    }}}

    A negative is that after the rewrite the ecm whitelist structure
    takes a bit more memory than before.

    This fixes small memory leak in parsing shown in trac
    ticket #4099 comment 11.


  * [r10458]

    bulcrypt: Another fix for v2 EMMs.

    Patch by chepik suggested in ticket #4110.


  * [r10457]

    EMM:

    - Prevent oscam from running out of resources: remove stale emmcache + emmstats after 30 days (perhaps make this user configable?)
    - Some code adoption to prevent possible null deference



  * [r10456]

    minilzo: Disable internal checks because they cause build errors.

    This fixes:
    {{{
      LINK   ../archiv/oscam-svn8403-fritz33xx-webif.debug
      build/mips-linux-uclibc/minilzo/minilzo.o: In function `_lzo_config_check':
      minilzo.c:(.text+0x678): undefined reference to `__clzsi2'
      collect2: ld returned 1 exit status
    }}}

    This is the same commit as r8404.


  * [r10455]

    - miniLZO update to version 2.09 (released 4 feb 2015)



  * [r10454]

    Allocate TUNTAB dynamically

    The TUNTAB structure size is 602 bytes and also the number of
    entries is limited.

    This structure is used to implement the beta tunnel feature via
    'betatunnel' account setting.

    This feature is not used by everyone but everyone takes the memory hit.

    This patch makes the bulk of the structure dynamically allocated. The
    memory savings are as follows (x86_64 defconfig):

    {{{
     struct         before   after   delta  savings
      s_tuntab         602      16    -586    97.4%
      s_client        2440    1856    -584    24.0%
      s_auth          1976    1392    -584    29.6%

     Binary size:
      add/remove: 1/0 grow/shrink: 5/5 up/down: 335/-485 (-150)
    }}}


  * [r10453]

    doc: Remove CS_MAXTUNTAB mentions in the docs.

    CS_MAXTUNTAB is going away when TUNTAB structure becomes dynamic.


  * [r10452]

    Clear destination FTAB before parsing the new one.


  * [r10451]

    - Cs357 (=camd35 UDP) prevent usage of reconnecttimeout, UDP is stateless so it makes no sense!



  * [r10450]

    Small cleanup of FTAB related code.


  * [r10449]

    Correctly reload ident and chid filters on client reinit.

    This fixes a bug introduced in FTAB rewrite.


  * [r10448]

    - More tryfix for internal filter bufferoverlow of receiver



  * [r10447]

    newcamd: Fix mgclient support which was broken with ftab changes in r10426.

    It seems that FTAB changes in r10426 have broken mgclient support
    in newcamd module. According to the reporter this patch fixes
    the problem.

    Ref: http://www.streamboard.tv/wbb2/thread.php?threadid=43056


  * [r10446]

    bulcrypt: Fix writing of unique EMMs in v2.

    Patch by chepik posted in ticket #4110.


  * [r10445]

    Fix libusb linking on FreeBSD.

    This fixes ticket #4103.


  * [r10444]

    some fixes with ftab allocation


  * [r10443]

    viaccess: now only reading active entitlements/classes, use
    read_old_classes = 1
    in the [reader] config to read all entitlements/classes.
    this should speed up card init.


  * [r10442]

    - Fix for emmcache not loading if emmlogdir is set



  * [r10441]

    Revert "Add -std=c99 to compiler flags."

    This reverts commit r10434.

    It seems that `-std=c99` really breaks oscam subtly at least
    according to ticket #4106.

    Since setting the standart is not bringing anything positive
    but seems to come with it's own set of weird bugs, it is better
    to revert it.


  * [r10440]

    __asm__ fix for c99


  * [r10439]

    Better fix for asm usage in cscrypt.

    This is better fix that the one applied in r10437. Thanks to Jens
    for pointing out that this is a better way.


  * [r10438]

    - Tryfix for dvbapi internal bufferoverlow



  * [r10437]

    cscrypt: Fix for build with -std=c99.

    The optimization that is written in asm for a long time have been
    performed by the compiler so having it in asm is kind of pointless.

    Also not using inline asm makes it possible to build oscam with
    -std=c99 compiler option.

    This fixes ticket #4107.


  * [r10436]

    List destruction should always set the list to NULL.

    This removes ll_destroy_xxx_NULL() macros in favour of making all
    ll_destroyXX() functions set the list parameter to NULL. We already
    have three list destruction functions (too many) in addition to
    that having 2 more (in the form of macros) was starting to get
    unwise.

    This change also removes the need for this idiom (used in couple
    of places):

    {{{
      ll_destroy(x);
      x = NULL;
    }}}

    The ll_destroyXXX() functions are checking if their parameter is
    NULL, so there is no need for the caller to check it.


  * [r10435]

    config-reader: Refactor freeing of ecm_whitelist and ecm_header_whitelist.

    It is a tricky code and duplicating it can only lead to bad things.


  * [r10434]

    Add -std=c99 to compiler flags.

    This changes nothing in the build (we are already c99 compatible).
    It just establishes the base compiler support that we are expecting.


  * [r10433]

    pages_gen: Avoid strict-aliasing warnings.


  * [r10432]

    oscam-emm-cache: Add new lines at the end of file.

    Some compilers warn when files don't end with new lines.


  * [r10431]

    Additional fix for r10422 (Add card_done() callback to card readers).

    I've missed the fact that private data was freed also in free_reader().
    Now the leak described in r10422 should be fixed.


  * [r10430]

    conf-reader: Free strings allocated by config.

    The memory occupied by 'description' and 'readnano' was not freed when
    reader freeing function was called.


  * [r10429]

    camd33/camd35: Allocate aes_keys per client on connect.

    This saves 480 bytes in `struct s_client` for every client that is not using
    camd33 or camd35 protocols.

    Structure changes:

    {{{
     struct         before   after   delta  savings
      s_client        3048    2568    -480    15.8%

     binary size:
      add/remove: 1/0 grow/shrink: 3/0 up/down: 103/0 (103)
    }}}


  * [r10428]

    cryptoworks/viaccess: Allocate EMM reassembly buffers on demand.

    This patch saves 1008 bytes from `struct s_client` in the common case
    where cw/via readers are enabled. Now only AU enabled clients would
    allocate EMM reassembly buffer for themselves.

    Structure changes:

    {{{
     struct         before   after   delta  savings
      s_client        3928    2920   -1008    25.0%
    }}}


  * [r10427]

    newcamd: Prevent filter copying.

    In addition to saving some copying, bloatcheck reports:
    {{{
     add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-120 (-120)
     function                                     old     new   delta
     newcamd_auth_client                         5523    5403    -120
    }}}


  * [r10426]

    Allocate FTAB dynamically

    The FTAB structure size is bigger than 2100 bytes and also the number
    of filters is limited to 16.

    This structure is used to implement the account filters (via 'ident' and
    'chid' settings) and reader filters (via 'fallback_percaid', 'localcards',
    'ident' and 'chid' settings).

    These settings are not used by everyone but everyone takes the memory hit.

    This patch makes the bulk of the structure dynammically allocated. The
    memory savings are very nice:

    {{{
     struct         before   after   delta  savings
      s_ftab          2116      16   -2100    99.3%
      s_reader       13592    5200   -8392    61.8%
      s_client        8120    3928   -4192    51.7%
      s_auth          6176    1976   -4200    68.1%

     Binary size:
      add/remove: 2/0 grow/shrink: 13/23 up/down: 1139/-434 (705)
    }}}


  * [r10425]

    cryptoworks/viaccess: Use rdr_log in EMM reassembly functions.


  * [r10424]

    ghttp: Release all memory on exit.

    valgrind reports:
    {{{
     192 bytes in 1 blocks are still reachable in loss record 1 of 1
        at 0x4C29ADD: malloc (vg_replace_malloc.c:296)
        by 0x4B5773: cs_malloc (oscam-string.c:11)
        by 0x4B1536: ll_create (oscam-llist.c:44)
        by 0x44F744: module_ghttp (module-ghttp.c:758)
        by 0x4048FB: main (oscam.c:1502)
    }}}

    and a lot of things related to SSL error strings that were not freed
    when SSL is enabled.


  * [r10423]

    Wait before stopping GC when running under valgrind.

    This hack leaves some time for oscam threads to finish what they're
    doing before stopping the garbage collector. It is a hack to make
    valgrind happy and to produce clean report of what is possibly leaked.


  * [r10422]

    Add card_done() callback to card readers.

    This allows card readers to free their privately allocated data and
    fixes leak in videoguard2 reader.

    valgrind reported:

    {{{
     344 bytes in 2 blocks are definitely lost in loss record 436 of 733
        at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
        by 0x478FD3: cs_malloc (oscam-string.c:11)
        by 0x44F2C2: memorize_cmd_table (reader-videoguard-common.c:773)
        by 0x45295D: videoguard2_card_init.part.0 (reader-videoguard2.c:587)
        by 0x453A77: videoguard2_card_init (reader-videoguard2.c:539)
        by 0x4436A0: reader_get_cardsystem (reader-common.c:144)
        by 0x443A44: cardreader_do_reset (reader-common.c:194)
        by 0x47AE47: work_thread (oscam-work.c:293)
        by 0x5477181: start_thread (pthread_create.c:312)
        by 0x578800C: clone (clone.S:111)
    }}}


  * [r10421]

    Remove executable bit on source files.


  * [r10420]

    EMM:

    Replace the simple emm ringbuffer with dynamic allocated buffering for emms and emmstats
    Emmcache and emm reader stats are now loaded and saved upon oscam start and stop
    For my usage the cards will only be served with fresh emms no matter how many times I start and stop oscam.

    ToDo:

    The usual fixing of broken stuff :)
    Webif cosmetics: use the new additions like firstseen, lastseen, firstwrite, lastwrite, delete emmcache, delete emm reader stat..




  * [r10419]

    fixed aeskey list memleak


  * [r10418]

    fixed hashtable freeing


  * [r10417]

    Remove dead increments.

    The variables that are incremented are not used after that, so the
    increment can be removed.

    Found by clang checker.


  * [r10416]

    Let the compiler decide if func needs to be inlined.

    This function is the only inlined function (that is not static) in the
    whole oscam source. Surely that func is not that important but also the
    compiler complains about it when c99 mode is switched on.

    With this patch bloatcheck reports 589 byte savings.
    {{{
      add/remove: 1/0 grow/shrink: 0/1 up/down: 152/-741 (-589)
      function                                     old     new   delta
      __xxor                                         -     152    +152
      do_cmd                                      4124    3383    -741
    }}}


  * [r10415]

    strings.h needs to be included for strcasecmp().

    We got strcasecmp() indirectly because of _GNU_SOURCE, but let's be
    explicit that we need that header.


  * [r10414]

    cacheex: Remove unused function and remove inline marks.


  * [r10413]

    reader: Free emm cache.

    valgrind reported:
    {{{
     565,248 bytes in 46 blocks are definitely lost in loss record 483 of 487
        at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
        by 0x477F63: cs_malloc (oscam-string.c:11)
        by 0x4774FF: reader_init (oscam-reader.c:1153)
        by 0x47A0A1: work_thread (oscam-work.c:285)
        by 0x5477181: start_thread (pthread_create.c:312)
        by 0x578800C: clone (clone.S:111)
    }}}


  * [r10412]

    pages_gen: Free all memory when exiting with errors.

    The bug was found with clang checker.


  * [r10411]

    pages_gen: Check if we have any templates at all.

    The bug was found with clang checker.

    This prevents possible allocation with 0 size and weird behaviour
    when there are no defined templates.


  * [r10410]

    pages_gen: Simplify loading of is_defined.txt

    We already have readfile() function, let's use it.


  * [r10409]

    webif color fix


  * [r10408]

    Prevent possible NULL pointer deref.

    Looks impossible to me but according to clang checker it can happen.
    The fix is simple enough.


  * [r10407]

    Check the result of cs_strdup().

    It is not a very likely situation that in this place cs_strdup()
    would fail but crashing is not nice and the result of memory
    allocation functions must be checked at all times.


  * [r10406]

    fixed memleak


  * [r10405]

    revert camd35 pid change


  * [r10404]

    small fix for last commit


  * [r10403]

    applied patches
    10399_status_online_proxys_r4.patch
    10399_duoble_emm_online_proxies_cosmetic s_r1.patch
    from:
    http://www.streamboard.tv/wbb2/thread.php?postid=535337#post535337


  * [r10402]

    Cleanup cache allocations on oscam exit.

    valgrind reports:

    {{{
      272 bytes in 1 blocks are possibly lost in loss record 3 of 5
       at 0x4C2B854: calloc (vg_replace_malloc.c:623)
       by 0x40128C4: _dl_allocate_tls (in /lib64/ld-2.20.so)
       by 0x4E3CFE5: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.20.so)
       by 0x4B8590: start_thread (oscam.c:822)
       by 0x404C2B: main (oscam.c:1562)

      512 bytes in 1 blocks are still reachable in loss record 4 of 5
       at 0x4C29ADD: malloc (vg_replace_malloc.c:296)
       by 0x4918CB: tommy_hashlin_init (tommyhashlin.c:50)
       by 0x492308: init_hash_table (oscam-hashtable.c:11)
       by 0x492602: init_cache (oscam-cache.c:69)
       by 0x4043EA: main (oscam.c:1480)

      512 bytes in 1 blocks are still reachable in loss record 5 of 5
       at 0x4C29ADD: malloc (vg_replace_malloc.c:296)
       by 0x4918CB: tommy_hashlin_init (tommyhashlin.c:50)
       by 0x492308: init_hash_table (oscam-hashtable.c:11)
       by 0x41FC12: cacheex_init_hitcache (module-cacheex.c:56)
       by 0x4043EF: main (oscam.c:1481)
    }}}


  * [r10401]

    Prevent memory loss.

    valgrind reports:

    {{{
     66 bytes in 1 blocks are definitely lost in loss record 1 of 2
        at 0x4C29ADD: malloc (vg_replace_malloc.c:296)
        by 0x4B4A83: cs_malloc (oscam-string.c:11)
        by 0x4B4B6F: cs_strdup (oscam-string.c:46)
        by 0x49EF2B: init_config (oscam-config-global.c:1078)
        by 0x4043F4: main (oscam.c:1482)
    }}}


  * [r10400]

    cache: Mark variables and functions static.

    These are not used outside of oscam-cache.c they should be static.


  * [r10399]

    Sci

    Gives shorter init time for seca/nagra tunneled cards on Vu+ series


  * [r10398]

    cache: Split cacheex code into separate function.


  * [r10397]

    cache: Split cycle check code into separate function.


  * [r10396]

    cache: Simplify code.

    The `if` check is already ugly enough, let's simplify it a bit.


  * [r10395]

    cache: Simplify code.

    Having multiple places that unlock a taken lock is an easy mistake
    waiting to happen.


  * [r10394]

    cache: Reduce CS_CACHEEX ifdefs.

    struct ecm_request_t grows by a pointer but we can always regain this
    space (if needed) by just trimming the structure a bit. vid and prid
    can be uint16_t, from_xxx variables can be packed into bitmask, msglog
    can be slimmed down, cwc_msg_log can trimmed from 64 bytes to 32
    without any problem and there are probably more...).


  * [r10393]

    cache: Remove CW_CYCLE_CHECK ifdefs.

    Due to structure alignment (we have 3 single bytes before uint16_t)
    we've already lost the single byte that is occupied by got_bad_cwc.
    We can use this opportunity to simplify the code.


  * [r10392]

    cwcycle: Move private structures out of the header file.

    This structures are only used in module-cw-cycle-check. I'm leaving
    only the public stuff in the header file.


  * [r10391]

    cacheex: Move cacheex code out of oscam-ecm.c into module-cacheex.c


  * [r10390]

    camd35 tcp: do not complain about packet size if a client closed the connection


  * [r10389]

    dvbapi: new command to stop descrambling all demuxers

    The commit add possibility to close all demuxers related
    with the connection (using network protocol).
    It uses the following packet for this:
    9F 80 3f 04 83 02 00 FF

    If the demux index = 0xff then all related demuxers
    are stopped.



  * [r10388]

    oscam-monitor: fixed sending corrupt packets when strlen(txt) > 255 on crypted connections


  * [r10387]

    gbox: Remove gbox code from garbage collector.

    gbox specific code (that is not even related to memory management)
    have no place in garbage collector which is pretty central part of
    oscam.

    Ref: http://www.streamboard.tv/wbb2/thread.php?postid=535223


  * [r10386]

    gbox: Remove unneeded initialization.

    This field is already zero (the client is cs_malloc()'ed).


  * [r10385]

    gbox: Remove unneeded initializations in oscam-ecm.

    These fields are already zero (courtesy of cs_malloc() couple of lines up).


  * [r10384]

    more fixes


  * [r10383]

    fixed last commit


  * [r10382]

    fixed memory leaks reported here:
    http://www.streamboard.tv/wbb2/thread.php?postid=535176#post535176


  * [r10381]

    added fix for possible crash


  * [r10380]

    added cccam card sid merging


  * [r10379]

    final fix for warning "array subscript has type char"
    we are now using the same syntax as strtolower() [oscam-string.c]
    see thread: http://www.streamboard.tv/wbb2/thread.php?postid=535127


  * [r10378]

    gbox: Disable calling external OSD scripts by default.

    Calling external sripts the way it is implemented is big security
    hole, so this patch disables this feature by default.

    If you need it, uncomment `#define GBOX_ENABLE_UNSAFE_OSD 1` and
    recompile oscam.

    For more info:
      http://www.streamboard.tv/wbb2/thread.php?postid=534454#post534454


  * [r10377]

    Fixes/cleanups related to read tiers patch committed in r10376.


  * [r10376]

    vg2: Add read tiers patch.

    For more info see ticket #4091.

    Original patch by BigGyros. Original readme follows:

    This patch is the sum of various code:
     - some found in streamboard forum (thanks to authors)
     - some were reversed from a (shitty) commercial oscam mods (thanks to an
       anonymous guy who sent to me) some written just by observing the logs from
       a season interface

    What this patch does?
    1) it fix the read of tiers for the nds cards like 09AC that stopped to support
       the ins76 method
        readtiers = 0 //disable
                  = 1 //ins70
                  = 2 //ins76
       (add it in the reader section or use webif)
    2) it adds support for some ins that helps the nds card after the emm update
    3) I hope it will breaks business of assholes who gain money from the free
    works of some streamboard users.

    What this patch does not?
    1) this patch does not break any DRM or any countermeasure done to fight the
       piracy
    2) this patch does not help anybody to share cw
    3) this patch does not help the assholes to sell receivers, lines, oscam-mod,
       fake solutions, birds, woods, monkeys..

    Is the patch tested?
     - Yes, it works..


  * [r10375]

    cacheex: Cleanup the header file a bit for easier reading.


  * [r10374]

    cacheex: Move cacheex code from oscam-cache.c to module-cacheex.c

    oscam-cache.c is for generic code.


  * [r10373]

    better fix for warning "array subscript has type char"


  * [r10372]

    fixed warning "array subscript has type char"


  * [r10371]

    disable ecm odd/even byte check for constcw requests


  * [r10370]

    Smartreader protocol

    fix compile warning


  * [r10369]

    Smartreader protocol

    Modified restart protection to be dev handle base.


  * [r10368]

    Sci

    IOCTL_SET_DEACTIVATE does not work on dm8000.
    Free allocated mem's when closing reader.


  * [r10367]

    [gbx] Introduce optional parameter cccam_reshare in gbox section of oscam.server.

    cccam_reshare can be used to control the number of hops of cccam cards in the gbx network.
    It is independent from the global reshare settings of cccam and is similar to the parameter
    cccreshare in the reader settings of cccam.
    However the logic is gbx-like not cccam.
    Setting it to 0 will prevent cccam cards from being shared. Settings > 0 represent the
    number of hops.




  * [r10366]

    net: Initialize local variable.

    Found by clang checker.


  * [r10365]

    ecm: Prevent possible NULL ptr dereference.

    Found by clang checker.


  * [r10364]

    cccam: Prevent possible NULL ptr dereference.

    Found by clang checker.


  * [r10363]

    Correctly restore errno after nanosleep().

    Additional fix after r10353.


  * [r10362]

    oscam-log: Remove useless check.

    Size can't be zero, no need for check for this at all.


  * [r10361]

    WebIf:

    - Fix typo and set width for table in emm_running.html


  * [r10360]

    enabled and fixed dvbapi for cygwin.
    now it is possible to run a dvbapi tcp server on windows.
    for example together with dvbv-dvbapi-plugin by schwa226
    thread here:
    http://www.streamboard.tv/wbb2/thread.php?threadid=42677


  * [r10359]

    WebIf:

    1. Fix for textarea in script.html. Show height for textarea if isn´t text output.
    2. Same width for table in emm.html as emm output in textares.


  * [r10358]

    Currently we are not sending the (ecm)pid over camd35, this makes constcw requests impossible.
    To fix this, this change will use the "buf+18" field to store the pid. This space is ignored or set to a hard-coded value by all other camd3 implementations I checked. The orignal camd3 code either sets it to zero or fills this field with something related to the crc32 checksum and the value at buf+16.
    Since up to now we just set it to '0xffff', this change should not break anything.
    I have tested connecting to orignal camd3 and everything worked.


  * [r10357]

    Sci

    Modified restart wait until closed protection to act really reader based.
    Added a extra log output to detect incompatible commands versus stb type. Example The IOCTL_SET_DEACTIVATE function. Not supported on dm8000 but required on vuduo2.


  * [r10356]

    Webif: (Tnx Ultra47 and oscam community members for their effort!)

    - Fix for http://www.streamboard.tv/oscam/ticket/4064
    - Patch r9947 enhanced
    - Fix show written emms if emm logdir empty
    - Optical fixes show written emms
    - Show written emms on write emm tab sorted and filtred (oldest first, newest last), idea by schorsch
 -- Andrey Pavlenko <email address hidden>   Fri, 20 Feb 2015 14:58:01 +0300

Available diffs

Builds

Package files

No files published for this package.