gnutls_dh_get_prime_bits() returns wrong values

Simon Josefsson simon at
Wed Jun 17 09:23:31 CEST 2009

Peter Hendrickson <pdh at> writes:

> When I run gnutls_dh_get_prime_bits() it returns a value 8 bits larger
> than the actual length of the prime.  For example, if I load a
> Diffie-Hellman parameter with 4096 bits, I am told after the
> negotiation that the prime was 4104 bits long.
> It looks like it's getting something from dh->prime.size and
> multiplying it by 8 and that prime.size is one larger than is correct.

Yes, that seems wrong.  Fixed like this:


More information about the Gnutls-devel mailing list