[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnutls_dh_get_prime_bits() returns wrong values
From: |
Nikos Mavrogiannopoulos |
Subject: |
Re: gnutls_dh_get_prime_bits() returns wrong values |
Date: |
Sun, 31 May 2009 10:04:10 +0300 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090409) |
Peter Hendrickson wrote:
> 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.
>
> In the debugger I watched gnutls_dh_params_import_pkcs3() load the
> parameters and it looks like one-larger prime.size is getting set in
> the process of ASN.1 parsing and MPI construction. Probably that's
> correct and dh_get_prime_bits() should be doing a little more work to
> report the right value. For one thing, if it's reporting the number
> of bits, it can't multiply an integer by 8 and always be correct.
Indeed you are right and thank you for the bug report. The number is
being rounded on byte level. I have noted it down as bug.
regards,
Nikos