/*
*/
#include "mglueP.h"
#include "gssapiP_krb5.h"
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <ctype.h>
#include <errno.h>
/*
#include <gssapi/gssapi_ext.h>
*/
#include <synch.h>
static int qop_num_pair_cnt;
static OM_uint32 __gss_read_qop_file(void);
/*
* There is a memory leak associated with rereading this file,
* because we can't free the qop_num_pairs array when we reread
* the file (some callers may have been given these pointers).
* In general, this memory leak should be a small one, because
* we don't expect the qop file to be changed and reread often.
*/
static OM_uint32
__gss_read_qop_file(void)
{
char *line;
static int last = 0;
(void) mutex_lock(&qopfile_lock);
if (!qop_num_pairs[0].qop) {
}
goto done;
}
goto done;
}
/*
* For each line in the file parse it appropriately.
* File format : qopname num(int)
* Note that we silently ignore corrupt entries.
*/
qop_num_pair_cnt = 0;
break;
/* Skip comments and blank lines */
continue;
/* Skip trailing comments */
if (next)
*next = '\0';
name++;
continue;
qopname++;
if (*qopname == '\0') {
continue;
}
continue;
name++;
continue;
}
num_str++;
name++;
continue;
}
num_str++;
*num_str = '\0';
continue;
}
if (qop_num_pair_cnt++ >= MAX_QOP_NUM_PAIRS)
break;
}
done:
(void) mutex_unlock(&qopfile_lock);
return (major);
}
char *qop,
char *mech,
)
{
int i;
if (!num)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
*num = GSS_C_QOP_DEFAULT;
return (GSS_S_COMPLETE);
}
return (major);
for (i = 0; i < qop_num_pair_cnt; i++) {
return (GSS_S_COMPLETE);
}
}
return (GSS_S_FAILURE);
}
char *mech,
char **qop
)
{
int i;
if (!qop)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
if (num == GSS_C_QOP_DEFAULT) {
return (GSS_S_COMPLETE);
}
return (GSS_S_CALL_INACCESSIBLE_READ);
return (major);
for (i = 0; i < qop_num_pair_cnt; i++) {
return (GSS_S_COMPLETE);
}
}
return (GSS_S_FAILURE);
}
/*
* For a given mechanism pass back qop information about it in a buffer
* of size MAX_QOPS_PER_MECH+1.
*/
char *mech,
char **qops
)
{
int i, cnt = 0;
if (!qops)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
if (!mech)
return (GSS_S_CALL_INACCESSIBLE_READ);
return (major);
for (i = 0; i < qop_num_pair_cnt; i++) {
if (cnt >= MAX_QOPS_PER_MECH) {
return (GSS_S_FAILURE);
}
}
}
return (GSS_S_COMPLETE);
}