Files
freeswitch/tests/unit
Dmitry Verenitsin 86b10358e2 Merge commit from fork
`switch_core_media_add_crypto()` parses the SDP `a=crypto` keysalt and
decodes it into a fixed-size key buffer. Enforce the buffer contract at
the call site:

- Reject a zero-length, negative, or over-long keysalt (the length
  check now has both a lower bound and an upper bound against the copy
  buffer).
- Copy the keysalt token into a NUL-terminated buffer and decode from
  that, so `switch_b64_decode` stops at the token instead of reading on
  into the following key material (it consumes input to the NUL and
  skips non-base64 bytes).
- Pass the destination buffer size as the decode bound rather than the
  parsed token length.
- Require the decoded length to cover the crypto suite's key+salt so the
  subsequent copy cannot read past the decoded bytes.

Add `test_add_crypto_keysalt_bounds`, a table-driven test covering the
accepted and rejected keysalt shapes across suites (AES-128/192/256),
including RFC 4568 lifetime/MKI and multi-key lines.
2026-08-08 19:47:47 +03:00
..
2026-08-08 17:48:05 +03:00
2019-11-21 22:06:14 +04:00
2026-05-26 22:02:42 +03:00
2025-07-31 19:38:54 +03:00
2024-12-03 21:30:46 +01:00
2026-08-08 19:47:47 +03:00
2024-12-03 21:30:46 +01:00
2024-10-11 20:16:39 +02:00
2024-12-03 21:30:46 +01:00
2026-08-08 19:47:47 +03:00
2026-08-08 18:18:50 +03:00
2026-08-08 18:29:25 +03:00
2026-08-08 17:03:47 +03:00
2021-04-27 13:54:32 -06:00
2026-08-08 17:07:32 +03:00
2026-08-08 17:48:05 +03:00
2026-05-26 22:02:42 +03:00
2024-12-03 21:30:46 +01:00

FreeSWITCH unit tests should be kept as shallow unit tests and micro
benchmarks testing functionality exposed through libfreeswitch.

Requirements for a new unit tests: 

1. Tests must use switch_test.h framework