summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/gss-serv.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2014-02-26 20:28:44 +0000
committerdjm <djm@openbsd.org>2014-02-26 20:28:44 +0000
commit1909bf1d410de3a057db946afe26c3e823f40be3 (patch)
tree90ea5a8a800b7c9f828825131d0a8e2bcf6decfa /usr.bin/ssh/gss-serv.c
parentbz#2205: avoid early hostname lookups unless canonicalisation is enabled; (diff)
downloadwireguard-openbsd-1909bf1d410de3a057db946afe26c3e823f40be3.tar.xz
wireguard-openbsd-1909bf1d410de3a057db946afe26c3e823f40be3.zip
bz#2107 - cache OIDs of supported GSSAPI mechanisms before privsep
sandboxing, as running this code in the sandbox can cause violations; ok markus@
Diffstat (limited to 'usr.bin/ssh/gss-serv.c')
-rw-r--r--usr.bin/ssh/gss-serv.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.bin/ssh/gss-serv.c b/usr.bin/ssh/gss-serv.c
index b4ea7c4e7ec..8974c5f780f 100644
--- a/usr.bin/ssh/gss-serv.c
+++ b/usr.bin/ssh/gss-serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gss-serv.c,v 1.25 2014/02/02 03:44:31 djm Exp $ */
+/* $OpenBSD: gss-serv.c,v 1.26 2014/02/26 20:28:44 djm Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -62,6 +62,25 @@ ssh_gssapi_mech* supported_mechs[]= {
&gssapi_null_mech,
};
+/*
+ * ssh_gssapi_supported_oids() can cause sandbox violations, so prepare the
+ * list of supported mechanisms before privsep is set up.
+ */
+static gss_OID_set supported_oids;
+
+void
+ssh_gssapi_prepare_supported_oids(void)
+{
+ ssh_gssapi_supported_oids(&supported_oids);
+}
+
+OM_uint32
+ssh_gssapi_test_oid_supported(OM_uint32 *ms, gss_OID member, int *present)
+{
+ if (supported_oids == NULL)
+ ssh_gssapi_prepare_supported_oids();
+ return gss_test_oid_set_member(ms, member, supported_oids, present);
+}
/*
* Acquire credentials for a server running on the current host.