BBS:      TELESC.NET.BR
Assunto:  src/ssh/test/test_alloc.c
De:       Deuc¨
Data:     Tue, 24 Mar 2026 20:58:43 -0700
-----------------------------------------------------------
https://gitlab.synchro.net/main/sbbs/-/commit/d38dbdea06306fa9e6c96551
Modified Files:
	src/ssh/test/test_alloc.c
Log Message:
Add isolated KEX and key_algo ossl failure injection tests

New tests that iterate OpenSSL failures over just the target code,
without running full two-threaded handshakes:

- ossl/key_verify: iterate verify() alone with pre-generated
  sig+pubkey blobs. Covers EVP_DigestVerifyInit, EVP_DigestVerify,
  EVP_PKEY_new_raw_public_key (ed25519) or BN_bin2bn,
  OSSL_PARAM_BLD_*, EVP_PKEY_fromdata (RSA).

- ossl/key_pubkey: iterate pubkey() alone. Covers
  EVP_PKEY_get_raw_public_key (ed25519) or
  EVP_PKEY_get_bn_param (RSA).

- ossl/kex_server: server-side KEX handler with packet replay.
  One-time two-threaded setup (version_exchange + kexinit, ~10ms),
  then single-threaded iterate of dssh_transport_kex() with
  pre-built client packets injected via mock_io_inject().
  For curve25519: ECDH_INIT(Q_C) with random 32-byte key.
  For dh-gex: GEX_REQUEST(2048,4096,8192) + GEX_INIT(e=2).

Performance: <1ms per iteration vs ~500ms for full handshake
iterate. DH-GEX+RSA variant: 220ms total vs 22s previously.

Infrastructure: build_plaintext_packet() helper builds SSH wire
packets matching send_packet's plaintext format. ve_ki_thread()
runs version_exchange + kexinit for one-time setup.

Co-Authored-By: Claude Opus 4.6 (1M context) 
n
---
  mSynchronetn  hgVertrauen n hHome of Synchronet n gh[vert/cvs/bbs].synchro.net

-----------------------------------------------------------
[Voltar]