1. 07 Mar, 2018 1 commit
    • Martin Vopatek's avatar
      Fix unprotect when pktlen < (2*mki_size + tag_len) · ca8e9a58
      Martin Vopatek authored
      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 d4bd43c9 the correct condition is now checked
      earlier so we simply remove the expression altogether.
      ca8e9a58
  2. 15 Feb, 2018 1 commit
  3. 09 Feb, 2018 4 commits
    • Pascal Buhler's avatar
      Validate mki index when looking up keys · c995df45
      Pascal Buhler authored
      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.
      c995df45
    • Pascal Buhler's avatar
      Ensure returned trailer length is sufficient · 55626f32
      Pascal Buhler authored
      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
      55626f32
    • Pascal Buhler's avatar
      Remove needless check of session_keys · 253ac269
      Pascal Buhler authored
      The session_keys array is not shared with the
      template so if it was allocated just free it.
      253ac269
    • Pascal Buhler's avatar
      Prevent OOB access of stream_template->session_keys · 9546e959
      Pascal Buhler authored
      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.
      9546e959
  4. 08 Feb, 2018 1 commit
  5. 07 Feb, 2018 2 commits
    • Pascal Buhler's avatar
      remove srtp_stream_free use srtp_stream_dealloc instead · 8ec13a7e
      Pascal Buhler authored
      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.
      8ec13a7e
    • marcus's avatar
      Fix memory access issue in srtp_get_session_keys() · d4bd43c9
      marcus authored
      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.
      d4bd43c9
  6. 26 Jan, 2018 4 commits
  7. 30 Nov, 2017 1 commit
  8. 29 Nov, 2017 2 commits
  9. 28 Nov, 2017 1 commit
    • Pascal Buhler's avatar
      bitvector of length zero is not valid · b44764bf
      Pascal Buhler authored
      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.
      b44764bf
  10. 22 Nov, 2017 3 commits
  11. 20 Nov, 2017 1 commit
  12. 18 Nov, 2017 3 commits
  13. 17 Nov, 2017 1 commit
  14. 16 Nov, 2017 2 commits
  15. 14 Nov, 2017 5 commits
  16. 13 Nov, 2017 3 commits
  17. 12 Nov, 2017 5 commits