Sunday, April 26, 2009

Legend for OpenSSL’s dhparam output

I was curious to find out the meaning of all the dots, pluses and stars that openssl dhparam outputs while computing Diffie-Hellman parameters.

To make a long story short, here’s the legend:

  • . : A potential prime number was generated.
  • + : Number is being tested for primality.
  • * : A prime number was found.

 

Reference:

http://openssl.org/docs/crypto/BN_generate_prime.html#DESCRIPTION

http://www.google.com/codesearch/p?hl=en#RPhFhNy2eoY/openssl-0.9.8b/apps/dhparam.c&q=DH_generate_parameters%20package:%22http://www.openssl.org/source/openssl-0.9.8b.tar.gz%22&l=541

Sunday, February 1, 2009

MIBS Missing Error on Wireshark Startup

I've installed Wireshark 1.0.5 without SNMP MIBs on Windows. Upon startup I received an error dialog about missing MIBs, containing text like:

The following errors were found while loading the MIBS:
-:0 1 module-not-found failed to locate MIB module `IP-MIB'
-:0 1 module-not-found failed to locate MIB module `IF-MIB'
-:0 1 module-not-found failed to locate MIB module `TCP-MIB'
(snippet from http://www.wireshark.org/lists/wireshark-dev/200711/msg00249.html)

The solution: rename or delete the file smi_modules under the Wireshark directory.


Technorati Tags: ,

Wednesday, March 5, 2008

FILETIME to time_t

Microsoft kindly provides the code to convert from time_t (Unix time) to Win32's FILETIME.
Here's the code to do the reverse:

time_t FileTimeToUnixTime(const FILETIME& ft)
{
// the reverse of http://support.microsoft.com/kb/167296/en-us
ULONGLONG ull = reinterpret_cast<const ULONGLONG&>(ft);
ull -= 116444736000000000;
ull /= 10000000;
assert(ull < ULONG_MAX);
return static_cast<time_t>(ull);
}