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

Panic on parsing server config URLs #1770

Closed
link2xt opened this issue Nov 16, 2024 · 2 comments
Closed

Panic on parsing server config URLs #1770

link2xt opened this issue Nov 16, 2024 · 2 comments

Comments

@link2xt
Copy link
Contributor

link2xt commented Nov 16, 2024

There are multiple places where parsing server config from URL or just trying to parse a password panics and crashes the whole application using the library.

panic!(
"{} is expecting a {} bytes key, but password: {} ({} bytes after decode)",
method,
enc_key.len(),
password,
v.len()
);

panic!("{method} password {password} is not base64 encoded, error: {err}");

(triggered by ServerConfig::from_url("ss://2022-blake3-aes-128-gcm:XYZ@127.0.0.1:9999"))

let upsk = split_iter.next().expect("uPSK");

panic!("iPSK {ipsk} is not base64 encoded, error: {err}");

One of the cases was fixed in #1762

zonyitoo added a commit that referenced this issue Nov 16, 2024
@link2xt
Copy link
Contributor Author

link2xt commented Nov 16, 2024

let upsk = split_iter.next().expect("uPSK"); is still not fixed.

@zonyitoo
Copy link
Collaborator

It shouldn't fail. It would always be Some(..).

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

No branches or pull requests

2 participants