static SECURITY_STATUS nla_decrypt(rdpNla* nla, SecBuffer* buffer, size_t headerLength)
{
	ULONG pfQOP = 0;
	SECURITY_STATUS status = SEC_E_INVALID_PARAMETER;
	SecBuffer Buffers[2];
	SecBufferDesc Message;

	if (!nla || !nla->table)
	{
		WLog_ERR(TAG, "[%s] nla->table=%p->%p", __FUNCTION__, nla, nla ? nla->table : NULL);
		return SEC_E_INVALID_PARAMETER;
	}
	if (!nla->table->DecryptMessage)
	{
		WLog_ERR(TAG, "[%s] DecryptMessage=%p", __FUNCTION__, nla->table->DecryptMessage);
		return ERROR_INTERNAL_ERROR;
	}

	if (!buffer || (headerLength > buffer->cbBuffer))
	{
		return SEC_E_INVALID_PARAMETER;
	}

	Buffers[0].BufferType = SECBUFFER_TOKEN; /* Signature */
	Buffers[0].cbBuffer = (ULONG)headerLength;
	Buffers[0].pvBuffer = &((BYTE*)buffer->pvBuffer)[0];

	Buffers[1].BufferType = SECBUFFER_DATA; /* Encrypted TLS Public Key */
	Buffers[1].cbBuffer = (ULONG)(buffer->cbBuffer - headerLength);
	Buffers[1].pvBuffer = &((BYTE*)buffer->pvBuffer)[headerLength];
	Message.cBuffers = 2;

	Message.ulVersion = SECBUFFER_VERSION;
	Message.pBuffers = Buffers;
	status = nla->table->DecryptMessage(&nla->context, &Message, nla->recvSeqNum++, &pfQOP);

	if (status != SEC_E_OK)
	{
		WLog_ERR(TAG, "DecryptMessage failure %s [%08" PRIX32 "]", GetSecurityStatusString(status),
		         status);
	}

	return status;
}
static SECURITY_STATUS nla_decrypt(rdpNla* nla, SecBuffer* buffer, size_t headerLength)
{
	ULONG pfQOP = 0;
	SECURITY_STATUS status = SEC_E_INVALID_PARAMETER;
	SecBuffer Buffers[2];
	SecBufferDesc Message;

	if (!nla || !nla->table)
	{
		WLog_ERR(TAG, "[%s] nla->table=%p->%p", __FUNCTION__, nla, nla ? nla->table : NULL);
		return SEC_E_INVALID_PARAMETER;
	}
	if (!nla->table->DecryptMessage)
	{
		WLog_ERR(TAG, "[%s] DecryptMessage=%p", __FUNCTION__, nla->table->DecryptMessage);
		return ERROR_INTERNAL_ERROR;
	}

	if (!buffer || (headerLength > buffer->cbBuffer))
	{
		return SEC_E_INVALID_PARAMETER;
	}

	Buffers[0].BufferType = SECBUFFER_TOKEN;  
	Buffers[0].cbBuffer = (ULONG)headerLength;
	Buffers[0].pvBuffer = &((BYTE*)buffer->pvBuffer)[0];

	Buffers[1].BufferType = SECBUFFER_DATA;  
	Buffers[1].cbBuffer = (ULONG)(buffer->cbBuffer - headerLength);
	Buffers[1].pvBuffer = &((BYTE*)buffer->pvBuffer)[headerLength];
	Message.cBuffers = 2;

	Message.ulVersion = SECBUFFER_VERSION;
	Message.pBuffers = Buffers;
	status = nla->table->DecryptMessage(&nla->context, &Message, nla->recvSeqNum++, &pfQOP);

	if (status != SEC_E_OK)
	{
		WLog_ERR(TAG, "DecryptMessage failure %s [%08" PRIX32 "]", GetSecurityStatusString(status),
		         status);
	}

	return status;
}