Add the signature algorithm that was used to sign the target port's x509 (TLS) certificate to the output of ssl-cert.nse

http://seclists.org/nmap-dev/2014/q4/44
This commit is contained in:
tomsellers 2014-10-25 18:56:38 +00:00
parent ea749d785b
commit e11e03fa50
3 changed files with 48 additions and 36 deletions

View file

@ -449,12 +449,16 @@ int l_get_ssl_certificate(lua_State *L)
subject = X509_get_subject_name(cert);
if (subject != NULL) {
x509_name_to_table(L, subject);
lua_setfield(L, -2, "subject");
}
issuer = X509_get_issuer_name(cert);
if (issuer != NULL) {
x509_name_to_table(L, issuer);
lua_setfield(L, -2, "subject");
}
const char *sig_algo = OBJ_nid2ln(OBJ_obj2nid(cert->sig_alg->algorithm));
lua_pushstring(L, sig_algo);
lua_setfield(L, -2, "sig_algorithm");
issuer = X509_get_issuer_name(cert);
if (issuer != NULL) {
x509_name_to_table(L, issuer);
lua_setfield(L, -2, "issuer");
}