-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement handling of non-actpass setup in offers #1090
Merged
jlaine
merged 1 commit into
aiortc:main
from
fippo:active-passive-who-is-not-confused-by-this
May 20, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -928,6 +928,8 @@ async def setRemoteDescription( | |||
iceTransport._role_set = True | ||||
|
||||
# set DTLS role | ||||
if description.type == "offer" and media.dtls.role == "client": | ||||
dtlsTransport._set_role(role="server") | ||||
if description.type == "answer": | ||||
dtlsTransport._set_role( | ||||
role="server" if media.dtls.role == "client" else "client" | ||||
|
@@ -1273,8 +1275,6 @@ def __validate_description( | |||
raise ValueError("ICE username fragment or password is missing") | ||||
|
||||
# check DTLS role is allowed | ||||
fippo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
if description.type == "offer" and media.dtls.role != "auto": | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to also remove raising error in aiortc/src/aiortc/rtcpeerconnection.py Line 1277 in e9c13ea
|
||||
raise ValueError("DTLS setup attribute must be 'actpass' for an offer") | ||||
if description.type in ["answer", "pranswer"] and media.dtls.role not in [ | ||||
"client", | ||||
"server", | ||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw what role do we end up with when none of these conditionals match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto
which I hope means "determined by who wins ICE"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand why we are only handling
media.dtls.role == "client"
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the handling of offers so the existing code assumes actpass. Lets see if I can prove that by adding more tests because who does not like more tests ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I suspected... the current code assumes role=auto in SRD. Which is not quite correct since auto means "determined by DTLS" whereas when we parse actpass we should be setting this to "client" explicitly. This is currently done in createAnswer which is a bit confusing but ok.