-
-
Notifications
You must be signed in to change notification settings - Fork 187
Implement detached signal sender #56
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
base: master
Are you sure you want to change the base?
Conversation
1772198 to
6413886
Compare
|
Isn't this something that can be solved with let channel = ...
let (tx, rx) = mpsc::channel(1);
loop {
tokio::select! {
msg = channel.wait() => ...
sig = rx.recv() => channel.signal(sig)
}
}
...
tx.send(Sig::...) |
Not really, because I do not want to hold a My usecase is a map of signal senders that I can use to interrupt open connections on demand (orchestration platform). |
|
You don't need to hold the ref for that - the ref can stay in the |
Yeah, this is the ref I was talking about. It's honestly easier to have the channel return me a (scoped) sender directly than to have to create a layer of indirection that does the same thing. |
|
Can't merge this as it's a band-aid fix for one specific method that will eventually lead to duplication of every channel method. However I'm open to adding a Let me know if this is something you'd like to work on, otherwise I'll see if I can find time for it in the future. |
e803532 to
7b12f66
Compare
The `CryptoVec::resize` implementation was running into a segmentation fault in some case. If the capacity of the vector was more than 0, and that the new allocation failed, the call to `std::ptr::copy_non_overlapping` would have a null pointer as destination. This was very easy to trigger by a malicious peer, they just had to send a packet with an announced size large enough for the allocation to fail. The code now correctly panics, which would only end the current thread and not crash the whole application without giving it a chance to continue running.
Adds @elegaanz as a contributor for code. This was requested by Eugeny [in this comment](Eugeny#288 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
This worked before [this change](Eugeny@194430b#diff-81b0128d04a2d9a37bdc6931dec1cb426a8ff7c6ad4ef10e1555ca3e29f08380L159), and is permitted by the specification, as can be seen in [the example in section 3.2 of RFC8332](https://www.rfc-editor.org/rfc/rfc8332#section-3.2).
Authentication using RSA public keys was incorrectly hardcoded to use `ssh-rsa`, i.e., SHA1. This led to public keys set up to use `rsa-sha2-256` or `rsa-sha2-512` falling back to `ssh-rsa` and being rejected by modern SSH servers that are configured not to support SHA1 by default. The solution derives the hash name from the public key instead of hardcoding it.
Adds @tomknig as a contributor for code. This was requested by Eugeny [in this comment](Eugeny#294 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
7b12f66 to
19eebf1
Compare
Due to an incorrect specified array length, any combinaison of a cipher using `block.rs`and `HMAC_SHA1_ETM` such as: ``` let mut config = client::Config::default(); config.preferred.cipher = &[cipher::AES_128_CTR]; config.preferred.mac = &[mac::HMAC_SHA1_ETM]; ``` Would fail during packet auth. ``` [...] [2024-06-07T12:49:14Z DEBUG russh::cipher] reading, clear len = 276 [2024-06-07T12:49:14Z DEBUG russh::cipher] read_exact 280 [2024-06-07T12:49:14Z DEBUG russh::cipher] read_exact done [2024-06-07T12:49:14Z TRACE russh::client] disconnected [2024-06-07T12:49:14Z DEBUG russh::client] disconnected: Error(PacketAuth) [2024-06-07T12:49:14Z TRACE mio::poll] deregistering event source from poller [2024-06-07T12:49:14Z DEBUG russh::client] drop session [2024-06-07T12:49:14Z DEBUG russh::client] drop handle ``` This PR fixes that.
Adds @Barre as a contributor for code. This was requested by Eugeny [in this comment](Eugeny#298 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Adds @spoutn1k as a contributor for code. This was requested by Eugeny [in this comment](Eugeny#302 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
This PR addresses issues related to connecting to legacy Cisco devices with no upgrade path (similar to issue Eugeny#277). Changes Introduced • Refactored cipher/mod.rs: Make room to be able to implement CBC crypto support. • Updated cipher/block.rs: To provide an interface compatible with both streaming ciphers and CBC. • General Cipher Updates: Light modifications to other ciphers for compatibility with the new interface. Context I had trouble connecting to older Cisco devices which posed challenges due to their outdated cryptographic support. --------- Co-authored-by: Eugene <[email protected]>
19eebf1 to
2b289c2
Compare
- update parse logic to perform host glob matching (using globset) - generalise token expansion so it can be used to qualify hosts as well as localising ProxyCommand - add proxyjump to the config structure --------- Co-authored-by: Adam Chappell <[email protected]>
Adds @packetsource as a contributor for code. This was requested by Eugeny [in this comment](Eugeny#306 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Adds @MingweiSamuel as a contributor for code. This was requested by Eugeny [in this comment](Eugeny#499 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
added native async-trait support AspectUnk/russh-sftp#62
In this commit, I add a function to russh's client Handle that allows to manually send a keepalive message to the server. Fixes: Eugeny#507 Signed-off-by: Uli Schlachter <[email protected]>
Thank you for russh 😻 I needed to send _debug_ messages. I implemented the same way disconnect is implemented as they both are session global messages. Looking at the test suites, I did not find any appropriate place to add a test for that. One can observe the debug messages sent by a server, for instance, by activating the `-v` option of ssh client.
Adds @pgrange as a contributor for code. This was requested by Eugeny [in this comment](Eugeny#510 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
For instance, if the service can not accept any new connection, instead
of silently terminating, it will return the underlying error:
```
Os { code: 24, kind: Uncategorized, message: "Too many open files" }
```
34771f4 to
937fe2b
Compare
937fe2b to
1b150e1
Compare
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Eugene <[email protected]>
1b150e1 to
c4be1c6
Compare
Allow signals to be sent detached from the channel struct. This is done using a higher-order function and by cloning the sender so it can be used independently of the `Channel`. This is useful to be able to spawn a cancelation handler separately from the main `Channel` recieve loop. Signed-off-by: Joe Grund <[email protected]> f08f74 Signed-off-by: Joe Grund <[email protected]>
c4be1c6 to
5e77f26
Compare
Allow signals to be sent detached from the channel struct.
This is done using a higher-order function and by cloning the sender so it can be used independently of the
Channel.This is useful to be able to spawn a cancelation handler separately from the main
Channelrecieve loop.Signed-off-by: Joe Grund [email protected]