diff options
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r-- | src/lib/ndpi_utils.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index 480f4ff18..933d5634c 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -590,7 +590,12 @@ const char* ndpi_cipher2str(u_int32_t cipher) { case 0x060040: return("SSL2_DES_64_CBC_WITH_MD5"); case 0x0700c0: return("SSL2_DES_192_EDE3_CBC_WITH_MD5"); case 0x080080: return("SSL2_RC4_64_WITH_MD5"); - case 0x001301: return("TLS_AES_128_GMC_SHA256"); + case 0x001301: return("TLS_AES_128_GCM_SHA256"); + case 0x001302: return("TLS_AES_256_GCM_SHA384"); + case 0x001303: return("TLS_CHACHA20_POLY1305_SHA256"); + case 0x001304: return("TLS_AES_128_CCM_SHA256"); + case 0x001305: return("TLS_AES_128_CCM_8_SHA256"); + default: { static char buf[8]; @@ -682,3 +687,24 @@ int ndpi_has_human_readeable_string(struct ndpi_detection_module_struct *ndpi_st return(ret); } + +/* ********************************** */ + +char* ndpi_ssl_version2str(u_int16_t version) { + static char v[8]; + + switch(version) { + case 0x300: return("SSLv3"); + case 0x301: return("TLSv1"); + case 0x302: return("TLSv1.1"); + case 0x303: return("TLSv1.2"); + case 0x304: return("TLSv1.3"); + } + + if((version >= 0x7f00) && (version <= 0x7fff)) + return("TLSv1.3 (draft)"); + + snprintf(v, sizeof(v), "%04X", version); + return(v); +} + |