Content-Length: 227086 | pFad | https://github.com/paritytech/litep2p/issues/124

DA crypto/noise: Make code fault tolerant · Issue #124 · paritytech/litep2p · GitHub
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

crypto/noise: Make code fault tolerant #124

Closed
Tracked by #140
lexnv opened this issue May 28, 2024 · 0 comments · Fixed by #142
Closed
Tracked by #140

crypto/noise: Make code fault tolerant #124

lexnv opened this issue May 28, 2024 · 0 comments · Fixed by #142
Assignees

Comments

@lexnv
Copy link
Collaborator

lexnv commented May 28, 2024

Make the code a bit more robust and fault tolerant by propagating the error codes, remove unwraps and excepts, refactor to avoid errors.

let keypair = noise.generate_keypair().unwrap();

let noise = noise
.local_private_key(&keypair.private)
.prologue(&prologue)
.build_initiator()
.expect("to succeed");

let size: Result<[u8; 2], _> = reply[0..2].try_into();
let _size = u16::from_be_bytes(size.unwrap());
// TODO: buffer size
let mut inner = vec![0u8; 1024];

@lexnv lexnv self-assigned this Jun 5, 2024
lexnv added a commit that referenced this issue Jun 5, 2024
Closes: #124

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
@lexnv lexnv closed this as completed in #142 Jun 5, 2024
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 a pull request may close this issue.

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/paritytech/litep2p/issues/124

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy