config: align OpenSSH boolean, hostkey, and pubkey modes

Key Changes

  • Strict Configuration Validation: Migrates string comparison to exact strcasecmp() and introduces the PARSE_YESNO_OR_FAIL macro logic to guarantee that invalid directives (e.g. Compression yesplease) are treated as explicitly fatal SSH_ERRORs rather than falling back silently.
  • Extended StrictHostKeyChecking Modes: Parses yes, ask, accept-new, and no/off, and preserves the selected mode in session options. accept-new is implemented internally and ask remains application driven.
  • Extended PubkeyAuthentication Modes: Adds support for yes/no, unbound, and host-bound instead of collapsing it to a plain boolean.

Bug Fixes

  • Ignored Authentication Errors: Fixed a regression where malformed syntaxes for PasswordAuthentication / PubkeyAuthentication silently defaulted to 0 instead of failing.
  • accept-new Key Appending: Fixed ssh_session_get_known_hosts_entry() so SSH_STRICT_HOSTKEY_NEW writes newly learned keys to known_hosts before returning SSH_KNOWN_HOSTS_OK.

Edit: Invalid boolean values are not returned as SSH_ERROR from config parsing. They are skipped and leave the option unchanged.

Checklist

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • Code modified for feature
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated
  • The project pipelines timeout is extended at least to 2 hours.

Reviewer's checklist:

  • Any issues marked for closing are addressed
  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to CONTRIBUTING.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code
Edited by Nuhiat Arefin

Merge request reports

Loading