Skip to content

Commit 543f47c

Browse files
committed
nginx-ssl-ja3: fix unknown curves
1 parent bdd2633 commit 543f47c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ the patch is already applied. Check the Dockerfile of the dev image.
8585

8686
### Patches
8787

88-
- [save Client Hello extensions at nginx's SSL connection](docker/debian-nginx-ssl-ja3/nginx.ssl.extensions.patch)
88+
- [save Client Hello extensions at nginx's SSL connection](patches/latest.patch)
8989

9090

9191
### Compilation and installation

src/ngx_ssl_ja3.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static const int nid_list[] = {
9292
};
9393

9494

95-
static unsigned char
95+
static unsigned short
9696
ngx_ssl_ja3_nid_to_cid(int nid)
9797
{
9898
unsigned char sz = (sizeof(nid_list) / sizeof(nid_list[0]));
@@ -102,7 +102,8 @@ ngx_ssl_ja3_nid_to_cid(int nid)
102102
return i+1;
103103
}
104104
}
105-
return 0;
105+
106+
return nid;
106107
}
107108

108109
static size_t
@@ -369,7 +370,7 @@ ngx_ssl_ja3(ngx_connection_t *c, ngx_pool_t *pool, ngx_ssl_ja3_t *ja3) {
369370

370371
SSL_get1_curves(ssl, curves_out);
371372

372-
len = ja3->curves_sz * sizeof(unsigned char);
373+
len = ja3->curves_sz * sizeof(unsigned short);
373374
ja3->curves = ngx_pnalloc(pool, len);
374375
if (ja3->curves == NULL) {
375376
return NGX_DECLINED;

src/ngx_ssl_ja3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct ngx_ssl_ja3_s {
3838
int *extensions;
3939

4040
size_t curves_sz;
41-
unsigned char *curves;
41+
unsigned short *curves;
4242

4343
size_t point_formats_sz;
4444
unsigned char *point_formats;

0 commit comments

Comments
 (0)