Missing information from XML when certificate not yet valid
In sslscan.c, in the "if (options->xmlOutput)" block code related to the not-valid-before (lines 2322-2326) there is no XML reporting about certificate not valid. I would have expected something like the "if (options->xmlOutput)" block code related to the not-valid-after, which in lines 2345-2352 writes in the XML the outcome of the time diff.
Are you saying that you'd like the non-XML output say something like "Certificate validity: expired" ?
FYI, expired certificates are already shown to the user in red. See: https://github.com/rbsec/sslscan/blob/3fa40d0a43032c6f0d98248611d515094c63fc15/sslscan.c#L2333
Hi Joe, nope, I'm afraid I didn't explain the right way. I'm saying that I'd like the XML output say something like <not-yet-valid>true</not-yet-valid> or <not-yet-valid>false</not-yet-valid>.
To be more precise, right now the lines 2322-2326 are these:
if (options->xmlOutput) {
printf_xml(" <not-valid-before>");
ASN1_TIME_print(fileBIO, X509_get_notBefore(x509Cert));
printf_xml("</not-valid-before>\n");
}
I'd like them to be something like this:
if (options->xmlOutput) {
printf_xml(" <not-valid-before>");
ASN1_TIME_print(fileBIO, X509_get_notBefore(x509Cert));
printf_xml("</not-valid-before>\n");
if (timediff > 0)
{
printf_xml(" <not-yet-valid>true</not-yet-valid>\n");
}
else
{
printf_xml(" <not-yet-valid>false</not-yet-valid>\n");
}
}
Hi @lucacapacci,
Thanks - this looks like a sensible thing to add into the XML. I'm curious though: is this something that you're actually seeing out in the world, and can you share any details about what kind of systems/devices/etc you're seeing it on? I'm not sure I've ever come across this in the wild.
I think in many years it happened to me just one time and I don't remember the host in which it happened. However, I'm developing an XML parser for sslscan and I thought it would be nice to take into account even these edge cases.
Fair enough. I was wondering if there was some vendor out there who was doing this, but if it's just for completeness that makes sense.