diff --git a/docs/changes.txt b/docs/changes.txt index fe9805bd..d067535c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -484,4 +484,4 @@ blockcheck: use tpws --fix-seg on linux for multiple splits v70.7 -nfqws,tpws: debug tls version +nfqws,tpws: debug tls version, alpn, ech diff --git a/nfq/desync.c b/nfq/desync.c index 54fb3d54..616b8698 100644 --- a/nfq/desync.c +++ b/nfq/desync.c @@ -87,21 +87,21 @@ void TLSDebug(const uint8_t *tls,size_t sz) { if (sz<11) return; - uint16_t v_rec=pntoh16(tls+1), v_handshake=pntoh16(tls+9), v; + uint16_t v_rec=pntoh16(tls+1), v_handshake=pntoh16(tls+9), v, v2; DLOG("TLS record layer version : %s\nTLS handshake version : %s\n",TLSVersionStr(v_rec),TLSVersionStr(v_handshake)); - const uint8_t *ext_supvers; - size_t len_supvers,len_supvers2; - if (TLSFindExt(tls,sz,43,&ext_supvers,&len_supvers,false)) + const uint8_t *ext; + size_t len,len2; + if (TLSFindExt(tls,sz,43,&ext,&len,false)) { - if (len_supvers) + if (len) { - len_supvers2 = ext_supvers[0]; - if (len_supvers2=2) + { + len2 = pntoh16(ext); + if (len2<=(len-2)) + { + char s[32]; + for(ext+=2; len2 ;) + { + v = *ext; ext++; len2--; + if (v<=len2) + { + v2 = v=2) + { + len2 = pntoh16(ext); + if (len2<=(len-2)) + { + char s[32]; + for(ext+=2; len2 ;) + { + v = *ext; ext++; len2--; + if (v<=len2) + { + v2 = v