Authctxt

Andreas Gaupmann andreas.gaupmann at gmx.net
Wed Apr 13 16:47:14 EST 2005


Hello!

I have been reading through the OpenSSH 4.0p code. There exist two globals
called "Authctxt". One is defined in sshconnect2.c (type 1) and the other in
auth.h (type 2). Both are structs with different members. Nevertheless, they
are used seemingly interchangeably, e.g.:

In line 302 of sshconnect2.c the function "userauth_none" is called:

userauth_none(&authctxt);

The referred authctxt is of type 1. sshconnect2.c does not include auth.h.
"userauth_none" is defined in auth2-none.c. In that function the passed
authctxt is accessd like a struct from type 2.
In line 114 of auth2-none.c the member "pw" is accessed:

if (check_nt_auth(1, authctxt->pw) == 0)

"pw" is defined in type 2 only. In type 1 there is no "pw". Furthermore,
"userauth_none" eventually calls "auth_password". In this function the same
type 1 is passed and used as type 2.

This all seems odd to me. What do I understand wrong? Any help on this is
appreciated.

Cheers
Andreas




More information about the openssh-unix-dev mailing list