cpython/Modules/clinic
Christian Heimes 7316c6d4a5 [3.6] bpo-30622: Change NPN detection: (GH-2079) (#3314)
* Change NPN detection:

Version breakdown, support disabled (pre-patch/post-patch):
- pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False
- 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will not be defined ->
False/False
- 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and
OPENSSL_NO_NEXTPROTONEG will be defined -> True/False

Version breakdown support enabled (pre-patch/post-patch):
- pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False
- 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will be defined and
OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True
- 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and
OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True

* Refine NPN guard:

- If NPN is disabled, but ALPN is available we need our callback
- Make clinic's ssl behave the same way

This created a working ssl module for me, with NPN disabled and ALPN
enabled for OpenSSL 1.1.0f.

Concerns to address:
The initial commit for NPN support into OpenSSL [1], had the
OPENSSL_NPN_* variables defined inside the OPENSSL_NO_NEXTPROTONEG
guard. The question is if that ever made it into a release.
This would need an ugly hack, something like:

	GH-if defined(OPENSSL_NO_NEXTPROTONEG) && \
		!defined(OPENSSL_NPN_NEGOTIATED)
	GH-	define OPENSSL_NPN_UNSUPPORTED 0
	GH-	define OPENSSL_NPN_NEGOTIATED 1
	GH-	define OPENSSL_NPN_NO_OVERLAP 2
	GH-endif

[1] https://github.com/openssl/openssl/commit/68b33cc5c7
(cherry picked from commit b2d096b)
2017-09-05 16:00:44 +02:00
..
_asynciomodule.c.h bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076) (#3269) 2017-09-03 09:24:32 +03:00
_bz2module.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_codecsmodule.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_cryptmodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
_cursesmodule.c.h
_datetimemodule.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_dbmmodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
_elementtree.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_gdbmmodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
_hashopenssl.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_lzmamodule.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_opcode.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
_pickle.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_sre.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
_ssl.c.h [3.6] bpo-30622: Change NPN detection: (GH-2079) (#3314) 2017-09-05 16:00:44 +02:00
_tkinter.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
_weakref.c.h Issue #28427: old keys should not remove new values from 2016-12-27 14:23:43 +01:00
_winapi.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
arraymodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
audioop.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
binascii.c.h Issue #29004: Merge crc_hqx() doc from 3.5 2016-12-24 07:44:03 +00:00
cmathmodule.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
fcntlmodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
grpmodule.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
md5module.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
posixmodule.c.h Issue #29092: Sync os.stat's doc and docstring on path type. 2017-01-22 13:04:17 +08:00
pwdmodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
pyexpat.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
sha1module.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
sha256module.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
sha512module.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00
signalmodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
spwdmodule.c.h - Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 18:20:03 +03:00
unicodedata.c.h
zlibmodule.c.h Issue #27810: Rerun Argument Clinic on all modules 2016-09-09 20:00:13 -07:00