Skip to content

Commit ce2cdac

Browse files
committed
SSL test framework: port NPN and ALPN tests
Reviewed-by: Rich Salz <[email protected]>
1 parent 02f730b commit ce2cdac

18 files changed

+1403
-119
lines changed

doc/ssl/SSL_CTX_set_alpn_select_cb.pod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ the application callback.
4444
B<cb> is the application defined callback. The B<in>, B<inlen> parameters are a
4545
vector in protocol-list format. The value of the B<out>, B<outlen> vector
4646
should be set to the value of a single protocol selected from the B<in>,
47-
B<inlen> vector. The B<arg> parameter is the pointer set via
47+
B<inlen> vector. The B<out> buffer may point directly into B<in>, or to a
48+
buffer that outlives the handshake. The B<arg> parameter is the pointer set via
4849
SSL_CTX_set_alpn_select_cb().
4950

5051
SSL_select_next_proto() is a helper function used to select protocols. It

ssl/ssl_stat.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ const char *SSL_alert_desc_string_long(int value)
335335
return "bad certificate hash value";
336336
case TLS1_AD_UNKNOWN_PSK_IDENTITY:
337337
return "unknown PSK identity";
338+
case TLS1_AD_NO_APPLICATION_PROTOCOL:
339+
return "no application protocol";
338340
default:
339341
return "unknown";
340342
}

test/README.ssltest.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ The test section supports the following options:
8484
- No - a session ticket is not expected
8585
- Broken - a special test case where the session ticket callback does not initialize crypto
8686

87+
* ServerNPNProtocols, Server2NPNProtocols, ClientNPNProtocols, ExpectedNPNProtocol,
88+
ServerALPNProtocols, Server2ALPNProtocols, ClientALPNProtocols, ExpectedALPNProtocol -
89+
NPN and ALPN settings. Server and client protocols can be specified as a comma-separated list,
90+
and a callback with the recommended behaviour will be installed automatically.
91+
8792
## Configuring the client and server
8893

8994
The client and server configurations can be any valid `SSL_CTX`

0 commit comments

Comments
 (0)