Fix notBefore/notAfter issues
This commit is contained in:
@@ -918,17 +918,18 @@ void getSSLorganization(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
if(len < (sizeof(utcDate)-1)) {
|
if(len < (sizeof(utcDate)-1)) {
|
||||||
struct tm utc;
|
struct tm utc;
|
||||||
|
utc.tm_isdst = -1; /* Not set by strptime */
|
||||||
|
|
||||||
strncpy(utcDate, (const char*)&packet->payload[i+4], len);
|
strncpy(utcDate, (const char*)&packet->payload[i+4], len);
|
||||||
utcDate[len] = '\0';
|
utcDate[len] = '\0';
|
||||||
|
|
||||||
/* 141021000000Z */
|
/* 141021000000Z */
|
||||||
if(strptime(utcDate, "%y%m%d%H%M%SZ", &utc) != NULL) {
|
if(strptime(utcDate, "%d%m%y%H%M%SZ", &utc) != NULL) {
|
||||||
|
flow->protos.stun_ssl.ssl.notBefore = timegm(&utc);
|
||||||
#ifdef DEBUG_TLS
|
#ifdef DEBUG_TLS
|
||||||
printf("[CERTIFICATE] notBefore %u [%s]\n",
|
printf("[CERTIFICATE] notBefore %u [%s]\n",
|
||||||
(unsigned int)mktime(&utc), utcDate);
|
flow->protos.stun_ssl.ssl.notBefore, utcDate);
|
||||||
#endif
|
#endif
|
||||||
flow->protos.stun_ssl.ssl.notBefore = timegm(&utc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -948,17 +949,18 @@ void getSSLorganization(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
if(len < (sizeof(utcDate)-1)) {
|
if(len < (sizeof(utcDate)-1)) {
|
||||||
struct tm utc;
|
struct tm utc;
|
||||||
|
utc.tm_isdst = -1; /* Not set by strptime */
|
||||||
|
|
||||||
strncpy(utcDate, (const char*)&packet->payload[offset], len);
|
strncpy(utcDate, (const char*)&packet->payload[offset], len);
|
||||||
utcDate[len] = '\0';
|
utcDate[len] = '\0';
|
||||||
|
|
||||||
/* 141021000000Z */
|
/* 141021000000Z */
|
||||||
if(strptime(utcDate, "%y%m%d%H%M%SZ", &utc) != NULL) {
|
if(strptime(utcDate, "%d%m%y%H%M%SZ", &utc) != NULL) {
|
||||||
|
flow->protos.stun_ssl.ssl.notAfter = timegm(&utc);
|
||||||
#ifdef DEBUG_TLS
|
#ifdef DEBUG_TLS
|
||||||
printf("[CERTIFICATE] notAfter %u [%s]\n",
|
printf("[CERTIFICATE] notAfter %u [%s]\n",
|
||||||
(unsigned int)mktime(&utc), utcDate);
|
flow->protos.stun_ssl.ssl.notAfter, utcDate);
|
||||||
#endif
|
#endif
|
||||||
flow->protos.stun_ssl.ssl.notAfter = timegm(&utc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user