Validity format fix

This commit is contained in:
Luca Deri
2019-09-10 21:44:04 +02:00
parent 8186b72c11
commit 1f417fe67d
+4 -4
View File
@@ -1110,11 +1110,11 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
if(flow->ssh_tls.notBefore && flow->ssh_tls.notAfter) { if(flow->ssh_tls.notBefore && flow->ssh_tls.notAfter) {
char notBefore[32], notAfter[32]; char notBefore[32], notAfter[32];
struct tm *before = gmtime(&flow->ssh_tls.notBefore);
struct tm *after = gmtime(&flow->ssh_tls.notAfter);
ctime_r(&flow->ssh_tls.notBefore, notBefore); strftime(notBefore, sizeof(notBefore), "%F %T", before);
notBefore[strlen(notBefore)-1] = '\0'; /* Remove trailer \n */ strftime(notAfter, sizeof(notAfter), "%F %T", after);
ctime_r(&flow->ssh_tls.notAfter, notAfter);
notAfter[strlen(notAfter)-1] = '\0'; /* Remove trailer \n */
fprintf(out, "[Validity: %s - %s]", notBefore, notAfter); fprintf(out, "[Validity: %s - %s]", notBefore, notAfter);
} }