status->major = GSS_S_CALL_INACCESSIBLE_READ;
return(1);
}
+ else
+ {
+ OM_uint32 maj;
+ OM_uint32 min;
+ gss_buffer_desc printable;
+ gss_OID nametype;
+
+ maj = gss_display_name(&min, target_name, &printable, &nametype);
+
+ fprintf(stderr, "target_name:\n");
+ fprintf(stderr, " value: %s\n", (char *)(printable.value) );
+ fprintf(stderr, " nametype: [ length: %u, elements: %s ]\n",
+ nametype->length,
+ (char *)(nametype->elements));
+ }
if (mech_type == NULL)
{
OM_uint32 maj = 0;
OM_uint32 min = 0;
gss_buffer_desc spnego_str;
+
+ char *elems;
spnego_str.value = "1.3.6.1.5.5.2";
spnego_str.length = 13;
mech_type = (gss_OID)malloc(sizeof(gss_OID_desc));
maj = gss_str_to_oid(&min, &spnego_str, &mech_type);
+
+ elems = (char *)malloc(mech_type->length + 1);
+ strncpy(elems, (char *)(mech_type->elements), mech_type->length);
+ elems[mech_type->length] = '\0';
fprintf(stderr, "str_to_oid major/minor %u/%u\n", maj, min);
fprintf(stderr, "mech_type: [length: %u, elements: %s]\n",
mech_type->length,
- (char *)(mech_type->elements));
+ elems);
}
- mech_type = GSS_C_NO_OID;
/* Main processing */
&ret_flags,
&time_rec);
- if (status->minor != 0)
+ if (status->major != 0)
{
- fprintf(stderr, "minor status is: %d/%s\n", status->minor, strerror(status->minor));
+ OM_uint32 maj;
+ OM_uint32 min;
+ OM_uint32 context = 0;
+ gss_buffer_desc statbuf;
+
+ fprintf(stderr, "major status is: 0x%x\n", status->major);
+ do {
+ maj = gss_display_status(&min, status->major, GSS_C_GSS_CODE,
+ mech_type, &context, &statbuf);
+ fprintf(stderr, "Major status: %s\n", (char *)(statbuf.value));
+ } while(context != 0);
+
if (actual_mech_type == NULL)
fprintf(stderr, "actual mech type is NULL.\n");
else
}
}
+ if (status->minor != 0)
+ {
+ OM_uint32 maj;
+ OM_uint32 min;
+ OM_uint32 context = 0;
+ gss_buffer_desc statbuf;
+
+ fprintf(stderr, "minor status is: %d/%s\n", status->minor, strerror(status->minor));
+ do {
+ maj = gss_display_status(&min, status->minor, GSS_C_MECH_CODE,
+ mech_type, &context, &statbuf);
+ fprintf(stderr, "Minor status: %s\n", (char *)(statbuf.value));
+ } while(context != 0);
+ }
return(0);
}
minStatus = new ctypes.uint32_t(0);
var majStatus;
- myDump("Abotut to str_to_oid");
+ myDump("Abotut to str_to_oid: " + oid_str);
majStatus = gss_str_to_oid(
minStatus.address(),
buffer.address(),
oid_ptr.address() );
myDump("Finished the str_to_oid: " + majStatus + "/" + minStatus);
- return(oid);
+ myDump(" returned oid: [ length: " + oid_ptr.contents.length + " ]");
+
+ return(oid_ptr.contents);
}
function import_name(name)
var minor = new ctypes.uint32_t(0);
var major;
+ var printable = new gss_buffer_t_struct();
+ var printtype = new gss_OID();
+
major = gss_import_name(
minor.address(),
name_buffer.address(),
);
myDump("Finished the gss_import_name: " + major + "/" + minor);
+ major = gss_display_name(
+ minor.address(),
+ output_name_ptr,
+ printable.address(),
+ printtype.address()
+ );
+ myDump("Display name: [ length: " + printable.length +
+ " value: " + printable.value + " ]");
+ myDump("Display name type: [ length: " + printtype.length + " ]");
+
return(output_name_ptr);
}
gss_OID.ptr); /* arg: oid */
myDump("gss_str_to_oid function is " + gss_str_to_oid);
+ const gss_display_name = libkrb5.declare("gss_display_name",
+ ctypes.default_abi,
+ ctypes.uint32_t, /* Return value */
+ ctypes.uint32_t.ptr, /* arg: minor_status */
+ gss_name_t.ptr, /* arg: input_name */
+ gss_buffer_t, /* arg: output_name_buffer */
+ gss_OID.ptr); /* arg: ouptut_name_type */
+ myDump("gss_str_to_oid function is " + gss_str_to_oid);
+
const gss_import_name = libkrb5.declare("gss_import_name",
ctypes.default_abi,
ctypes.uint32_t, /* Return value */