Movatterモバイル変換


[0]ホーム

URL:


Go to main content
oracle home

Developer's Guide to Oracle® Solaris 11.4 Security

Exit Print View

 
Search Scope:
  »  ...Documentation Home  »  Oracle Solaris 11.4 Information Library  »  Developer's Guide to Oracle® ...  »  GSS-API Client Example  »  Miscellaneous GSSAPI Context Operations on the ...
Updated: November 2020
 
 

Miscellaneous GSSAPI Context Operations onthe Client Side

    As a sample program,gss-client performs some functionsfor demonstration purposes. The following source code is not essential forthe basic task, but is provided to demonstrate these other operations:

  • Saving and restoring the context

  • Displaying context flags

  • Obtaining the context status

The source code for these operations is shown in the following example.

Example 16  GSSAPI Clientcall_server() Function to Establish Context
/* Save and then restore the context */     maj_stat = gss_export_sec_context(&min_stat,                                           &context,                                           &context_token);     if (maj_stat != GSS_S_COMPLETE) {             display_status("exporting context", maj_stat, min_stat);             return -1;     }     maj_stat = gss_import_sec_context(&min_stat,                                           &context_token,                                           &context);     if (maj_stat != GSS_S_COMPLETE) {        display_status("importing context", maj_stat, min_stat);        return -1;     }     (void) gss_release_buffer(&min_stat, &context_token);     /* display the flags */     display_ctx_flags(ret_flags);     /* Get context information */     maj_stat = gss_inquire_context(&min_stat, context,                                    &src_name, &targ_name, &lifetime,                                    &mechanism, &context_flags,                                    &is_local,                                    &is_open);     if (maj_stat != GSS_S_COMPLETE) {         display_status("inquiring context", maj_stat, min_stat);         return -1;     }     if (maj_stat == GSS_S_CONTEXT_EXPIRED) {     printf(" context expired\n");         display_status("Context is expired", maj_stat, min_stat);         return -1;     }
Copyright © 2000, 2020, Oracle and/or its affiliates. 
Previous
Next

[8]ページ先頭

©2009-2025 Movatter.jp