int crypt_activate_by_passphrase(struct crypt_device *cd,
	const char *name,
	int keyslot,
	const char *passphrase,
	size_t passphrase_size,
	uint32_t flags)
{
	int r;

	if (!cd || !passphrase || (!name && (flags & CRYPT_ACTIVATE_REFRESH)))
		return -EINVAL;

	log_dbg(cd, "%s volume %s [keyslot %d] using passphrase.",
		name ? "Activating" : "Checking", name ?: "passphrase",
		keyslot);

	r = _activate_check_status(cd, name, flags & CRYPT_ACTIVATE_REFRESH);
	if (r < 0)
		return r;

	return _activate_by_passphrase(cd, name, keyslot, passphrase, passphrase_size, flags);
}
int crypt_activate_by_passphrase(struct crypt_device *cd,
	const char *name,
	int keyslot,
	const char *passphrase,
	size_t passphrase_size,
	uint32_t flags)
{
	int r;

	if (!cd || !passphrase || (!name && (flags & CRYPT_ACTIVATE_REFRESH)))
		return -EINVAL;

	log_dbg(cd, "%s volume %s [keyslot %d] using passphrase.",
		name ? "Activating" : "Checking", name ?: "passphrase",
		keyslot);

	r = _activate_check_status(cd, name, flags & CRYPT_ACTIVATE_REFRESH);
	if (r < 0)
		return r;

	return _activate_by_passphrase(cd, name, keyslot, passphrase, passphrase_size, flags);
}