A former general in Ukraine’s intelligence agency has been sentenced to 12 years in prison for treason for passing state secrets to Russia.