| Index: openssl/ssl/ssl_lib.c
|
| ===================================================================
|
| --- openssl/ssl/ssl_lib.c (revision 65717)
|
| +++ openssl/ssl/ssl_lib.c (working copy)
|
| @@ -324,6 +324,9 @@
|
| CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
|
| s->initial_ctx=ctx;
|
| s->next_proto_negotiated = NULL;
|
| + s->next_proto_negotiated_len = 0;
|
| + s->next_proto_select_cb = ctx->next_proto_select_cb;
|
| + s->next_proto_select_cb_arg = ctx->next_proto_select_cb_arg;
|
| #endif
|
| s->verify_result=X509_V_OK;
|
|
|
| @@ -2870,9 +2873,12 @@
|
| * The length of the protocol name must be written into |outlen|. The server's
|
| * advertised protocols are provided in |in| and |inlen|. The callback can
|
| * assume that |in| is syntactically valid.
|
| + * A side effect of calling this method with a non-NULL |cb| is to enable NPN
|
| + * for all SSLs subsequently created from this CTX. Passing a NULL |cb| resets
|
| + * the CTX so future connections will not use NPN.
|
| *
|
| - * The client must select a protocol. It is fatal to the connection if this
|
| - * callback returns a value other than SSL_TLSEXT_ERR_OK.
|
| + * When enabled, the client must select a protocol. It is fatal to the
|
| + * connection if this callback returns a value other than SSL_TLSEXT_ERR_OK.
|
| */
|
| void SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, int (*cb) (SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg), void *arg)
|
| {
|
| @@ -2880,6 +2886,19 @@
|
| ctx->next_proto_select_cb_arg = arg;
|
| }
|
|
|
| +/* SSL_set_next_proto_select_cb is a per-connection alternative to
|
| + * SSL_CTX_set_next_proto_select_cb, see that function for full description of
|
| + * the parameters.
|
| + * This method may also be used to modify a CTX default, for example disable
|
| + * NPN by passing a NULL |cb| or modify the callback argument by passing a
|
| + * valid |cb| and an updated |arg|.
|
| + */
|
| +void SSL_set_next_proto_select_cb(SSL *s, int (*cb) (SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg), void *arg)
|
| + {
|
| + s->next_proto_select_cb = cb;
|
| + s->next_proto_select_cb_arg = arg;
|
| + }
|
| +
|
| /* SSL_CTX_set_snap_start_orbit sets the orbit value which will be echoed back
|
| * to the client and enables Snap Start for this context.
|
| *
|
|
|