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
Andreas Gaupmann wrote:> 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.They are used consistently in client vs server code. E.g auth.c is server-only, whereas sshconnect2.c is client-only. I don't think that a struct Authctxt is used anywhere in the shared (libssh.a) code. -d
Well, as Damien Miller pointed out: type 1 is used in the client code and type 2 in the server code. So they are not mixed up. The same is true for the functions "userauth_none". One is defined in sshconnect2.c on line 710 (client) the other in auth2-none.c on line 108 (server). Annoyingly, I missed that. So, has anyone some pointers to documents describing the structure and design of the code in more detail than the (obsolete) OVERVIEW file or the general drafts (or RFCs)? Cheers Andreas
Andreas Gaupmann wrote:> Well, as Damien Miller pointed out: type 1 is used in the client code and > type 2 in the server code. So they are not mixed up. The same is true for > the functions "userauth_none". One is defined in sshconnect2.c on line 710 > (client) the other in auth2-none.c on line 108 (server). Annoyingly, I > missed that. > > So, has anyone some pointers to documents describing the structure and > design of the code in more detail than the (obsolete) OVERVIEW file or the > general drafts (or RFCs)?The internet-drafts are essential reading, apart from this, the archive of this list has had a couple of explanations over the years. -d