Permalink
Commits on Jun 5, 2018
  1. Merge pull request #414 from fancycode/detect-broken-openssl-cleanse

    pabuhler committed Jun 5, 2018
    Detect and handle broken "OPENSSL_cleanse".
Commits on Jun 1, 2018
  1. Detect and handle broken "OPENSSL_cleanse".

    fancycode committed May 30, 2018
    On some platforms (experienced this on arm64 with OpenSSL 1.0.2g), the
    function `OPENSSL_cleanse` is broken and doesn't clear the memory, but
    fills it with data. This breaks `octet_string_set_to_zero`.
    
    This patch checks if `OPENSSL_cleanse` is broken during configure and if
    it is, will use `srtp_cleanse` instead. Also a testcase is added to
    `datatypes_driver.c` to check if `octet_string_set_to_zero` is working
    correctly.
Commits on May 15, 2018
Commits on May 8, 2018
  1. Merge pull request #412 from pabuhler/update-changes-2.2

    pabuhler committed May 8, 2018
    Update changes preparing for 2.2.0 release
Commits on May 7, 2018
  1. reword based on feedback

    pabuhler committed May 7, 2018
Commits on May 2, 2018
Commits on Apr 16, 2018
  1. Merge pull request #409 from strfry/master

    pabuhler committed Apr 16, 2018
    Compatibilty with LibreSSL
Commits on Apr 9, 2018
  1. Compatibilty with LibreSSL

    strfry committed Apr 9, 2018
Commits on Apr 4, 2018
  1. Merge pull request #403 from pabuhler/set-gcm-iv-directly

    pabuhler committed Apr 4, 2018
    Set gcm IV directly with EVP_CipherInit_ex
Commits on Mar 12, 2018
  1. Merge pull request #404 from pabuhler/add-extern-to-global-variables

    pabuhler committed Mar 12, 2018
    Add extern to global variables
  2. Merge pull request #405 from pabuhler/prevent-potential-double-free

    pabuhler committed Mar 12, 2018
    prevent potential double free
  3. Merge pull request #406 from vopatek/fix-unprotect-mki

    pabuhler committed Mar 12, 2018
    Fix unprotect when pktlen < (2*mki_size + tag_len)
Commits on Mar 7, 2018
  1. Fix unprotect when pktlen < (2*mki_size + tag_len)

    vopatek committed Mar 7, 2018
    The condition mki_start_location >= *mki_size in
    srtp_get_session_keys() should use base_mki_start_location.
    Now the condition is false for packets < 2*mki_size + tag_len.
    But as of commit d4bd43c the correct condition is now checked
    earlier so we simply remove the expression altogether.
  2. prevent potential double free

    pabuhler committed Mar 7, 2018
    If alloc of icm fails then set *c to NULL after freeing
    so it will not be freed again. This is the same pattern
    used when allocating other ciphers.
Commits on Mar 6, 2018
  1. prefix global debug modules with srtp

    pabuhler committed Mar 6, 2018
    be consistant
  2. check for NULL value in debug module

    pabuhler committed Mar 6, 2018
    be even more defensive
  3. add extern to global variables

    pabuhler committed Mar 6, 2018
    Prevents multiple definitions. Depending on linker
    it was possible that there would be one definition per
    compilation unit.
Commits on Feb 26, 2018
  1. Set gcm IV directly with EVP_CipherInit_ex

    pabuhler committed Feb 23, 2018
    Setting the IV directly with EVP_CipherInit_ex will
    save two calls to openssl and simplify the code.
    
    There is a comment that the 3 calls are required but
    I am not sure why, EVP_CTRL_GCM_SET_IV_FIXED will
    just store the vector and EVP_CTRL_GCM_IV_GEN will use
    it internally and then increment the last digits before
    returning it in iv variable passed in.
    EVP_CipherInit_ex will store the iv and use it internally.
    Incrementing and retrieving the new IV is not required for
    SRTP-GCM, a new IV is used for each packet.
    
    Tested with openssl 1.0.1d & 1.0.2g
Commits on Feb 15, 2018
  1. Merge pull request #398 from pabuhler/memory-access-fixes

    pabuhler committed Feb 15, 2018
    Memory access fixes
Commits on Feb 9, 2018
  1. Validate mki index when looking up keys

    pabuhler committed Feb 7, 2018
    If the mki index is not valid then a NULL session
    key should be returned not just defaulting to first.
    This allows the protect functions to return
    with error bad mki.
  2. Ensure returned trailer length is sufficient

    pabuhler committed Feb 7, 2018
    The srtp_get_protect_trailer_length needs to ensure
    that the returned value is large enough for any of
    the streams in the session.
    
    When a session is initialized with multiple polices
    it is possible to have different tag lengths for each
    policy. This function provides no way to specify which
    policy to use, so for now loop over all and find largest.
    
    The current function now has limited use so suggest to make
    two functions, one that takes ssrc or packet header so
    correct stream can be used, second function that takes a
    policy.
    
    # Conflicts:
    #	srtp/srtp.c
  3. Remove needless check of session_keys

    pabuhler committed Feb 9, 2018
    The session_keys array is not shared with the
    template so if it was allocated just free it.
  4. Prevent OOB access of stream_template->session_keys

    pabuhler committed Feb 8, 2018
    The template may not have been used for the deallocated
    stream, therefore the size of the session_keys array
    could be different.
    
    Should maybe contain a pointer to template from stream
    so it is explicitly known that it was used.
Commits on Feb 8, 2018
  1. Merge pull request #401 from mfroeschl/fix-srtp-get-session-keys

    pabuhler committed Feb 8, 2018
    Fix memory access issue in srtp_get_session_keys()
Commits on Feb 7, 2018
  1. remove srtp_stream_free use srtp_stream_dealloc instead

    pabuhler committed Feb 7, 2018
    logic in srtp_stream_free was not correct and could result
    in memory access errors, srtp_stream_dealloc can safely be used
    instead and is "more" correct.
  2. Fix memory access issue in srtp_get_session_keys()

    mfroeschl committed Feb 7, 2018
    Issue:
    In srtp_get_session_keys(), when packet size (*pkt_octet_len) is
    greater than auth tag length but smaller than (auth tag length + MKI
    size), mki_start_location would take on incredible huge values,
    leading to memory access issue when calling memcmp() on iOS platform.
    
    Fix:
    Add additional sanity check before calculating mki_start_location.
Commits on Jan 26, 2018
  1. Don't access OOB in stream->session_keys

    pabuhler committed Jan 24, 2018
    mki_index is a zero based index in the sesssion_keys
    array which has a max length of num_master_keys.
    
    Reported by Guido Vranken <guidovranken@gmail.com>
  2. Dont free unallocated session_keys

    pabuhler committed Jan 24, 2018
    session_keys may not have been allocated yet.
    
    reported by Guido Vranken <guidovranken@gmail.com>
  3. Merge pull request #397 from pabuhler/set-clang-format-version

    pabuhler committed Jan 26, 2018
    Use explicit clang-format version on travis
  4. Use explicit clang-format version on travis

    pabuhler committed Jan 26, 2018
    When travis upgrade's clang it breaks current
    formatting that was done with 3.9 . Better to explicitly
    set the version to use.
Commits on Nov 30, 2017
  1. Merge pull request #391 from paulej/paulej_calloc_zero

    paulej committed Nov 30, 2017
    Return NULL when allocating memory of size zero
Commits on Nov 29, 2017
  1. Merge pull request #390 from pabuhler/coverity-scan-179781

    pabuhler committed Nov 29, 2017
    bitvector of length zero is not valid
Commits on Nov 28, 2017
  1. bitvector of length zero is not valid

    pabuhler committed Nov 28, 2017
    Fixes coverity scan issues 179781
    
    If the length resulted in l == 0 then there was no
    allocation of word, which could subsequently be
    dereferenced. Treat length of zero as invalid to
    avoid dealing with it.