BBS:      TELESC.NET.BR
Assunto:  src/ssh/ssh-trans.c src/ssh/test/dssh_test_internal.h test_algo_key.c
De:       Deuc¨
Data:     Tue, 24 Mar 2026 20:58:43 -0700
-----------------------------------------------------------
https://gitlab.synchro.net/main/sbbs/-/commit/d0d4f7f9dffc633a265ea1d1
Modified Files:
	src/ssh/ssh-trans.c src/ssh/test/dssh_test_internal.h test_algo_key.c test_conn.c test_transport.c
Log Message:
Add defensive guard coverage tests (32 new tests)

Test all defense-in-depth branches that were previously uncovered:

Registration guards (test_transport.c, 9 tests):
- kex/comp/lang toolong: name > 64 chars  DSSH_ERROR_TOOLONG
- kex/key_algo/enc/mac/comp/lang toomany: entries == SIZE_MAX

Blocksize + cleanup guards (test_transport.c, 2 tests):
- tx_block_size/rx_block_size clamp blocksize < 8 to minimum 8
  (made DSSH_TESTABLE for direct testing)
- transport_cleanup with NULL cleanup function pointers

Key algo guards (test_algo_key.c, 6 tests):
- ed25519/rsa haskey(NULL)  false
- ed25519/rsa cleanup(NULL)  no-op
- ed25519/rsa get_pub_str with bufsz too small  DSSH_ERROR_TOOLONG

Connection state guards (test_conn.c, 16 tests):
- session_write/write_ext with !open and close_received
- channel_write with !open and close_received
- channel_read on empty raw queue
- channel_poll with eof_received and close_received
- session_poll with close_received on READ and READEXT
- stdout/stderr signal mark already consumed
- channel_poll/session_poll with timeout_ms=-1 (infinite wait,
  data already ready)
- session_read_ext on empty stderr buffer

Total missed branches: 443  414 (82.41%  83.56%).

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

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