2010-05-19 22:22:17 +04:00
|
|
|
#ifndef PUTTY_SSHGSSC_H
|
|
|
|
#define PUTTY_SSHGSSC_H
|
|
|
|
#include "putty.h"
|
|
|
|
#ifndef NO_GSSAPI
|
|
|
|
|
|
|
|
#include "pgssapi.h"
|
|
|
|
#include "sshgss.h"
|
|
|
|
|
|
|
|
typedef struct gssapi_ssh_gss_ctx {
|
|
|
|
OM_uint32 maj_stat;
|
|
|
|
OM_uint32 min_stat;
|
|
|
|
gss_ctx_id_t ctx;
|
Support GSS key exchange, for Kerberos 5 only.
This is a heavily edited (by me) version of a patch originally due to
Nico Williams and Viktor Dukhovni. Their comments:
* Don't delegate credentials when rekeying unless there's a new TGT
or the old service ticket is nearly expired.
* Check for the above conditions more frequently (every two minutes
by default) and rekey when we would delegate credentials.
* Do not rekey with very short service ticket lifetimes; some GSSAPI
libraries may lose the race to use an almost expired ticket. Adjust
the timing of rekey checks to try to avoid this possibility.
My further comments:
The most interesting thing about this patch to me is that the use of
GSS key exchange causes a switch over to a completely different model
of what host keys are for. This comes from RFC 4462 section 2.1: the
basic idea is that when your session is mostly bidirectionally
authenticated by the GSSAPI exchanges happening in initial kex and
every rekey, host keys become more or less vestigial, and their
remaining purpose is to allow a rekey to happen if the requirements of
the SSH protocol demand it at an awkward moment when the GSS
credentials are not currently available (e.g. timed out and haven't
been renewed yet). As such, there's no need for host keys to be
_permanent_ or to be a reliable identifier of a particular host, and
RFC 4462 allows for the possibility that they might be purely
transient and only for this kind of emergency fallback purpose.
Therefore, once PuTTY has done a GSS key exchange, it disconnects
itself completely from the permanent host key cache functions in
storage.h, and instead switches to a _transient_ host key cache stored
in memory with the lifetime of just that SSH session. That cache is
populated with keys received from the server as a side effect of GSS
kex (via the optional SSH2_MSG_KEXGSS_HOSTKEY message), and used if
later in the session we have to fall back to a non-GSS key exchange.
However, in practice servers we've tested against do not send a host
key in that way, so we also have a fallback method of populating the
transient cache by triggering an immediate non-GSS rekey straight
after userauth (reusing the code path we also use to turn on OpenSSH
delayed encryption without the race condition).
2018-04-26 09:18:59 +03:00
|
|
|
time_t expiry;
|
2010-05-19 22:22:17 +04:00
|
|
|
} gssapi_ssh_gss_ctx;
|
|
|
|
|
|
|
|
void ssh_gssapi_bind_fns(struct ssh_gss_library *lib);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
int ssh_gssapi_init(void);
|
|
|
|
|
|
|
|
#endif /*NO_GSSAPI*/
|
|
|
|
|
|
|
|
#endif /*PUTTY_SSHGSSC_H*/
|