diff options
author | Adam Langley <agl@chromium.org> | 2013-04-15 18:07:47 -0400 |
---|---|---|
committer | Adam Langley <agl@chromium.org> | 2013-09-13 11:27:22 -0400 |
commit | b0d6f3c58fc86756574b410cb6a32589477d3954 (patch) | |
tree | 2a7d1dec7ff22974b355b4ffebfbf6fdaeea1a3b /ssl/s3_lib.c | |
parent | 033864842607895730d97baf4103da24f1207762 (diff) |
Support ALPN.
This change adds support for ALPN[1] in OpenSSL. ALPN is the IETF
blessed version of NPN and we'll be supporting both ALPN and NPN for
some time yet.
Cherry-picked from 6f017a8f9db3a79f3a3406cf8d493ccd346db691.
[1] https://tools.ietf.org/html/draft-ietf-tls-applayerprotoneg-00
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index f3acb8a96a..601168126b 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3002,6 +3002,11 @@ void ssl3_free(SSL *s) BIO_free(s->s3->handshake_buffer); } if (s->s3->handshake_dgst) ssl3_free_digest_list(s); +#ifndef OPENSSL_NO_TLSEXT + if (s->s3->alpn_selected) + OPENSSL_free(s->s3->alpn_selected); +#endif + #ifndef OPENSSL_NO_SRP SSL_SRP_CTX_free(s); #endif @@ -3080,6 +3085,14 @@ void ssl3_clear(SSL *s) if (s->s3->handshake_dgst) { ssl3_free_digest_list(s); } + +#if !defined(OPENSSL_NO_TLSEXT) + if (s->s3->alpn_selected) + { + free(s->s3->alpn_selected); + s->s3->alpn_selected = NULL; + } +#endif memset(s->s3,0,sizeof *s->s3); s->s3->rbuf.buf = rp; s->s3->wbuf.buf = wp; |