Compare commits

...

3 Commits

Author SHA1 Message Date
nervuri 4bcd168abc move html, js, css and gmi files to "frontend" dir 2023-09-20 09:53:02 +00:00
nervuri b899c240f4 replace "if" with "switch" in JA3 and NJA3 code
For clarity.
2023-09-20 09:51:41 +00:00
nervuri 0251e59a10 fix link to NJA3 code 2023-09-20 09:50:25 +00:00
9 changed files with 17 additions and 27 deletions

View File

@ -11,22 +11,10 @@ Files: .gitignore
Copyright: 2022-2023 nervuri <https://nervuri.net/contact>
License: BSD-3-Clause
Files: *.gmi
Files: frontend/*
Copyright: 2022-2023 nervuri <https://nervuri.net/contact>
License: BSD-3-Clause
Files: *.tpl
Copyright: 2022-2023 nervuri <https://nervuri.net/contact>
License: BSD-3-Clause
Files: style.css
Copyright: 2023 nervuri <https://nervuri.net/contact>
License: BSD-3-Clause
Files: script.js
Copyright: 2023 nervuri <https://nervuri.net/contact>
License: BSD-3-Clause
Files: clienthello/*.csv
Copyright: IANA and IETF
License: CC0-1.0

View File

@ -93,4 +93,4 @@ On a final note, string-based fingerprinting is fundamentally limited compared t
## Implementation
The first implementation is written in Go and can be found [here](https://tildegit.org/nervuri/client-hello-mirror/clienthello/fingerprint.go#L57). This code is part of the TLS Client Hello Mirror, a live instance of which is running at [tlsprivacy.nervuri.net](https://tlsprivacy.nervuri.net/), which will (among other things) generate the NJA3 fingerprint of any HTTPS or [Gemini](https://geminiprotocol.net/) client you connect to it.
The first implementation is written in Go and can be found [here](https://tildegit.org/nervuri/client-hello-mirror/src/branch/master/clienthello/fingerprint.go#L69). This code is part of the TLS Client Hello Mirror, a live instance of which is running at [tlsprivacy.nervuri.net](https://tlsprivacy.nervuri.net/), which will (among other things) generate the NJA3 fingerprint of any HTTPS or [Gemini](https://geminiprotocol.net/) client you connect to it.

View File

@ -48,11 +48,12 @@ func (m *ClientHelloMsg) ja3() {
}
for _, e := range m.Extensions {
codeGroups[2] += deGREASE16(e.Code, "")
if e.Code == extensionSupportedGroups {
switch e.Code {
case extensionSupportedGroups:
for _, g := range e.Data.SupportedGroups {
codeGroups[3] += deGREASE16(g.(uint16), "")
}
} else if e.Code == extensionSupportedPointFormats {
case extensionSupportedPointFormats:
for _, pf := range e.Data.SupportedPointFormats {
codeGroups[4] += toString(pf.(uint8)) + "-"
}
@ -95,27 +96,28 @@ func (m *ClientHelloMsg) nja3() {
e.Code = genericGREASECode16
}
extCodes = append(extCodes, e.Code)
if e.Code == extensionSupportedGroups {
switch e.Code {
case extensionSupportedGroups:
for _, g := range e.Data.SupportedGroups {
codeGroups[4] += deGREASE16(g.(uint16), genericGreaseString16)
}
} else if e.Code == extensionSupportedPointFormats {
case extensionSupportedPointFormats:
for _, pf := range e.Data.SupportedPointFormats {
codeGroups[5] += toString(pf.(uint8)) + "-"
}
} else if e.Code == extensionSupportedVersions {
case extensionSupportedVersions:
for _, v := range e.Data.SupportedVersions {
codeGroups[6] += deGREASE16(v.(uint16), genericGreaseString16)
}
} else if e.Code == extensionSignatureAlgorithms {
case extensionSignatureAlgorithms:
for _, sa := range e.Data.SupportedSignatureAlgorithms {
codeGroups[7] += deGREASE16(sa.(uint16), genericGreaseString16)
}
} else if e.Code == extensionPSKModes {
case extensionPSKModes:
for _, mode := range e.Data.PSKModes {
codeGroups[8] += deGREASE8(mode.(uint8), genericGreaseString8)
}
} else if e.Code == extensionCompressCertificate {
case extensionCompressCertificate:
for _, algo := range e.Data.CertificateCompressionAlgos {
codeGroups[9] += toString(algo.(uint16)) + "-"
}

View File

@ -54,19 +54,19 @@ func fatalError(err ...any) {
logger.Fatal(err...)
}
//go:embed index.html
//go:embed frontend/index.html
var html string
//go:embed error.html
//go:embed frontend/error.html
var htmlError string
//go:embed style.css
//go:embed frontend/style.css
var css string
//go:embed script.js
//go:embed frontend/script.js
var js string
//go:embed index.gmi
//go:embed frontend/index.gmi
var gemtext string
// Copy the Client Hello message before starting the TLS handshake.