-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update dependency versions #1265
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3cfb2a4
Update versions of many dependencies
rschulman 7d1ee0a
Bump version of rand
rschulman dbd225f
Updates for changed APIs in rand, ring, and webpki
rschulman ff1c3a3
Replace references to `snow::Session`
rschulman acb6f84
Add precise type for UnparsedPublicKey
rschulman a519e0a
Update data structures/functions to match new snow's API
rschulman 20e6e81
Delete diff.diff
rschulman a252835
Merge branch 'master' into master
rschulman 11bed9c
Remove commented lines in identity/rsa.rs
rschulman e701a52
Bump libsecp256k1 to 0.3.1
rschulman 8840980
Merge changes from upstream
rschulman fc7afa2
Merge branch 'master' into master
tomaka 6ad8be1
Merge branch 'master' into master
tomaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,7 @@ pub mod handshake; | |||||
| use futures::Poll; | ||||||
| use log::{debug, trace}; | ||||||
| use snow; | ||||||
| use snow::error::{StateProblem, Error as SnowError}; | ||||||
| use std::{fmt, io}; | ||||||
| use tokio_io::{AsyncRead, AsyncWrite}; | ||||||
|
|
||||||
|
|
@@ -55,12 +56,48 @@ impl Buffer { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| /// A passthrough enum for the two kinds of state machines in `snow` | ||||||
rschulman marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| pub(crate) enum SnowState { | ||||||
|
Contributor
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.
Suggested change
|
||||||
| Transport(snow::TransportState), | ||||||
| Handshake(snow::HandshakeState) | ||||||
| } | ||||||
|
|
||||||
| impl SnowState { | ||||||
| pub fn read_message(&mut self, message: &[u8], payload: &mut [u8]) -> Result<usize, SnowError> { | ||||||
| match self { | ||||||
| SnowState::Handshake(session) => session.read_message(message, payload), | ||||||
| SnowState::Transport(session) => session.read_message(message, payload), | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| pub fn write_message(&mut self, message: &[u8], payload: &mut [u8]) -> Result<usize, SnowError> { | ||||||
| match self { | ||||||
| SnowState::Handshake(session) => session.write_message(message, payload), | ||||||
| SnowState::Transport(session) => session.write_message(message, payload), | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| pub fn get_remote_static(&self) -> Option<&[u8]> { | ||||||
| match self { | ||||||
| SnowState::Handshake(session) => session.get_remote_static(), | ||||||
| SnowState::Transport(session) => session.get_remote_static(), | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| pub fn into_transport_mode(self) -> Result<snow::TransportState, SnowError> { | ||||||
| match self { | ||||||
| SnowState::Handshake(session) => session.into_transport_mode(), | ||||||
| SnowState::Transport(_) => Err(SnowError::State(StateProblem::HandshakeAlreadyFinished)), | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| /// A noise session to a remote. | ||||||
| /// | ||||||
| /// `T` is the type of the underlying I/O resource. | ||||||
| pub struct NoiseOutput<T> { | ||||||
| io: T, | ||||||
| session: snow::Session, | ||||||
| session: SnowState, | ||||||
| buffer: Buffer, | ||||||
| read_state: ReadState, | ||||||
| write_state: WriteState | ||||||
|
|
@@ -76,9 +113,10 @@ impl<T> fmt::Debug for NoiseOutput<T> { | |||||
| } | ||||||
|
|
||||||
| impl<T> NoiseOutput<T> { | ||||||
| fn new(io: T, session: snow::Session) -> Self { | ||||||
| fn new(io: T, session: SnowState) -> Self { | ||||||
| NoiseOutput { | ||||||
| io, session, | ||||||
| io, | ||||||
| session, | ||||||
| buffer: Buffer { inner: Box::new([0; TOTAL_BUFFER_LEN]) }, | ||||||
| read_state: ReadState::Init, | ||||||
| write_state: WriteState::Init | ||||||
|
|
||||||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.