BUCHAREST, Romania — Across Eastern Europe, liberal values were under threat in 2017, with governments in countries like Hungary, Poland and Romania passing measures intended to push back against democratic principles, including anticorruption efforts, freedom of the press and the rule of law.

In Romania, protesters and politicians are gearing up for a tense January, almost a year after hundreds of thousands took to the streets to oppose government measures relaxing penalties for official corruption.

On Dec. 20, the Romanian Senate passed legislation that critics said would weaken the judiciary’s independence. The country’s lower house previously had approved the changes. They now await the signature of President Klaus Iohannis, who has long criticized efforts to weaken the fight against corruption. Mr. Iohannis is the former leader of the National Liberal Party, the main opposition party to the governing coalition.

Mr. Iohannis has 20 days to sign the measures into law or exercise his veto and send them back to Parliament. “If someone is imagining that there will be no consequences, they have simply fallen from the moon,” he told reporters on Dec. 20.