Skip to content
Permalink
Browse files

feat(gss): add `new` methods for constructing state tracking types

  • Loading branch information
mbroadst committed Jun 25, 2018
1 parent 9961e0d commit 274cad676649e98155edd398a8f40ffccc40b64d
Showing with 21 additions and 0 deletions.
  1. +18 −0 src/kerberos_gss.cc
  2. +3 −0 src/kerberos_gss.h
@@ -32,6 +32,24 @@ static gss_result* gss_success_result(int ret);
static gss_result* gss_error_result(OM_uint32 err_maj, OM_uint32 err_min);
static gss_result* gss_error_result_with_message_and_code(const char *mesage, int code);

gss_client_state* gss_client_state_new()
{
gss_client_state* state = (gss_client_state *) malloc(sizeof(gss_client_state));
state->username = NULL;
state->response = NULL;
state->responseConf = 0;
return state;
}

gss_server_state* gss_server_state_new()
{
gss_server_state* state = (gss_server_state *) malloc(sizeof(gss_server_state));
state->username = NULL;
state->response = NULL;
state->targetname = NULL;
return state;
}

gss_result* server_principal_details(const char* service, const char* hostname)
{
char match[1024];
@@ -56,6 +56,9 @@ typedef struct {
char* response;
} gss_server_state;

gss_client_state* gss_client_state_new();
gss_server_state* gss_server_state_new();

gss_result* server_principal_details(const char* service, const char* hostname);

gss_result* authenticate_gss_client_init(const char* service, const char* principal, long int gss_flags, gss_OID mech_oid, gss_client_state* state);

0 comments on commit 274cad6

Please sign in to comment.
You can’t perform that action at this time.