Commit Graph

49 Commits

Author SHA1 Message Date
sauwming 9e6a63e42f
Modified DTLS cert signature algorithm used (#3876) 2024-03-05 12:46:57 +08:00
sauwming 033e4d7ae3
Fixed printf format warnings (#3813) 2023-12-27 10:32:32 +08:00
sauwming 969bec9987
Fixed DTLS handshake issue when RTCP address changes (#3732) 2023-10-13 23:30:54 +08:00
sauwming eaf0f4516d
Changed DTLS transport to use recursive mutex, instead of a simple one (#3731) 2023-10-09 15:09:51 +08:00
Nanang Izzuddin 6dc9b8c181
Merge pull request from GHSA-f76w-fh7c-pc66
* Add group lock to media transport

* Also add group lock to SRTP-DTLS

* Put lock protection to avoid race condition between destroy() & dtls_on_recv()
2023-10-03 10:59:03 +08:00
sauwming a0ac2478fc
Implement DTLS-SRTP for RTCP (#3571) 2023-07-05 11:37:44 +08:00
bennylp d63c18136a Fix gcc sign-compare warnings 2023-03-29 13:30:36 +07:00
bennylp 7a058dee81 Replace unsafe string functions such as sprintf, strcpy with the safer counterparts e.g. snprintf, strxcpy 2023-03-27 18:48:25 +07:00
bennylp 6f8b87c562 Merge branch 'coverity01' of https://github.com/pjsip/pjproject into coverity01 2023-03-24 11:11:27 +07:00
bennylp 5ed9461bbe Replace unsafe string functions such as strcpy, strncpy, strcat, and sprintf with newly implemented pj_ansi_strxcpy, pj_ansi_strxcpy2, and pj_ansi_strxcat 2023-03-24 11:11:20 +07:00
sauwming 02356e87f7 Fixed warnings in pjlib, pjmedia, and pjnath 2023-03-23 12:10:45 +08:00
sauwming ecddafbb1d Fixed warnings (3) 2023-02-28 12:50:51 +08:00
bennylp b97614d1bc Drop pj_ansi_safe_strncpy() in favor of safe pj_ansi_strncpy(), fix incorrect use of pj_ansi_safe_strncpy() 2023-02-21 18:25:04 +07:00
sauwming 221673dc39 Fixed several warnings (combined) 2023-02-20 14:55:06 +08:00
bennylp 5fe4bc1972 Fix usages of strncpy(), pj_ansi_strncpy(), and strncat() by replacing them with pj_ansi_safe_strncpy() and pj_ansi_safe_strcpycat() 2023-02-18 12:51:49 +07:00
sauwming c43af43627
Fixed race condition in DTLS media transport (#3321) 2022-12-28 09:48:02 +08:00
Riza Sulistyo 5ac9104514
Expand tab to spaces and remove $Id$ (#3292) 2022-11-22 16:26:54 +07:00
sauwming 6f197385c7
Miscellaneous fixes (#2969)
* Suppressed various compilation warnings
* Fixed CodeQL warning
* Fixed build warning on Android and Linux
* Fix build warning on Visual Studio
* Update target Android SDK version to 29 (for pjsua2 & app), to avoid gradle error: 'Google Play requires that apps target API level 29 or higher'.
* Add support for Camera2 API to ipjsua android app.
* Fix assertion on Win32 app (MSVC2005) because ICE transport info size is 160 bytes while the allocated buffer is just 144 bytes.
* Enable python unit test on windows for github actions.
* Avoid assertion in pjsua test caused by double calling of pjsua_conf_remove_port()
2022-02-24 14:46:01 +07:00
SamVanBelle 7658fae4e4
Follow-up of #2726 (#2782)
Reset ICE flag when re-using srtp transport to allow for remote address update in dtls_on_rcv_rtp.
2021-08-04 10:15:38 +08:00
SamVanBelle 3402d7f897
Reset SSL BIOs (#2745) (#2746) 2021-07-01 11:15:16 +08:00
sauwming df30cc273a
Reset DTLS state when stopping DTLS transport (#2726) 2021-06-07 14:37:46 +08:00
Nanang Izzuddin cb30280529
Fixed possible DTLS nego failure when using ICE with host and relay candidates (#2715) 2021-05-25 09:17:48 +07:00
sauwming ed28d04a66
Fixed remote address change checking in DTLS transport (#2703) 2021-04-23 13:24:43 +08:00
Nanang Izzuddin fd7fe4b519 Misc (re #2504): Suppress a compile warning on MSVC2005: unreferenced param 2021-03-17 09:22:25 +07:00
Riza Sulistyo f45f2d435a
Allow demote SRTP call to RTP when using re-INVITE with PJSUA_CALL_REINIT_MEDIA (#2451)
* - Allow demote SRTP call to RTP when using re-INVITE with
PJSUA_CALL_REINIT_MEDIA
- DTLS renegotiation when receiving re-INVITE with modified media
transport address

* Revert DTLS_DEBUG to 0.

* modification based on comments.

* modified comment.
2020-06-10 10:42:53 +07:00
Riza Sulistyo 43e4680406 Close #2257: Filter SRTP crypto setting for DTLS-SRTP profile.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6118 74dad513-b988-da41-8d7b-12977e46ad98
2019-12-16 12:37:57 +00:00
Sauw Ming 2ba08831e3 Re #2206: Fixed incorrect variable
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6017 74dad513-b988-da41-8d7b-12977e46ad98
2019-05-30 03:32:28 +00:00
Sauw Ming 8def8e58d5 Fixed #2206: Avoid calling SSL_shutdown() in DTLS media transport if handshake isn't completed yet
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6016 74dad513-b988-da41-8d7b-12977e46ad98
2019-05-30 03:27:25 +00:00
Nanang Izzuddin d641faa661 Re #2096: Fixed some compile warnings.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5860 74dad513-b988-da41-8d7b-12977e46ad98
2018-08-16 02:39:36 +00:00
Nanang Izzuddin 952ddfb355 Re #2096: Answer with one SRTP keying only when offered both (thanks Wei-Wei for the feedback).
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5855 74dad513-b988-da41-8d7b-12977e46ad98
2018-08-15 02:44:53 +00:00
Sauw Ming b6721dc614 Re #2096: DTLS updates
- Fix assertion when DTLS tries to attach transport, but the ICE transport's source RTP address hasn't been updated.
- Fix DTLS transport attachment in dtls_media_start() which misses rtcp-mux checking, causing rtcp-mux to be disabled.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5852 74dad513-b988-da41-8d7b-12977e46ad98
2018-08-03 02:33:28 +00:00
Nanang Izzuddin 2d8776016d Re #2096:
- Updated DTLS-SRTP to ignore stray packet after DTLS nego has been completed.
 - Added few debugging logs.
 - Fixed false SSL error.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5847 74dad513-b988-da41-8d7b-12977e46ad98
2018-07-27 06:16:26 +00:00
Nanang Izzuddin 8ebab77c7f Re #2096:
- For better interoperability, check remote support for DTLS-SRTP by inspecting SDP a=fingerprint availability instead of UDP/TLS/SRTP/SAVP.
 - Bailout DTLS-SRTP when SDP a=fingerprint is not available.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5823 74dad513-b988-da41-8d7b-12977e46ad98
2018-07-16 07:35:52 +00:00
Nanang Izzuddin 8a883d4ffb Close #2126: Initial implementation of RTCP Feedback.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5820 74dad513-b988-da41-8d7b-12977e46ad98
2018-07-12 08:22:31 +00:00
Nanang Izzuddin 311d70ad13 Re #2096:
- Fixed memory leak due to not destroyed DTLS-SRTP keying (when it is not active).
 - DTLS-SRTP must not destroy itself, keying destroy must be initiated by SRTP.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5794 74dad513-b988-da41-8d7b-12977e46ad98
2018-05-18 07:12:41 +00:00
Sauw Ming ab6022bae3 Fixed #2087: Support for RTP and RTCP multiplexing
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5788 74dad513-b988-da41-8d7b-12977e46ad98
2018-05-09 06:58:48 +00:00
Nanang Izzuddin 852b4f0273 Re #2096: Start UDP transport earlier to allow early DTLS-SRTP nego.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5783 74dad513-b988-da41-8d7b-12977e46ad98
2018-04-18 07:45:46 +00:00
Nanang Izzuddin 2eb03533a1 Re #2096: added log about crypto setting.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5782 74dad513-b988-da41-8d7b-12977e46ad98
2018-04-18 03:05:59 +00:00
Nanang Izzuddin 7cdd970880 Re #2096:
- Fixed DTLS-SRTP issues with AEAD_AES_256_GCM crypto, e.g: material buffer length too short, silly mistake of missing comma in PJSIP-OpenSSL crypto map.
 - Fixed SRTP error PJMEDIA_SRTP_ESDPREQCRYPTO when crypto count is set to zero and SRTP is in mandatory mode.
 - Fixed SRTP transport attach where stream RTP/RTCP reception callbacks may be overriden by DTLS-SRTP.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5781 74dad513-b988-da41-8d7b-12977e46ad98
2018-04-17 10:52:33 +00:00
Riza Sulistyo 2517f1e5ec Re #2096: When checking hash algo, don't use case sensitive comparision.
Thanks to Christian Scheid for the report.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5780 74dad513-b988-da41-8d7b-12977e46ad98
2018-04-12 00:48:20 +00:00
Nanang Izzuddin 922b4e2ed6 Close #2100:
- Added new APIs:
   * PJMEDIA: pjmedia_srtp_enum_crypto(), pjmedia_srtp_enum_keying()
   * PJSUA: pjsua_config.srtp_opt, pjsua_acc_config.srtp_opt, pjsua_srtp_opt_default()
   * PJSUA2: AccountMediaConfig::srtpOpt, Endpoint::srtpCryptoEnum()
 - Deprecated PJSUA callback on_create_media_transport_srtp() (not removed yet, just warnings).
 - Slightly refactored SRTP code:
   * Fixed potential issue with on_create_media_transport_srtp(), some PJSUA internal values in pjmedia_srtp_setting may be overridden by app.
   * Fixed few issues in SRTP and keying mechanism, e.g: premature local SDP modification (it should be done after verification).
   * Potential minor backward compatibility issue: default value of pjmedia_srtp_setting.crypto_count is now zero, previously it was initialized with all crypto via pjmedia_srtp_setting_default(), actually zero and all cryptos in this setting semantically are the same.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5755 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-15 03:00:59 +00:00
Nanang Izzuddin 6d20076196 Re #2096:
- Fixed crash in media transport when application calls detach() while the transport only implements detach2().
 - Avoid assertion in UDP media transport when calling detach() without previously calling attach().



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5750 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-06 07:42:54 +00:00
Nanang Izzuddin 4223637bd0 Fixe #2096:
- Fixed re-INVITE scenario: always generate SRTP attr in SDP re-offer/answer as both offerer/answerer (as long as SRTP is not disabled of course), currently it does not generate SRTP attr if active session does not use SRTP.
 - Fixed bug in retrieving video stream info from SDP that caused DTLS transport (UDP/TLS/RTP/SAVP) getting rejected.
 - Added pjsua app param '--srtp-keying=0/1' to choose SRTP keying to be used in the outgoing offer (0=SDES (default), 1=DTLS-SRTP).
 - Few minors, e.g: adding transport_srtp_dtls/sdes.c to pjmedia MSVC2015 project.


git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5746 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-26 07:50:18 +00:00
Nanang Izzuddin 494f58b07d Misc (re #1994): Fixed compile warnings on MSVC 2005 & 2015.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5635 74dad513-b988-da41-8d7b-12977e46ad98
2017-08-01 07:49:34 +00:00
Nanang Izzuddin c259fa68b2 Close #1999: Support OpenSSL 1.1.0 with backward compatibility setting turned of (no deprecated APIs).
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5623 74dad513-b988-da41-8d7b-12977e46ad98
2017-07-07 02:52:44 +00:00
Nanang Izzuddin ceae447b4f Re #2018: Added API pjmedia_transport_srtp_dtls_start_nego() to start DTLS-SRTP nego without SDP offer/answer.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5621 74dad513-b988-da41-8d7b-12977e46ad98
2017-07-05 05:37:24 +00:00
Nanang Izzuddin 0e6af12b9e Close #1993: Updated bundled libSRTP version to 2.1.0.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5614 74dad513-b988-da41-8d7b-12977e46ad98
2017-07-04 05:22:51 +00:00
Nanang Izzuddin d521840c98 Re #2018: Fixed compile error due to a silly mistake.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5598 74dad513-b988-da41-8d7b-12977e46ad98
2017-06-04 08:58:55 +00:00
Nanang Izzuddin edcedb569a Re #2018: Initial version of DTLS-SRTP implementation.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5597 74dad513-b988-da41-8d7b-12977e46ad98
2017-06-03 09:22:34 +00:00