Warning fixes from Christos Zoulas
- shadowed variables - signed/unsigned confusion - const lossage - incomplete structure initializations - unused code
This commit is contained in:
@@ -316,7 +316,7 @@ select_mech(OM_uint32 *minor_status, MechType *mechType, int verify_p,
|
||||
gss_OID_desc oid;
|
||||
gss_OID oidp;
|
||||
gss_OID_set mechs;
|
||||
int i;
|
||||
size_t i;
|
||||
OM_uint32 ret, junk;
|
||||
|
||||
ret = der_put_oid ((unsigned char *)mechbuf + sizeof(mechbuf) - 1,
|
||||
@@ -368,12 +368,13 @@ select_mech(OM_uint32 *minor_status, MechType *mechType, int verify_p,
|
||||
|
||||
host = getenv("GSSAPI_SPNEGO_NAME");
|
||||
if (host == NULL || issuid()) {
|
||||
int rv;
|
||||
if (gethostname(hostname, sizeof(hostname)) != 0) {
|
||||
*minor_status = errno;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
i = asprintf(&str, "host@%s", hostname);
|
||||
if (i < 0 || str == NULL) {
|
||||
rv = asprintf(&str, "host@%s", hostname);
|
||||
if (rv < 0 || str == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
@@ -491,7 +492,6 @@ acceptor_start
|
||||
NegotiationToken nt;
|
||||
size_t nt_len;
|
||||
NegTokenInit *ni;
|
||||
int i;
|
||||
gss_buffer_desc data;
|
||||
gss_buffer_t mech_input_token = GSS_C_NO_BUFFER;
|
||||
gss_buffer_desc mech_output_token;
|
||||
@@ -613,13 +613,14 @@ acceptor_start
|
||||
*/
|
||||
|
||||
if (!first_ok && ni->mechToken != NULL) {
|
||||
size_t j;
|
||||
|
||||
preferred_mech_type = GSS_C_NO_OID;
|
||||
|
||||
/* Call glue layer to find first mech we support */
|
||||
for (i = 1; i < ni->mechTypes.len; ++i) {
|
||||
for (j = 1; j < ni->mechTypes.len; ++j) {
|
||||
ret = select_mech(minor_status,
|
||||
&ni->mechTypes.val[i],
|
||||
&ni->mechTypes.val[j],
|
||||
1,
|
||||
&preferred_mech_type);
|
||||
if (ret == 0)
|
||||
|
@@ -41,10 +41,10 @@
|
||||
* Kerberos mechanism.
|
||||
*/
|
||||
gss_OID_desc _gss_spnego_mskrb_mechanism_oid_desc =
|
||||
{9, (void *)"\x2a\x86\x48\x82\xf7\x12\x01\x02\x02"};
|
||||
{9, rk_UNCONST("\x2a\x86\x48\x82\xf7\x12\x01\x02\x02")};
|
||||
|
||||
gss_OID_desc _gss_spnego_krb5_mechanism_oid_desc =
|
||||
{9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"};
|
||||
{9, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12\x01\x02\x02")};
|
||||
|
||||
/*
|
||||
* Allocate a SPNEGO context handle
|
||||
@@ -241,7 +241,7 @@ _gss_spnego_indicate_mechtypelist (OM_uint32 *minor_status,
|
||||
gss_OID_set supported_mechs = GSS_C_NO_OID_SET;
|
||||
gss_OID first_mech = GSS_C_NO_OID;
|
||||
OM_uint32 ret;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
mechtypelist->len = 0;
|
||||
mechtypelist->val = NULL;
|
||||
|
@@ -37,7 +37,7 @@ spnego_supported_mechs(OM_uint32 *minor_status, gss_OID_set *mechs)
|
||||
{
|
||||
OM_uint32 ret, junk;
|
||||
gss_OID_set m;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
ret = gss_indicate_mechs(minor_status, &m);
|
||||
if (ret != GSS_S_COMPLETE)
|
||||
@@ -565,7 +565,7 @@ OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_names_for_mech (
|
||||
{
|
||||
gss_OID_set mechs, names, n;
|
||||
OM_uint32 ret, junk;
|
||||
int i, j;
|
||||
size_t i, j;
|
||||
|
||||
*name_types = NULL;
|
||||
|
||||
|
@@ -70,7 +70,7 @@ OM_uint32 GSSAPI_CALLCONV _gss_spnego_acquire_cred
|
||||
OM_uint32 ret, tmp;
|
||||
gss_OID_set_desc actual_desired_mechs;
|
||||
gss_OID_set mechs;
|
||||
int i, j;
|
||||
size_t i, j;
|
||||
|
||||
*output_cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
|
||||
|
@@ -39,13 +39,12 @@
|
||||
* negotiation token is identified by the Object Identifier
|
||||
* iso.org.dod.internet.security.mechanism.snego (1.3.6.1.5.5.2).
|
||||
*/
|
||||
|
||||
static gss_mo_desc spnego_mo[] = {
|
||||
{
|
||||
GSS_C_MA_SASL_MECH_NAME,
|
||||
GSS_MO_MA,
|
||||
"SASL mech name",
|
||||
"SPNEGO",
|
||||
rk_UNCONST("SPNEGO"),
|
||||
_gss_mo_get_ctx_as_string,
|
||||
NULL
|
||||
},
|
||||
@@ -53,7 +52,7 @@ static gss_mo_desc spnego_mo[] = {
|
||||
GSS_C_MA_MECH_NAME,
|
||||
GSS_MO_MA,
|
||||
"Mechanism name",
|
||||
"SPNEGO",
|
||||
rk_UNCONST("SPNEGO"),
|
||||
_gss_mo_get_ctx_as_string,
|
||||
NULL
|
||||
},
|
||||
@@ -61,7 +60,7 @@ static gss_mo_desc spnego_mo[] = {
|
||||
GSS_C_MA_MECH_DESCRIPTION,
|
||||
GSS_MO_MA,
|
||||
"Mechanism description",
|
||||
"Heimdal SPNEGO Mechanism",
|
||||
rk_UNCONST("Heimdal SPNEGO Mechanism"),
|
||||
_gss_mo_get_ctx_as_string,
|
||||
NULL
|
||||
},
|
||||
@@ -78,7 +77,7 @@ static gss_mo_desc spnego_mo[] = {
|
||||
static gssapi_mech_interface_desc spnego_mech = {
|
||||
GMI_VERSION,
|
||||
"spnego",
|
||||
{6, (void *)"\x2b\x06\x01\x05\x05\x02"},
|
||||
{6, rk_UNCONST("\x2b\x06\x01\x05\x05\x02") },
|
||||
0,
|
||||
_gss_spnego_acquire_cred,
|
||||
_gss_spnego_release_cred,
|
||||
@@ -128,7 +127,13 @@ static gssapi_mech_interface_desc spnego_mech = {
|
||||
NULL,
|
||||
NULL,
|
||||
spnego_mo,
|
||||
sizeof(spnego_mo) / sizeof(spnego_mo[0])
|
||||
sizeof(spnego_mo) / sizeof(spnego_mo[0]),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
gssapi_mech_interface
|
||||
|
Reference in New Issue
Block a user