int crypt_token_json_set(struct crypt_device *cd, int token, const char *json)
{
	int r;

	log_dbg(cd, "Updating JSON for token %d.", token);

	if ((r = onlyLUKS2(cd)))
		return r;

	return LUKS2_token_create(cd, &cd->u.luks2.hdr, token, json, 1);
}
int crypt_token_json_set(struct crypt_device *cd, int token, const char *json)
{
	int r;

	log_dbg(cd, "Updating JSON for token %d.", token);

	if ((r = onlyLUKS2(cd)))
		return r;

	return LUKS2_token_create(cd, &cd->u.luks2.hdr, token, json, 1);
}