gssapi/krb5: treat empty padding buffers as absent

For compatibility with SSPI, treat an empty padding buffer as equivalent to an
absent padding buffer (unelss the caller is requesting allocation).
This commit is contained in:
Luke Howard
2020-07-12 15:55:02 +10:00
parent c105b15605
commit ad2a352600

View File

@@ -224,6 +224,17 @@ _gk_find_buffer(gss_iov_buffer_desc *iov, int iov_count, OM_uint32 type)
}
}
/*
* For compatibility with SSPI, an empty padding buffer is treated
* equivalent to an absent padding buffer (unless the caller is
* requesting that a padding buffer be allocated).
*/
if (iovp &&
iovp->buffer.length == 0 &&
type == GSS_IOV_BUFFER_TYPE_PADDING &&
(GSS_IOV_BUFFER_FLAGS(iovp->type) & GSS_IOV_BUFFER_FLAG_ALLOCATE) == 0)
iovp = NULL;
return iovp;
}