components/openssh/patches/044-gss_use_default_ccache.patch
author Vladimir Marek <Vladimir.Marek@oracle.com>
Mon, 25 Jul 2016 13:45:37 +0200
changeset 6475 abfc9174d2f0
parent 6187 6a58453cea53
child 7649 69d7508f0d66
permissions -rw-r--r--
24006594 vim removes complex ACLs with backupcopy=yes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6187
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     1
diff -pur old/gss-serv.c new/gss-serv.c
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     2
--- old/gss-serv.c
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     3
+++ new/gss-serv.c
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     4
@@ -49,6 +49,8 @@
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     5
 #include "ssh-gss.h"
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     6
 #include "monitor_wrap.h"
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     7
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     8
+#include <gssapi/gssapi_ext.h>
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     9
+
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    10
 extern ServerOptions options;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    11
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    12
 static ssh_gssapi_client gssapi_client =
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    13
@@ -345,16 +347,17 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_g
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    14
 void
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    15
 ssh_gssapi_cleanup_creds(void)
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    16
 {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    17
-#ifdef USE_GSS_STORE_CRED
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    18
-	debug("removing gssapi cred file not implemented");
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    19
-#else
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    20
+	if (options.gss_use_default_ccache == 1) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    21
+		debug("removing default gssapi cred cache file "
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    22
+		    "on session cleanup not supported");
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    23
+		return;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    24
+	}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    25
 	if (gssapi_client.store.filename != NULL) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    26
 		/* Unlink probably isn't sufficient */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    27
 		debug("removing gssapi cred file\"%s\"",
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    28
 		    gssapi_client.store.filename);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    29
 		unlink(gssapi_client.store.filename);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    30
 	}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    31
-#endif /* USE_GSS_STORE_CRED */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    32
 }
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    33
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    34
 /* As user */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    35
@@ -363,14 +366,53 @@ ssh_gssapi_storecreds(void)
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    36
 {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    37
 #ifdef USE_GSS_STORE_CRED
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    38
 	OM_uint32 maj_status, min_status;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    39
+	ssh_gssapi_ccache *store = &gssapi_client.store;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    40
+	int tmpfd;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    41
+	gss_key_value_set_desc cred_store;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    42
+	gss_key_value_element_desc elem;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    43
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    44
 	if (gssapi_client.creds == NULL) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    45
 		debug("No credentials stored");
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    46
 		return;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    47
 	}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    48
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    49
-	maj_status = gss_store_cred(&min_status, gssapi_client.creds,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    50
-	    GSS_C_INITIATE, &gssapi_client.mech->oid, 1, 1, NULL, NULL);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    51
+	/* optionally storing creds to per-session ccache */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    52
+	if (options.gss_use_default_ccache == 0) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    53
+		if (asprintf(&store->envval,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    54
+		    "FILE:/tmp/krb5cc_%d_XXXXXX", geteuid()) == -1) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    55
+			logit("ssh_gssapi_storecreds(): out of memory");
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    56
+			return;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    57
+		}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    58
+		store->filename = store->envval + strlen("FILE:");
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    59
+		store->envvar = "KRB5CCNAME";
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    60
+
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    61
+		if ((tmpfd = mkstemp(store->filename)) == -1) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    62
+			logit("mkstemp(): %.100s", strerror(errno));
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    63
+			free(store->envval);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    64
+			memset(store, 0, sizeof (ssh_gssapi_ccache));
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    65
+			return;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    66
+		}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    67
+		if (fchmod(tmpfd, S_IRUSR | S_IWUSR) == -1) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    68
+			logit("fchmod(): %.100s", strerror(errno));
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    69
+			unlink(store->filename);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    70
+			free(store->envval);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    71
+			memset(store, 0, sizeof (ssh_gssapi_ccache));
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    72
+			close(tmpfd);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    73
+			return;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    74
+		}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    75
+		close(tmpfd);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    76
+
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    77
+		cred_store.count = 1;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    78
+		cred_store.elements = &elem;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    79
+		elem.key = "ccache";
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    80
+		elem.value = store->filename;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    81
+		maj_status = gss_store_cred_into(&min_status,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    82
+		    gssapi_client.creds, GSS_C_INITIATE, 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    83
+		    &gssapi_client.mech->oid, 1, 1, &cred_store, NULL, NULL);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    84
+	} else {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    85
+		maj_status = gss_store_cred(&min_status, gssapi_client.creds,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    86
+		    GSS_C_INITIATE, &gssapi_client.mech->oid, 1, 1, NULL, NULL);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    87
+	}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    88
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    89
 	if (GSS_ERROR(maj_status)) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    90
 		Buffer b;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    91
@@ -398,7 +440,17 @@ ssh_gssapi_storecreds(void)
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    92
 		error("GSS-API error while storing delegated credentials: %s",
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    93
 		    buffer_ptr(&b));
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    94
 		buffer_free(&b);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    95
+		if (options.gss_use_default_ccache == 0) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    96
+			unlink(store->filename);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    97
+			free(store->envval);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    98
+			memset(store, 0, sizeof (ssh_gssapi_ccache));
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    99
+		}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   100
+		return;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   101
 	}
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   102
+
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   103
+	if (options.gss_use_default_ccache == 0)
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   104
+		do_pam_putenv(store->envvar, store->envval);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   105
+
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   106
 #else	/* #ifdef USE_GSS_STORE_CRED */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   107
 	if (gssapi_client.mech && gssapi_client.mech->storecreds) {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   108
 		(*gssapi_client.mech->storecreds)(&gssapi_client);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   109
diff -pur old/servconf.c new/servconf.c
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   110
--- old/servconf.c
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   111
+++ new/servconf.c
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   112
@@ -170,6 +170,7 @@ initialize_server_options(ServerOptions
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   113
 	options->ip_qos_bulk = -1;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   114
 	options->version_addendum = NULL;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   115
 	options->fingerprint_hash = -1;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   116
+	options->gss_use_default_ccache = -1;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   117
 #ifdef PAM_ENHANCEMENT
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   118
 	options->pam_service_name = NULL;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   119
 	options->pam_service_prefix = NULL;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   120
@@ -391,6 +392,8 @@ fill_default_server_options(ServerOption
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   121
 		options->fwd_opts.streamlocal_bind_unlink = 0;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   122
 	if (options->fingerprint_hash == -1)
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   123
 		options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   124
+	if (options->gss_use_default_ccache == -1)
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   125
+		options->gss_use_default_ccache = 1;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   126
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   127
 	assemble_algorithms(options);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   128
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   129
@@ -483,7 +486,7 @@ typedef enum {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   130
 	sAuthorizedKeysCommand, sAuthorizedKeysCommandUser,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   131
 	sAuthenticationMethods, sHostKeyAgent, sPermitUserRC,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   132
 	sStreamLocalBindMask, sStreamLocalBindUnlink,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   133
-	sAllowStreamLocalForwarding, sFingerprintHash,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   134
+	sAllowStreamLocalForwarding, sFingerprintHash, sGssUseDefaultCCache,
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   135
 	sDeprecated, sUnsupported
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   136
 } ServerOpCodes;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   137
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   138
@@ -548,11 +551,7 @@ static struct {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   139
 	{ "gssauthentication", sGssAuthentication, SSHCFG_ALL },   /* alias */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   140
 	{ "gssapikeyexchange", sGssKeyEx, SSHCFG_ALL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   141
 	{ "gsskeyex", sGssKeyEx, SSHCFG_ALL },                     /* alias */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   142
-#ifdef USE_GSS_STORE_CRED
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   143
-	{ "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   144
-#else /* USE_GSS_STORE_CRED */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   145
  	{ "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   146
-#endif /* USE_GSS_STORE_CRED */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   147
 	{ "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   148
 #else
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   149
 	{ "gssapiauthentication", sUnsupported, SSHCFG_ALL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   150
@@ -664,6 +663,7 @@ static struct {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   151
 	{ "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   152
 	{ "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   153
 	{ "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   154
+	{ "gssapiusedefaultccache", sGssUseDefaultCCache, SSHCFG_GLOBAL },
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   155
 	{ NULL, sBadOption, 0 }
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   156
 };
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   157
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   158
@@ -1359,6 +1359,10 @@ process_server_config_line(ServerOptions
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   159
 		intptr = &options->gss_strict_acceptor;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   160
 		goto parse_flag;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   161
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   162
+	case sGssUseDefaultCCache:
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   163
+		intptr = &options->gss_use_default_ccache;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   164
+		goto parse_flag;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   165
+
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   166
 	case sPasswordAuthentication:
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   167
 		intptr = &options->password_authentication;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   168
 		goto parse_flag;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   169
@@ -2436,6 +2440,7 @@ dump_config(ServerOptions *o)
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   170
 	dump_cfg_fmtint(sAllowStreamLocalForwarding, o->allow_streamlocal_forwarding);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   171
 	dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   172
 	dump_cfg_fmtint(sFingerprintHash, o->fingerprint_hash);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   173
+	dump_cfg_fmtint(sGssUseDefaultCCache, o->gss_use_default_ccache);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   174
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   175
 	/* string arguments */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   176
 	dump_cfg_string(sPidFile, o->pid_file);
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   177
diff -pur old/servconf.h new/servconf.h
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   178
--- old/servconf.h
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   179
+++ new/servconf.h
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   180
@@ -206,6 +206,7 @@ typedef struct {
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   181
 #endif
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   182
         
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   183
 	int	fingerprint_hash;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   184
+	int	gss_use_default_ccache;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   185
 }       ServerOptions;
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   186
 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   187
 /* Information about the incoming connection as used by Match */
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   188
diff -pur old/sshd_config.5 new/sshd_config.5
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   189
--- old/sshd_config.5
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   190
+++ new/sshd_config.5
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   191
@@ -640,6 +640,18 @@ Specifies whether to automatically destr
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   192
 on logout.
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   193
 The default is
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   194
 .Dq yes .
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   195
+.It Cm GSSAPIUseDefaultCCache
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   196
+Specifies whether delegated GSSAPI credentials are stored in default credential
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   197
+cache file (eg. /tmp/krb5cc_100 for a user with UID 100) or in per-session
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   198
+non-default credential cache (eg.  /tmp/krb5cc_100_HwGrDC).  Tickets in
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   199
+non-default credential cache are not directly usable for accessing
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   200
+krb5-protected NFS shares.  Non-default credential cache can be destroyed on
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   201
+logout based on 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   202
+.Cm GSSAPICleanupCredentials 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   203
+setting however default credential
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   204
+caches are never automatically destroyed by sshd on session logout.
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   205
+The default is 
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   206
+.Dq yes .
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   207
 .It Cm GSSAPIStrictAcceptorCheck
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   208
 Determines whether to be strict about the identity of the GSSAPI acceptor
6a58453cea53 PSARC/2016/348 GSSAPIUseDefaultCCache: Per-session GSS-API credentials in OpenSSH
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   209
 a client authenticates against.