clears - #17
Merged
Merged
clears#17
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens SSH client secret-handling and host-key verification context by (a) binding host-key trust decisions to the connection endpoint (host/port) and (b) aggressively clearing credential/key material from long-lived objects after use, close, or disconnect.
Changes:
- Extend
zif_oassh_host_verifier~verifyto receiveiv_host/iv_portand thread those throughzcl_oassh→zcl_oassh_transport. - Add best-effort “clear secrets” APIs (
clear_credentials,clear_secrets,clear_pending_keys) and call them on close/disconnect and key lifecycle boundaries. - Add coverage for secret-clearing behavior and add an RSA public-exponent size guard in verification.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/zcl_oassh.clas.testclasses.abap | Adds tests for clearing secrets on close( ) and updates constructors with iv_host/iv_port. |
| src/zcl_oassh.clas.abap | Threads host/port to transport; clears credentials/secrets on close, disconnect, and post-auth start. |
| src/zcl_oassh_transport.clas.testclasses.abap | Tests endpoint forwarding to the host verifier and transport secret clearing. |
| src/zcl_oassh_transport.clas.abap | Stores host/port, passes them into verifier callback, and centralizes clearing of credentials/key material. |
| src/zcl_oassh_packet.clas.testclasses.abap | Adds unit test asserting packet crypto material is cleared. |
| src/zcl_oassh_packet.clas.abap | Introduces clear_secrets (encrypt/decrypt cleanup) and reuses it during rekey. |
| src/platform/zif_oassh_host_verifier.intf.abap | Extends verifier API to include host/port for endpoint-specific trust decisions. |
| src/crypto/zcl_oassh_rsa.clas.testclasses.abap | Adds a test for rejecting oversized RSA public exponent inputs. |
| src/crypto/zcl_oassh_rsa.clas.abap | Adds an exponent-length ceiling before expensive exponentiation. |
| src/crypto/zcl_oassh_ctr.clas.testclasses.abap | Adds unit test for CTR secret clearing. |
| src/crypto/zcl_oassh_ctr.clas.abap | Adds clear_secrets to drop schedule/counter/keystream state. |
| src/crypto/zcl_oassh_chachapoly.clas.testclasses.abap | Adds unit test for chachapoly key clearing. |
| src/crypto/zcl_oassh_chachapoly.clas.abap | Adds clear_secrets and clears a derived Poly1305 key buffer after use. |
| README.md | Documents host/port binding for host-key verification. |
| integration/socket.mjs | Passes iv_host/iv_port into ABAP client construction for integration runs. |
| examples/zoassh_example_sftp.prog.abap | Updates example verifier guidance to include host/port + key association. |
| examples/zoassh_example_exec.prog.abap | Updates example verifier guidance to include host/port + key association. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
51
to
54
| IF lv_modulus_length < 128 OR lv_modulus_length > 1024 | ||
| OR iv_e IS INITIAL OR iv_signature IS INITIAL | ||
| OR iv_e IS INITIAL OR xstrlen( iv_e ) > 32 | ||
| OR iv_signature IS INITIAL | ||
| OR lv_exponent_compare < 0 OR lv_exponent_modulus_compare >= 0. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.