File tree Expand file tree Collapse file tree 5 files changed +20
-12
lines changed Expand file tree Collapse file tree 5 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -1465,8 +1465,11 @@ ngx-ssl-session-ticket-keys
1465
1465
Dumping ssl session ticket keys of a nginx worker.
1466
1466
1467
1467
``` bash
1468
+ # making the ./stap++ tool visible in PATH:
1469
+ $ export PATH=$PWD :$PATH
1470
+
1468
1471
# assuming one nginx worker process has the pid 3781.
1469
- $ ./samples/ngx-ssl-session-ticket-keys.sxx -I ./tapset - x 3781
1472
+ $ ./samples/ngx-ssl-session-ticket-keys.sxx -x 3781
1470
1473
```
1471
1474
1472
1475
[ Back to TOC] ( #table-of-contents )
@@ -1477,6 +1480,9 @@ ngx-ssl-session-resumption-stats
1477
1480
Analyzing the statistics of nginx SSL/TLS session ticket resumption.
1478
1481
1479
1482
``` bash
1483
+ # making the ./stap++ tool visible in PATH:
1484
+ $ export PATH=$PWD :$PATH
1485
+
1480
1486
# assuming one nginx worker process has the pid 3781.
1481
1487
$ ./samples/ngx-ssl-session-resumption-stats.sxx -x 3781
1482
1488
```
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env stap++
2
2
3
- # Capture ssl session resumption statistics.
3
+ # Capture ssl session resumption statistics.
4
4
5
5
global total
6
6
global tickets
@@ -39,7 +39,7 @@ probe end {
39
39
ratio2 = (resumed * 100) / tickets;
40
40
41
41
} else {
42
- ratio2 = 0;
42
+ ratio2 = 0;
43
43
}
44
44
printf("Session resumption attempts ratio: %d percent\n", ratio1)
45
45
printf("Session resumption success ratio: %d percent\n", ratio2)
Original file line number Diff line number Diff line change 3
3
# Capture ssl session tickets.
4
4
5
5
@use nginx.array
6
- @use nginx. openssl
6
+ @use openssl
7
7
8
8
probe begin {
9
9
printf("Start tracing NGX OPENSSL ticket key callback\n")
@@ -14,7 +14,7 @@ function print_key_name(name) {
14
14
printf("key name: ");
15
15
$*n := @cast(name, "unsigned char", "$^exec_path")
16
16
for (i=0; i<16; i++) {
17
- printf("%02x", $*n[i])
17
+ printf("%02x", $*n[i])
18
18
}
19
19
printf("\n")
20
20
}
@@ -24,7 +24,7 @@ function print_key_aes(state) {
24
24
printf("key aes state: ");
25
25
$*s := @cast(state, "unsigned char", "$^exec_path")
26
26
for (i=0; i<16; i++) {
27
- printf("%02x", $*s[i])
27
+ printf("%02x", $*s[i])
28
28
}
29
29
printf("\n")
30
30
}
@@ -34,7 +34,7 @@ function print_key_hmac(state) {
34
34
printf("key hmac state: ");
35
35
$*s := @cast(state, "unsigned char", "$^exec_path")
36
36
for (i=0; i<16; i++) {
37
- printf("%02x", $*s[i])
37
+ printf("%02x", $*s[i])
38
38
}
39
39
printf("\n")
40
40
}
@@ -63,7 +63,7 @@ probe @pfunc(ngx_ssl_session_ticket_key_callback).return {
63
63
} else {
64
64
key_ptr = get_ngx_array_elts(keys)
65
65
enc_key = key_ptr
66
- last_key = &@cast(key_ptr, "ngx_ssl_session_ticket_key_t", "$^exec_path")[keys_len-1]
66
+ last_key = &@cast(key_ptr, "ngx_ssl_session_ticket_key_t", "$^exec_path")[keys_len-1]
67
67
printf("keys len %d\n", keys_len)
68
68
printf("enc key:\n")
69
69
print_session_ticket_key(enc_key)
Original file line number Diff line number Diff line change 3
3
function get_ngx_array_len(ngx_arr) {
4
4
$*arr := @cast(ngx_arr, "ngx_array_t", "$^exec_path")
5
5
return $*arr->nelts
6
-
6
+
7
7
}
8
8
9
9
function get_ngx_array_elts(ngx_arr) {
Original file line number Diff line number Diff line change 1
- // module nginx. openssl
1
+ // module openssl.ssl_ctx
2
2
3
3
// extract ex_data pointer from openssl SSL_CTX
4
4
function get_ssl_ex_data(ssl_ctx) {
@@ -9,11 +9,13 @@ function get_ssl_ex_data(ssl_ctx) {
9
9
// extract number of items in SSL_CTX ex_data
10
10
function get_ssl_ex_data_len(ssl_ctx) {
11
11
ex_data = get_ssl_ex_data(ssl_ctx)
12
- return ex_data->sk->stack->num
12
+ $*data := @cast(ex_data, "CRYPTO_EX_DATA", "$^exec_path")
13
+ return $*data->sk->stack->num
13
14
}
14
15
15
16
// extract the item specified by idx in SSL_CTX ex_data
16
17
function get_ssl_ex_data_item(ssl_ctx, idx) {
17
18
ex_data = get_ssl_ex_data(ssl_ctx)
18
- return ex_data->sk->stack->data[idx]
19
+ $*data := @cast(ex_data, "CRYPTO_EX_DATA", "$^exec_path")
20
+ return $*data->sk->stack->data[idx]
19
21
}
You can’t perform that action at this time.
0 commit comments