Loading...
Searching...
No Matches
globus_gss_assist.h
Go to the documentation of this file.
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _GLOBUS_GSS_ASSIST_H
#define _GLOBUS_GSS_ASSIST_H
#include "gssapi.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GLOBUS_GLOBAL_DOCUMENT_SET
#endif
#define GLOBUS_GSI_GSS_ASSIST_MODULE (&globus_i_gsi_gss_assist_module)
extern
globus_module_descriptor_t globus_i_gsi_gss_assist_module;
#define _GASL(s) globus_common_i18n_get_string( \
GLOBUS_GSI_GSS_ASSIST_MODULE, \
s)
#include "globus_gss_assist_constants.h"
#define GLOBUS_GSS_ASSIST_TOKEN_ERR_MALLOC 1
#define GLOBUS_GSS_ASSIST_TOKEN_ERR_BAD_SIZE 2
#define GLOBUS_GSS_ASSIST_TOKEN_EOF 3
#define GLOBUS_GSS_ASSIST_TOKEN_NOT_FOUND 4
/* for kerberos v5.1.0.5 compatibility we need this */
#ifndef GSS_C_NO_NAME
#define GSS_C_NO_NAME ((gss_name_t *) 0)
#define GSS_ASSIST_KRB5_HACK
#endif
/* for the globus_gss_assist_ex flags: */
#define GLOBUS_GSS_ASSIST_EX_SEND_WITHOUT_LENGTH 1
typedef struct globus_gss_assist_ex_st
{
void * arg;
int flags;
} globus_gss_assist_ex;
extern int
globus_gss_assist_token_get_fd(
void * arg,
void ** bufp,
size_t * sizep);
extern int
globus_gss_assist_token_send_fd(
void * arg,
void * buf,
size_t size);
extern int
globus_gss_assist_token_send_fd_ex(
void * exp,
void * buf,
size_t size);
extern int
globus_gss_assist_token_send_fd_without_length(
void * arg,
void * buf,
size_t size);
extern OM_uint32
globus_gss_assist_acquire_cred(
OM_uint32 *, /* minor_status */
gss_cred_usage_t, /* cred_usage */
gss_cred_id_t * /* output_cred_handle */);
extern
OM_uint32
globus_gss_assist_read_vhost_cred_dir(
OM_uint32 *minor_status,
const char *dir,
gss_cred_id_t **output_credentials_array,
size_t *output_credentials_array_size);
extern OM_uint32
globus_gss_assist_acquire_cred_dir(
OM_uint32 *, /* minor_status */
gss_cred_usage_t, /* cred_usage */
gss_cred_id_t ** /* output_cred_handle */,
size_t);
/*
* globus_gss_assist_acquire_cred_ext, assist with the gss_acquire_cred
*/
extern OM_uint32
globus_gss_assist_acquire_cred_ext(
OM_uint32 *, /* minor_status */
char *, /* desired_name_char */
OM_uint32, /* time_req */
const gss_OID_set, /* desired_mechs */
gss_cred_usage_t, /* cred_usage */
gss_cred_id_t *, /* output_cred_handle */
gss_OID_set *, /* actual_mechs */
OM_uint32 * /* time_rec */);
/*
* globus_gss_assist_accept_sec_context - takes care of looping
* over multiple tokens using the get and send tokens
* routines
*/
extern OM_uint32
globus_gss_assist_accept_sec_context(
OM_uint32 *, /* minor_status */
gss_ctx_id_t *, /* context_handle */
const gss_cred_id_t, /* acceptor_cred_handle */
char **, /* src_name as char ** */
OM_uint32 *, /* ret_flags */
int *, /* user_to_user_flag */
int *, /* token_status */
gss_cred_id_t *, /* delegated_cred_handle */
int (* get_token)(void *, void **, size_t *),
void * get_context,
int (* send_token)(void *, void *, size_t),
void * send_context);
/*
* globus_gss_assist_accept_sec_context_async - async version of
* globus_gss_assist_accept_sec_context().
*/
extern OM_uint32
globus_gss_assist_accept_sec_context_async(
OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
const gss_cred_id_t cred_handle,
char ** src_name_char,
OM_uint32 * ret_flags,
int * user_to_user_flag,
void * input_buffer,
size_t input_buffer_len,
void ** output_bufferp,
size_t * output_buffer_lenp,
gss_cred_id_t * delegated_cred_handle);
/*
* globus_gss_assist_init_sec_context - takes care of looping
* over multiple tokens using the get and send tokens
* routines
*/
extern OM_uint32
globus_gss_assist_init_sec_context(
OM_uint32 *, /* minor_status */
const gss_cred_id_t, /* initiator_cred_handle */
gss_ctx_id_t *, /* context_handle */
char *, /* target_name as char * */
OM_uint32, /* req_flags */
OM_uint32 *, /* ret_flags */
int *, /* token_status */
int (* get_token)(void *, void **, size_t *),
void * get_arg,
int (* send_token)(void *, void *, size_t),
void * send_arg);
/*
* globus_gss_assist_init_sec_context_async - async version of
* globus_gss_assist_init_sec_context().
*/
extern OM_uint32
globus_gss_assist_init_sec_context_async(
OM_uint32 * minor_status,
const gss_cred_id_t cred_handle,
gss_ctx_id_t * context_handle,
char * target_name_char,
OM_uint32 req_flags,
OM_uint32 * ret_flags,
void * input_buffer,
size_t input_buffer_len,
void ** output_bufferp,
size_t * output_buffer_lenp);
extern OM_uint32
globus_gss_assist_display_status(
FILE *, /* where to print */
char *, /* comment */
OM_uint32, /* major_status */
OM_uint32, /* minor_status */
int /* token_status */);
extern OM_uint32
globus_gss_assist_display_status_str(
char **, /* string returned with newlines */
char *, /* comment */
OM_uint32, /* major_status */
OM_uint32, /* minor_status */
int /* token_status */);
/*
* globus_gss_assist_wrap_send - used to wrap a
* simple message and send it
*/
extern OM_uint32
globus_gss_assist_wrap_send(
OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
char * data,
size_t length,
int * token_status,
int (*gss_assist_send_token)(void *, void *, size_t),
void * gss_assist_send_context,
FILE * fperr);
/*
* globus_gss_assist_get_unwrap - used to get and unwrap a message
*/
extern OM_uint32
globus_gss_assist_get_unwrap(
OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
char ** data,
size_t * length,
int * token_status,
int (*gss_assist_get_token)(void *, void **, size_t *),
void * gss_assist_get_context,
FILE * fperr);
/*
* globus_gss_assist_will_handle_restrictions - used to tell OpenSSL
* that the application will deal with the restrictions extension
*/
OM_uint32
globus_gss_assist_will_handle_restrictions(
OM_uint32 * minor_status,
gss_ctx_id_t * context_handle);
/*
* globus_gss_assist_import_sec_context - read a security context
*/
extern OM_uint32
globus_gss_assist_export_sec_context(
OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
int * token_status,
int fdp,
FILE * fperr);
/*
* globus_gss_assist_import_sec_context - read a security context
*/
extern OM_uint32
globus_gss_assist_import_sec_context(
OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
int * token_status,
int fdp,
FILE * fperr);
globus_result_t
globus_gss_assist_authorization_host_name(
char * hostname,
gss_name_t * authorization_hostname);
extern int
globus_gss_assist_gridmap(
char * globusidp,
char ** useridp);
extern int
globus_gss_assist_userok(
char * globusid,
char * userid);
extern int
globus_gss_assist_map_local_user(
char * local_user,
char ** globusidp);
globus_result_t
globus_gss_assist_lookup_all_globusid(
char * username,
char ** dns[],
int * dn_count);
globus_result_t
globus_gss_assist_map_and_authorize(
gss_ctx_id_t context,
char * service,
char * desired_identity,
char * identity_buffer,
unsigned int identity_buffer_length);
globus_result_t
globus_gss_assist_map_and_authorize_sharing(
char * shared_user_certificate,
gss_ctx_id_t context,
char * desired_identity,
char * identity_buffer,
unsigned int identity_buffer_length);
#define GlobusGssAssistFreeDNArray(dn_a) \
{ \
int __ctr = 0; \
while(dn_a[__ctr] != NULL) \
{ \
free(dn_a[__ctr]); \
__ctr++; \
} \
free(dn_a); \
}
#ifdef __cplusplus
}
#endif
#endif /* _GLOBUS_GSS_ASSIST_H */
globus_gss_assist_constants.h
Globus GSI GSS Assist Library.
globus_gss_assist_accept_sec_context
OM_uint32 globus_gss_assist_accept_sec_context(OM_uint32 *, gss_ctx_id_t *, const gss_cred_id_t, char **, OM_uint32 *, int *, int *, gss_cred_id_t *, int(*get_token)(void *, void **, size_t *), void *get_context, int(*send_token)(void *, void *, size_t), void *send_context)
Accept a Security Context.
Definition accept.c:80
globus_gss_assist_accept_sec_context_async
OM_uint32 globus_gss_assist_accept_sec_context_async(OM_uint32 *minor_status, gss_ctx_id_t *context_handle, const gss_cred_id_t cred_handle, char **src_name_char, OM_uint32 *ret_flags, int *user_to_user_flag, void *input_buffer, size_t input_buffer_len, void **output_bufferp, size_t *output_buffer_lenp, gss_cred_id_t *delegated_cred_handle)
Accept a Security Context Without Blocking.
Definition accept.c:324
globus_gss_assist_export_sec_context
OM_uint32 globus_gss_assist_export_sec_context(OM_uint32 *minor_status, gss_ctx_id_t *context_handle, int *token_status, int fdp, FILE *fperr)
Definition export_sec_context.c:52
globus_gss_assist_import_sec_context
OM_uint32 globus_gss_assist_import_sec_context(OM_uint32 *minor_status, gss_ctx_id_t *context_handle, int *token_status, int fdp, FILE *fperr)
Definition import_sec_context.c:51
globus_gss_assist_init_sec_context
OM_uint32 globus_gss_assist_init_sec_context(OM_uint32 *, const gss_cred_id_t, gss_ctx_id_t *, char *, OM_uint32, OM_uint32 *, int *, int(*get_token)(void *, void **, size_t *), void *get_arg, int(*send_token)(void *, void *, size_t), void *send_arg)
Definition init.c:77
globus_gss_assist_init_sec_context_async
OM_uint32 globus_gss_assist_init_sec_context_async(OM_uint32 *minor_status, const gss_cred_id_t cred_handle, gss_ctx_id_t *context_handle, char *target_name_char, OM_uint32 req_flags, OM_uint32 *ret_flags, void *input_buffer, size_t input_buffer_len, void **output_bufferp, size_t *output_buffer_lenp)
Definition init.c:338
globus_gss_assist_get_unwrap
OM_uint32 globus_gss_assist_get_unwrap(OM_uint32 *minor_status, const gss_ctx_id_t context_handle, char **data, size_t *length, int *token_status, int(*gss_assist_get_token)(void *, void **, size_t *), void *gss_assist_get_context, FILE *fperr)
Get Unwrap.
Definition unwrap.c:60
globus_gss_assist_will_handle_restrictions
OM_uint32 globus_gss_assist_will_handle_restrictions(OM_uint32 *minor_status, gss_ctx_id_t *context_handle)
Definition set_sec_context_opts.c:45
globus_gss_assist_acquire_cred
OM_uint32 globus_gss_assist_acquire_cred(OM_uint32 *, gss_cred_usage_t, gss_cred_id_t *)
Definition acquire.c:67
globus_gss_assist_read_vhost_cred_dir
OM_uint32 globus_gss_assist_read_vhost_cred_dir(OM_uint32 *minor_status, const char *dir, gss_cred_id_t **output_credentials_array, size_t *output_credentials_array_size)
Acquire all GSSAPI credentials in a directory.
Definition read_vhost_cred_dir.c:42
globus_gss_assist_acquire_cred_ext
OM_uint32 globus_gss_assist_acquire_cred_ext(OM_uint32 *, char *, OM_uint32, const gss_OID_set, gss_cred_usage_t, gss_cred_id_t *, gss_OID_set *, OM_uint32 *)
Definition acquire.c:95
globus_gss_assist_display_status
OM_uint32 globus_gss_assist_display_status(FILE *, char *, OM_uint32, OM_uint32, int)
Definition display.c:125
globus_gss_assist_display_status_str
OM_uint32 globus_gss_assist_display_status_str(char **, char *, OM_uint32, OM_uint32, int)
Definition display.c:173
globus_gss_assist_map_and_authorize
globus_result_t globus_gss_assist_map_and_authorize(gss_ctx_id_t context, char *service, char *desired_identity, char *identity_buffer, unsigned int identity_buffer_length)
Authorize the peer of a security context to use a service.
Definition gridmap.c:1952
globus_gss_assist_map_local_user
int globus_gss_assist_map_local_user(char *local_user, char **globusidp)
Look up the default Grid identity associated with a local user name.
Definition gridmap.c:836
globus_gss_assist_userok
int globus_gss_assist_userok(char *globusid, char *userid)
Gridmap entry existence check.
Definition gridmap.c:699
globus_gss_assist_gridmap
int globus_gss_assist_gridmap(char *globusidp, char **useridp)
Look up the default mapping for a Grid identity in a gridmap file.
Definition gridmap.c:552
globus_gss_assist_map_and_authorize_sharing
globus_result_t globus_gss_assist_map_and_authorize_sharing(char *shared_user_certificate, gss_ctx_id_t context, char *desired_identity, char *identity_buffer, unsigned int identity_buffer_length)
Authorize a particular credential for shared access.
Definition gridmap.c:2126
globus_gss_assist_lookup_all_globusid
globus_result_t globus_gss_assist_lookup_all_globusid(char *username, char **dns[], int *dn_count)
Look up all Grid IDs associated with a local user ID.
Definition gridmap.c:1769
globus_gss_assist_token_get_fd
int globus_gss_assist_token_get_fd(void *arg, void **bufp, size_t *sizep)
Get token from a FILE *.
Definition tokens_f.c:50
globus_gss_assist_token_send_fd
int globus_gss_assist_token_send_fd(void *arg, void *buf, size_t size)
Send token via a FILE *.
Definition tokens_f.c:253
globus_gss_assist_token_send_fd_ex
int globus_gss_assist_token_send_fd_ex(void *exp, void *buf, size_t size)
Send a token to a FILE *.
Definition tokens_f.c:325
globus_gss_assist_token_send_fd_without_length
int globus_gss_assist_token_send_fd_without_length(void *arg, void *buf, size_t size)
Send token to a FILE *.
Definition tokens_f.c:282
globus_gss_assist_authorization_host_name
globus_result_t globus_gss_assist_authorization_host_name(char *hostname, gss_name_t *authorization_hostname)
Definition hostname.c:47
globus_gss_assist_wrap_send
OM_uint32 globus_gss_assist_wrap_send(OM_uint32 *minor_status, const gss_ctx_id_t context_handle, char *data, size_t length, int *token_status, int(*gss_assist_send_token)(void *, void *, size_t), void *gss_assist_send_context, FILE *fperr)
Wrap.
Definition wrap.c:62