Skip to content
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

Allow creating a connection with ufrag and pwd #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fippo
Copy link

@fippo fippo commented Mar 2, 2025

and enforce the length according to
https://datatracker.ietf.org/doc/html/rfc5245#section-15.1

This allows implementing the peerconnection with a single set of local credentials in
aiortc/aiortc#1229

and enforce the length according to
  https://datatracker.ietf.org/doc/html/rfc5245#section-15.1

This allows implementing the peerconnection with a single set
of local credentials in
  aiortc/aiortc#1229
borhandarabi pushed a commit to borhandarabi/aiortc that referenced this pull request Mar 5, 2025
@fippo
Copy link
Author

fippo commented Mar 18, 2025

@jlaine ping

Copy link

@lgrahl lgrahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested but looks good to me.

Comment on lines +320 to +326
if local_username is not None and len(local_username) not in range(4, 256):
raise ValueError("local ice username must satisfy 4*256ice-char")
#: Local username, automatically set to a random value.
self.local_username = random_string(4)
self.local_username = local_username or random_string(4)

if local_password is not None and len(local_password) not in range(22, 256):
raise ValueError("local ice password must satisfy 22*256ice-char")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len probably counts some non-ASCII symbols wrong with respect to the RFCs but why would you do that anyways, so I guess it's who cares in practice.

#: Local password, automatically set to a random value.
self.local_password = random_string(22)
self.local_password = local_password or random_string(22)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or is a bit prone to error for an empty string even though this is impossible with above checks. A more explicit assignment in the conditional would be nicer but no strong opinion here.

@lgrahl
Copy link

lgrahl commented Mar 18, 2025

Looks like the CI pipeline will need some work. I'm assuming it's because 3.7 is EOL. And we should probably add 3.12 - 3.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants