summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-03-26 20:37:24 -0400
committerSimo Sorce <simo@redhat.com>2013-03-27 10:30:35 -0400
commit1d6400f2ac9d0268b87d0910853e328b7ca840e6 (patch)
tree41478ed739ea89c6346b92634f12ac343424780f
parentcc2a2e800995b587c88776a76de096d38eb82229 (diff)
downloadgss-proxy-1d6400f2ac9d0268b87d0910853e328b7ca840e6.tar.gz
gss-proxy-1d6400f2ac9d0268b87d0910853e328b7ca840e6.tar.xz
gss-proxy-1d6400f2ac9d0268b87d0910853e328b7ca840e6.zip
Add helper function to check for krb5 oid
The krb5 mechanism supports multiple oids for historical reasons. Add a function to generically check if a mech oid is any of the krb5 mechanism known oids for functions that do not care which exact oid is being used of the krb5 family. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
-rw-r--r--proxy/src/mechglue/gss_plugin.c14
-rw-r--r--proxy/src/mechglue/gss_plugin.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gss_plugin.c b/proxy/src/mechglue/gss_plugin.c
index 744965e..5713320 100644
--- a/proxy/src/mechglue/gss_plugin.c
+++ b/proxy/src/mechglue/gss_plugin.c
@@ -560,3 +560,17 @@ uint32_t gpp_copy_oid(uint32_t *minor, gss_OID in, gss_OID *out)
*minor = 0;
return GSS_S_COMPLETE;
}
+
+bool gpp_is_krb5_oid(const gss_OID mech)
+{
+ if (gss_oid_equal(&gpoid_krb5, mech)) {
+ return true;
+ } else if (gss_oid_equal(&gpoid_krb5_old, mech)) {
+ return true;
+ } else if (gss_oid_equal(&gpoid_krb5_wrong, mech)) {
+ return true;
+ } else if (gss_oid_equal(&gpoid_iakerb, mech)) {
+ return true;
+ }
+ return false;
+}
diff --git a/proxy/src/mechglue/gss_plugin.h b/proxy/src/mechglue/gss_plugin.h
index de8e7be..26e04c5 100644
--- a/proxy/src/mechglue/gss_plugin.h
+++ b/proxy/src/mechglue/gss_plugin.h
@@ -86,6 +86,7 @@ uint32_t gpp_wrap_sec_ctx_token(uint32_t *minor, gss_OID mech_type,
uint32_t gpp_remote_to_local_ctx(uint32_t *minor, gssx_ctx **remote_ctx,
gss_ctx_id_t *local_ctx);
uint32_t gpp_copy_oid(uint32_t *minor, gss_OID in, gss_OID *out);
+bool gpp_is_krb5_oid(const gss_OID mech);
uint32_t gpp_name_to_local(uint32_t *minor, gssx_name *name,
gss_OID mech_type, gss_name_t *mech_name);
uint32_t gpp_local_to_name(uint32_t *minor,