We investigate the renormalization of gauge theories without assuming
cohomological properties. We define a renormalization algorithm that preserves
the Batalin-Vilkovisky master equation at each step and automatically extends
the classical action till it contains sufficiently many independent parameters
to reabsorb all divergences into parameter-redefinitions and canonical
transformations. The construction is then generalized to the master functional
and the field-covariant proper formalism for gauge theories. Our results hold
in all manifestly anomaly-free gauge theories, power-counting renormalizable or
not. The extension algorithm allows us to solve a quadratic problem, such as
finding a sufficiently general solution of the master equation, even when it is
not possible to reduce it to a linear (cohomological) problem.Comment: 29 pages; v2: references updated, EPJ