Skip to content

clears - #17

Merged
larshp merged 2 commits into
mainfrom
hvam/crypto1507
Jul 15, 2026
Merged

larshp merged 2 commits into
mainfrom
hvam/crypto1507

Conversation

@larshp

@larshp larshp commented Jul 15, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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~verify to receive iv_host/iv_port and thread those through zcl_oasshzcl_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.
Comment thread src/zcl_oassh.clas.abap
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@larshp
larshp merged commit 60d06d0 into main Jul 15, 2026
16 checks passed
@larshp
larshp deleted the hvam/crypto1507 branch July 15, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants