Nmap Development mailing list archives

Re: SSL certificate key length in ssl-cert.nse


From: David Fifield <david () bamsoftware com>
Date: Fri, 1 Oct 2010 17:08:22 -0600

On Fri, Oct 01, 2010 at 05:54:54PM -0400, Matt Selsky wrote:
Has anyone patched ssl-cert.nse to grab the length of the public key?  I  
need to start checking my campus for 1024-bit keys...

It looks like nse_ssl_cert.cc doesn't yet have support for getting key  
length information.  Is such a function needed, or can I get the  
information a different way?

Yes, you should just add whatever you need to l_get_ssl_certificate. It
will mean finding the appropriate OpenSSL function, then storing the
result of calling the function in the returned table.

You can see an example of getting a key size in the OpenSSL source code,
in the file apps/s_client.c. ("Server public key is %d bit\n".)

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: