SRTCP handling for maximum_lifetime is missing in srtp.c file

Open
#761 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
security

Research direction

Start in srtp/srtp.c and compare srtp_unprotect_rtcp_mki() with the existing key-limit handling in srtp_unprotect_mki(). Check the relevant SRTCP tests, if present, and run them. Done means SRTCP soft- and hard-limit events are handled consistently, with a hard limit returning srtp_err_status_key_expired.

Written by the indexing model from the issue text.

Description

File - https://github.com/cisco/libsrtp/tree/main/srtp/srtp.c

Function - srtp_unprotect_rtcp_mki()

When SRTCP packets count reaches hard limit i.e 2^31 is reached and handling of this event is done. But this handling where SRTCP packets are checked and based on hard/soft limit event is raised is missing for SRTCP.
Handling for SRTP is present in function srtp_unprotect_mki().

Can you please confirm why this handling is missed for SRTCP.

Missed handling:

switch (srtp_key_limit_update(session_keys->limit)) {
case srtp_key_event_normal:
break;
case srtp_key_event_soft_limit:
srtp_handle_event(ctx, stream, EVENT_KEY_SOFT_LIMIT);
break;
case srtp_key_event_hard_limit:
srtp_handle_event(ctx, stream, EVENT_KEY_HARD_LIMIT);
return srtp_err_status_key_expired;
default:
break;

Dominant language
C
Stars
1.4k
Forks
523
Avg merge
3d 23h
Merged PRs (30d)
14

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cisco/libsrtp

All issues in cisco/libsrtp

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.