summaryrefslogtreecommitdiff
path: root/usr/src/lib/libgss/g_inquire_names.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libgss/g_inquire_names.c')
-rw-r--r--usr/src/lib/libgss/g_inquire_names.c53
1 files changed, 40 insertions, 13 deletions
diff --git a/usr/src/lib/libgss/g_inquire_names.c b/usr/src/lib/libgss/g_inquire_names.c
index d24895bd90..9ee1567b33 100644
--- a/usr/src/lib/libgss/g_inquire_names.c
+++ b/usr/src/lib/libgss/g_inquire_names.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* glue routine for gss_inquire_context
*/
@@ -46,9 +43,18 @@ gss_OID_set * name_types;
OM_uint32 status;
gss_mechanism mech;
+ /* Initialize outputs. */
+
+ if (minor_status != NULL)
+ *minor_status = 0;
+
+ if (name_types != NULL)
+ *name_types = GSS_C_NO_OID_SET;
+
+ /* Validate arguments. */
+
if (minor_status == NULL)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
- *minor_status = 0;
if (name_types == NULL)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
@@ -77,6 +83,30 @@ gss_OID_set * name_types;
return (GSS_S_BAD_MECH);
}
+static OM_uint32 val_inq_mechs4name_args(
+ OM_uint32 *minor_status,
+ const gss_name_t input_name,
+ gss_OID_set *mech_set)
+{
+
+ /* Initialize outputs. */
+ if (minor_status != NULL)
+ *minor_status = 0;
+
+ if (mech_set != NULL)
+ *mech_set = GSS_C_NO_OID_SET;
+
+ /* Validate arguments. */
+
+ if (minor_status == NULL)
+ return (GSS_S_CALL_INACCESSIBLE_WRITE);
+
+ if (input_name == GSS_C_NO_NAME)
+ return (GSS_S_BAD_NAME);
+
+ return (GSS_S_COMPLETE);
+}
+
OM_uint32
gss_inquire_mechs_for_name(minor_status, input_name, mech_set)
@@ -95,12 +125,9 @@ gss_OID_set * mech_set;
gss_buffer_desc name_buffer;
int i;
- if (minor_status == NULL)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
- *minor_status = 0;
-
- if (input_name == NULL)
- return (GSS_S_BAD_NAME);
+ status = val_inq_mechs4name_args(minor_status, input_name, mech_set);
+ if (status != GSS_S_COMPLETE)
+ return (status);
status = gss_create_empty_oid_set(minor_status, mech_set);
if (status != GSS_S_COMPLETE)