config: align OpenSSH boolean, hostkey, and pubkey modes
Key Changes
- Strict Configuration Validation: Migrates string comparison to exact
strcasecmp()and introduces thePARSE_YESNO_OR_FAILmacro logic to guarantee that invalid directives (e.g.Compression yesplease) are treated as explicitly fatalSSH_ERRORs rather than falling back silently. - Extended
StrictHostKeyCheckingModes: Parsesyes,ask,accept-new, andno/off, and preserves the selected mode in session options.accept-newis implemented internally andaskremains application driven. - Extended
PubkeyAuthenticationModes: Adds support foryes/no,unbound, andhost-boundinstead of collapsing it to a plain boolean.
Bug Fixes
- Ignored Authentication Errors: Fixed a regression where malformed syntaxes for
PasswordAuthentication/PubkeyAuthenticationsilently defaulted to0instead of failing. accept-newKey Appending: Fixedssh_session_get_known_hosts_entry()soSSH_STRICT_HOSTKEY_NEWwrites newly learned keys toknown_hostsbefore returningSSH_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