From: Theodore Tso Date: Wed, 28 Feb 1996 16:44:07 +0000 (+0000) Subject: Get the nametype OID from gss_display_name, print it, and then release X-Git-Tag: krb5-1.0-beta6~429 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b660510c253f0d4c9d6ab29bdb1c01536b56634;p=krb5.git Get the nametype OID from gss_display_name, print it, and then release the nametype OID. This tests gss_display_name()'s ability to return a valid nametype, which can then be freed successfully. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7570 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/gss-sample/ChangeLog b/src/appl/gss-sample/ChangeLog index 39b206f78..20c8b64d1 100644 --- a/src/appl/gss-sample/ChangeLog +++ b/src/appl/gss-sample/ChangeLog @@ -1,3 +1,10 @@ +Wed Feb 28 11:42:26 1996 Theodore Y. Ts'o + + * gss-client.c (call_server): Get the nametype OID from + gss_display_name, print it, and then release the nametype + OID. This tests gss_display_name()'s ability to return a + valid nametype, which can then be freed successfully. + Tue Feb 27 17:26:15 1996 Ezra Peisach (epeisach@kangaroo.mit.edu) * configure.in: Add USE_ANAME. diff --git a/src/appl/gss-sample/gss-client.c b/src/appl/gss-sample/gss-client.c index 3827336ff..986a7968c 100644 --- a/src/appl/gss-sample/gss-client.c +++ b/src/appl/gss-sample/gss-client.c @@ -130,7 +130,7 @@ int call_server(host, port, dov2, service_name, msg) gss_name_t src_name, targ_name; gss_buffer_desc sname, tname; OM_uint32 lifetime; - gss_OID mechanism; + gss_OID mechanism, name_type; int is_local; #ifdef GSSAPI_V2 OM_uint32 context_flags; @@ -189,7 +189,7 @@ int call_server(host, port, dov2, service_name, msg) } maj_stat = gss_display_name(&min_stat, src_name, &sname, - (gss_OID *) NULL); + &name_type); if (maj_stat != GSS_S_COMPLETE) { display_status("displaying context", maj_stat, min_stat); return -1; @@ -217,6 +217,18 @@ int call_server(host, port, dov2, service_name, msg) if (dov2) { size_t i; + maj_stat = gss_oid_to_str(&min_stat, + name_type, + &oid_name); + if (maj_stat != GSS_S_COMPLETE) { + display_status("converting oid->string", maj_stat, min_stat); + return -1; + } + fprintf(stderr, "Name type of source name is %s.\n", + oid_name.value); + (void) gss_release_buffer(&min_stat, &oid_name); + (void) gss_release_oid(&min_stat, &name_type); + /* Now get the names supported by the mechanism */ maj_stat = gss_inquire_names_for_mech(&min_stat, mechanism,