gssapi: gss_krb5_set_allowable_enctypes prototype mismatch
gss_krb5_set_allowable_enctypes() was declared with an array of int32_t types representing the enctype list, but the definition had an array of krb5_enctype. Whilst these are likely the same size, they may not be. On the receiving end, allocate an array of krb5_enctype.
This commit is contained in:
@@ -149,8 +149,9 @@ allowed_enctypes(OM_uint32 *minor_status,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* serialized as int32_t[], but stored as krb5_enctype[] */
|
||||||
len = value->length / 4;
|
len = value->length / 4;
|
||||||
enctypes = malloc((len + 1) * 4);
|
enctypes = malloc((len + 1) * sizeof(krb5_enctype));
|
||||||
if (enctypes == NULL) {
|
if (enctypes == NULL) {
|
||||||
*minor_status = ENOMEM;
|
*minor_status = ENOMEM;
|
||||||
major_stat = GSS_S_FAILURE;
|
major_stat = GSS_S_FAILURE;
|
||||||
@@ -165,9 +166,9 @@ allowed_enctypes(OM_uint32 *minor_status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
uint32_t e;
|
int32_t e;
|
||||||
|
|
||||||
ret = krb5_ret_uint32(sp, &e);
|
ret = krb5_ret_int32(sp, &e);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
*minor_status = ret;
|
*minor_status = ret;
|
||||||
major_stat = GSS_S_FAILURE;
|
major_stat = GSS_S_FAILURE;
|
||||||
@@ -175,7 +176,7 @@ allowed_enctypes(OM_uint32 *minor_status,
|
|||||||
}
|
}
|
||||||
enctypes[i] = e;
|
enctypes[i] = e;
|
||||||
}
|
}
|
||||||
enctypes[i] = 0;
|
enctypes[i] = KRB5_ENCTYPE_NULL;
|
||||||
|
|
||||||
if (cred->enctypes)
|
if (cred->enctypes)
|
||||||
free(cred->enctypes);
|
free(cred->enctypes);
|
||||||
|
@@ -433,7 +433,7 @@ GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
|||||||
gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status,
|
gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status,
|
||||||
gss_cred_id_t cred,
|
gss_cred_id_t cred,
|
||||||
OM_uint32 num_enctypes,
|
OM_uint32 num_enctypes,
|
||||||
krb5_enctype *enctypes)
|
int32_t *enctypes)
|
||||||
{
|
{
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
OM_uint32 maj_status;
|
OM_uint32 maj_status;
|
||||||
|
Reference in New Issue
Block a user