summaryrefslogtreecommitdiff
path: root/gss-genr.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-11-08 20:00:06 +0000
committerColin Watson <cjwatson@debian.org>2007-11-08 20:00:06 +0000
commit67d535a2fbf5ce66b56e28ca8337c2955abde102 (patch)
tree317d338a5a6dece9bf714966f9301ed41bcfc94c /gss-genr.c
parentd818766bb7e522cd5cfa5a1671d6eb9169dfc4c7 (diff)
* Fix sshd/inittab advice in README.Debian to account for rc.d movement
(closes: #450632).
Diffstat (limited to 'gss-genr.c')
-rw-r--r--gss-genr.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gss-genr.c b/gss-genr.c
index 42f942b58..6eb8e4754 100644
--- a/gss-genr.c
+++ b/gss-genr.c
@@ -44,6 +44,11 @@
44#include "kex.h" 44#include "kex.h"
45#include <openssl/evp.h> 45#include <openssl/evp.h>
46 46
47#ifdef KRB5
48# include <krb5.h>
49# include <profile.h>
50#endif /* KRB5 */
51
47#include "ssh-gss.h" 52#include "ssh-gss.h"
48 53
49extern u_char *session_id2; 54extern u_char *session_id2;
@@ -290,6 +295,32 @@ ssh_gssapi_last_error(Gssctxt *ctxt, OM_uint32 *major_status,
290void 295void
291ssh_gssapi_build_ctx(Gssctxt **ctx) 296ssh_gssapi_build_ctx(Gssctxt **ctx)
292{ 297{
298#ifdef KRB5
299 static int gss_configured = 0;
300
301 if (!gss_configured) {
302 /* Tell the GSSAPI library not to canonicalise names. */
303 krb5_context krb5_ctx;
304 profile_t profile;
305 krb5_error_code problem;
306
307 problem = krb5_init_context(&krb5_ctx);
308 if (!problem) {
309 problem = krb5_get_profile(krb5_ctx, &profile);
310 if (!problem) {
311 const char *names[3];
312 names[0] = "libdefaults";
313 names[1] = "rdns";
314 names[2] = 0;
315 profile_clear_relation(profile, names);
316 profile_add_relation(profile, names, "n");
317 }
318 }
319
320 gss_configured = 1;
321 }
322#endif /* KRB5 */
323
293 *ctx = xcalloc(1, sizeof (Gssctxt)); 324 *ctx = xcalloc(1, sizeof (Gssctxt));
294 (*ctx)->context = GSS_C_NO_CONTEXT; 325 (*ctx)->context = GSS_C_NO_CONTEXT;
295 (*ctx)->name = GSS_C_NO_NAME; 326 (*ctx)->name = GSS_C_NO_NAME;