Add: more socket ssl builtin functions#2217
Open
jjnicola wants to merge 7 commits into
Open
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
Tehforsch
requested changes
May 26, 2026
Comment on lines
+81
to
+89
|
|
||
| // pub fn get_tls_ticket (&self) -> &[u8] { | ||
| // let mut unique_binding = [0u8; 32]; | ||
| // if let Some(conn) = self.tls { | ||
| // return conn.export_keying_material(&mut unique_binding, b"", None).unwrap(); | ||
| // } | ||
| // &[] | ||
| // | ||
| // } |
|
|
||
| #[derive(Debug)] | ||
| pub struct MemoryKeyLogger { | ||
| // Usamos Arc<Mutex<>> para que sea seguro modificarlo entre hilos |
Contributor
There was a problem hiding this comment.
As much as I am for the diversification of our code base, we should probably translate this :D
Comment on lines
+72
to
+91
| //#[derive(Debug)] | ||
| //pub struct SessionIdLogger{ | ||
| // pub storage: Arc<Mutex<Vec<String>>>, | ||
| //} | ||
| // | ||
| //impl KeyLog for SessionIdLogger { | ||
| // fn log(&self, label: &str, client_random: &[u8], _secret: &[u8]) { | ||
| // // Only log on the first handshake secret message to avoid duplicate log noise | ||
| // if label == "CLIENT_HANDSHAKE_TRAFFIC_SECRET" || label == "CLIENT_RANDOM" { | ||
| // // Format bytes as a hex string for easy readability in your log aggregator | ||
| // let session_hex: String = client_random | ||
| // .iter() | ||
| // .map(|b| format!("{:02x}", b)) | ||
| // .collect(); | ||
| // if let Ok(mut lock) = self.storage.lock() { | ||
| // lock.push(session_hex); | ||
| // } | ||
| // } | ||
| // } | ||
| //} |
| if label == "CLIENT_HANDSHAKE_TRAFFIC_SECRET" { | ||
| let session_hex: String = client_random.iter().map(|b| format!("{:02x}", b)).collect(); | ||
|
|
||
| // Bloqueamos el Mutex temporalmente para añadir el ID a la lista |
| sock: Socket, | ||
| tls: Option<ClientConnection>, | ||
| transport: Option<OpenvasEncaps>, | ||
| session_id: Arc<Mutex<Vec<String>>>, |
Contributor
There was a problem hiding this comment.
I don't understand the data structure here, why is this a Vec?
Tehforsch
requested changes
Jun 24, 2026
|
|
||
| #[nasl_function(named(socket))] | ||
| async fn socket_get_ssl_ciphersuite( | ||
| nasl_sockets: &mut NaslSockets, |
Contributor
There was a problem hiding this comment.
Why is this &mut here? Feels like we should be able to change this to &NaslSockets and use get_open_socket below.
Doesn't look to relevant right now, but this might be something blocking concurrency once we introduce it properly
|
|
||
| #[nasl_function(named(socket))] | ||
| async fn socket_get_ssl_session_id( | ||
| nasl_sockets: &mut NaslSockets, |
Tehforsch
previously approved these changes
Jun 25, 2026
Returns the integer corresponding to the openvas encapsulation type
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
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.
What:
Add:
Fix:
SC-1450
SC-1447
SC-1449
Why:
How:
Checklist: