Skip to content

Commit

Permalink
Check whether server pk_ok signature name is known
Browse files Browse the repository at this point in the history
The would only happen from a misbehaved server, it hits an assertion.

Fixes #285 on github
  • Loading branch information
mkj committed Mar 31, 2024
1 parent 910af60 commit 7d21cff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cli-authpubkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ void recv_msg_userauth_pk_ok() {

algotype = buf_getstring(ses.payload, &algolen);
sigtype = signature_type_from_name(algotype, algolen);
if (sigtype == DROPBEAR_SIGNATURE_NONE) {
/* Server replied with an algorithm that we didn't send */
dropbear_exit("Bad pk_ok");
}
keytype = signkey_type_from_signature(sigtype);
TRACE(("recv_msg_userauth_pk_ok: type %d", sigtype))
m_free(algotype);
Expand Down

0 comments on commit 7d21cff

Please sign in to comment.