diff --git a/CHANGELOG b/CHANGELOG
index eda541c69..481e9d682 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,8 @@
# Nmap Changelog ($Id$); -*-text-*-
+o [NSE] Add the signature algorithm that was used to sign the target port's
+ x509 certificate to the output of ssl-cert.nse [Tom Sellers]
+
o [NSE] Fixed a bug in the sslcert.lua library that was triggered against
certain services when version detection was used. [Tom Sellers]
diff --git a/nse_ssl_cert.cc b/nse_ssl_cert.cc
index a5504eed4..a126aeb2f 100644
--- a/nse_ssl_cert.cc
+++ b/nse_ssl_cert.cc
@@ -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");
}
diff --git a/scripts/ssl-cert.nse b/scripts/ssl-cert.nse
index 2e766c9a9..b7a3b9c70 100644
--- a/scripts/ssl-cert.nse
+++ b/scripts/ssl-cert.nse
@@ -26,12 +26,13 @@ With -v it adds the issuer name and fingerprints.
| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
/stateOrProvinceName=California/countryName=US
| Issuer: commonName=VeriSign Class 3 Extended Validation SSL CA\
-/organizationName=VeriSign, Inc./countryName=US
-| Public Key type: rsa
-| Public Key bits: 2048
-| Not valid before: 2011-03-23 00:00:00
-| Not valid after: 2013-04-01 23:59:59
-| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
+/organizationName=VeriSign, Inc./countryName=US
+| Public Key type: rsa
+| Public Key bits: 2048
+| Signature Algorithm: sha1WithRSAEncryption
+| Not valid before: 2011-03-23 00:00:00
+| Not valid after: 2013-04-01 23:59:59
+| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
|_SHA-1: d846 5221 467a 0d15 3df0 9f2e af6d 4390 0213 9a68
@@ -47,12 +48,13 @@ certificate.
/organizationalUnitName=PayPal Production/businessCategory=Private Organization
| Issuer: commonName=VeriSign Class 3 Extended Validation SSL CA\
/organizationName=VeriSign, Inc./countryName=US\
-/organizationalUnitName=Terms of use at https://www.verisign.com/rpa (c)06
-| Public Key type: rsa
-| Public Key bits: 2048
-| Not valid before: 2011-03-23 00:00:00
-| Not valid after: 2013-04-01 23:59:59
-| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
+/organizationalUnitName=Terms of use at https://www.verisign.com/rpa (c)06
+| Public Key type: rsa
+| Public Key bits: 2048
+| Signature Algorithm: sha1WithRSAEncryption
+| Not valid before: 2011-03-23 00:00:00
+| Not valid after: 2013-04-01 23:59:59
+| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
| SHA-1: d846 5221 467a 0d15 3df0 9f2e af6d 4390 0213 9a68
| -----BEGIN CERTIFICATE-----
| MIIGSzCCBTOgAwIBAgIQLjOHT2/i1B7T//819qTJGDANBgkqhkiG9w0BAQUFADCB
@@ -92,12 +94,13 @@ certificate.
--