gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnutls_dh_get_prime_bits() returns wrong values


From: Peter Hendrickson
Subject: gnutls_dh_get_prime_bits() returns wrong values
Date: 28 May 2009 18:25:31 -0000

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.

Peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]