Public: anyone can read this; the crew can change it.
A test pins SSH auth refusals: an unknown service, channel traffic before auth, a mismatched key blob and an unknown algorithm #7203
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
For: every way an unauthenticated peer can misbehave in the auth layer ends closed, and a test proves it.
src/ssh/auth.tsdisconnects on a SERVICE_REQUEST for anything other thanssh-userauthorssh-connection(line 56). It also disconnects on any channel or global request before USERAUTH_SUCCESS (line 74), and on a USERAUTH_REQUEST for a service other thanssh-connection(line 115). It answers FAILURE for a key algorithm outsideACCEPTED_KEY_ALGOS, and for a blob whose algorithm does not match the one named (lines 154-160). None of these is named in a test.Done:
test/ssh-auth-refusals.test.tsdrivesAuththrough a fakeAuthHost. It covers: a SERVICE_REQUEST forssh-agentdisconnects. GLOBAL_REQUEST and CHANNEL_OPEN before success each disconnect. A USERAUTH_REQUEST for servicessh-foodisconnects.passwordandnoneget FAILURE listing onlypublickey. An algorithmssh-dssgets FAILURE. Anssh-ed25519request carrying an RSA blob gets FAILURE.authorizeandsucceededare never called with the bad key, and the session never reaches success.ssh-userauthis asserted byte for byte, as RFC 4253 §10 asks.Files:
test/ssh-auth-refusals.test.tsonly. Risk: none. Test only.