-
Notifications
You must be signed in to change notification settings - Fork 613
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
Implement libssh alternative #1688
Draft
Tehforsch
wants to merge
8
commits into
main
Choose a base branch
from
rust-only-ssh
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
Tehforsch
force-pushed
the
rust-only-ssh
branch
3 times, most recently
from
August 1, 2024 09:36
dc1ce98
to
9bd65bc
Compare
Tehforsch
force-pushed
the
nasl-misc-functions
branch
2 times, most recently
from
August 5, 2024 13:35
985e935
to
01ffb96
Compare
Tehforsch
force-pushed
the
rust-only-ssh
branch
from
August 5, 2024 13:37
9bd65bc
to
c77d9b5
Compare
Blocked by #1671 |
Tehforsch
force-pushed
the
rust-only-ssh
branch
from
September 18, 2024 09:06
c77d9b5
to
7542d55
Compare
Tehforsch
force-pushed
the
rust-only-ssh
branch
from
September 26, 2024 11:30
7542d55
to
18ebbfd
Compare
We can differentiate between stateful functions that take `&State` as an argument and those that take `&mut State`. By wrapping the state in the `StoredFunctionSet` in an RwLock, we can access it via read or write, depending on the function type. 1. This significantly improves ergonomics for implementing NASL functions, since the state does not need to manage its own interior mutability anymore. 2. This allows things that weren't previously possible. NASL functions could only take &State arguments. A function managing a list of connections `Vec<Connection>`, for example, would have to wrap the entire list in an `RwLock` (`RwLock<Vec<Connection>>`) in order to allow adding and deleting items of the list. With the new system, the state can simply be `Vec<Connection>` if we never need mutable access to the connection, or alternatively `Vec<RwLock<Connection>>` if we do need mutable access to the connection. This is an important step to allow true concurrency for these types of functions, since previously every single function call would block the entire state, while the new version only locks the entire state if a function call requires mutable state.
Tehforsch
force-pushed
the
rust-only-ssh
branch
from
September 26, 2024 11:30
18ebbfd
to
e8fa39b
Compare
Also add a very basic test to check the ssh_connect NASL function.
Tehforsch
force-pushed
the
rust-only-ssh
branch
from
October 1, 2024 08:52
e8fa39b
to
2b63150
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Jira: SC-1124
Todo: