We present a new characterization of semi-bent and bent quadratic functions on finite fields. First, we determine when a GF(2)-linear combination of Gold functions Tr(x2i+1) is semi-bent over GF(2n), n odd, by a polynomial GCD computation. By analyzing this GCD condition, we provide simpler characterizations of semi-bent functions. For example, we deduce that all linear combinations of Gold functions give rise to semi-bent functions over GF(2p) when p belongs to a certain class of primes. Second, we generalize our results to fields GF(pn) where p is an odd prime and n is odd. In that case, we can determine whether a GF(p)-linear combination of Gold functions Tr(xpi+1) is (generalized) semi-bent or bent by a polynomial GCD computation. Similar to the binary case, simple characterizations of these p-ary semi-bent and bent functions are provided.