peps: 8527f6e2beb0 (original) (raw)

--- a/pep-0466.txt +++ b/pep-0466.txt @@ -7,7 +7,7 @@ Status: Draft Type: Informational Content-Type: text/x-rst Created: 23-Mar-2014 -Post-History: 23-Mar-2014 +Post-History: 23-Mar-2014, 24-Mar-2014, 25-Mar-2014, 26-Mar-2014 Abstract @@ -22,8 +22,8 @@ This cadence works reasonably well durin feature release cycle, which is still applicable to the Python 3 series. However, the age of the standard library in Python 2 has now reached a point where it is sufficiently far behind the state of the art in network security -protocols for it to be causing real problems in commercial use cases -where upgrading to Python 3 in the near term may not be practical. +protocols for it to be causing real problems in use cases where upgrading to +Python 3 in the near term may not be feasible. In recognition of the additional practical considerations that have arisen during the 4+ year maintenance cycle for Python 2.7, this PEP allows @@ -31,91 +31,74 @@ Python 2.7 standard library components t overall security of the internet to be updated in line with the corresponding Python 3 feature releases. -Specifically, the exception will apply to: - -* the ssl module -* the hashlib module -* the hmac module -* the components of the random and os modules that the above

+ +* in the ssl module: -Under this exemption, these modules are updated to provide identical -functionality to their Python 3 counterparts after every new Python 3 -feature release. The default behaviour of the backported modules will be -adjusted as appropriate to meet the backwards compatibility requirements -of a Python 2.7 maintenance release.

As part of this policy, permission is also granted to upgrade to newer feature releases of OpenSSL when preparing the binary installers for new maintenance releases of Python 2.7. -Note that the sha and md5 modules are not covered by this policy, -but have been deprecated in favour of hashlib since Python 2.5 and have -been removed entirely in the Python 3 series. - -In addition to the above blanket exemption, a conditional exemption is -granted for these modules that may include some network security related -features: - -* the os module (specifically os.urandom) -* the random module - -This more limited exemption for these modules requires that the specific -enhancement being proposed for backporting needs to be justified as being -network security related. This is generally restricted to cases where the -feature in question is needed by an update to one of the modules covered -by the blanket exemption. - Backwards Compatibility Considerations ====================================== -This PEP does not grant Python 2.7 any general exemptions to the usual -backwards compatibility policy for maintenance releases. Instead, by -explicitly encouraging the use of feature based checks and explicitly -opting in to less secure configurations, it is designed to make it easier +As in the Python 3 series, the backported ssl.create_default_context() +API is granted a backwards compatibility exemption that permits the +protocol, options, cipher and other settings of the created SSL context to +be made + +This PEP does not grant any exemptions to the usual backwards +compatibility policy for maintenance releases. Instead, by explicitly +encouraging the use of feature based checks, it is designed to make it easier to write more secure cross-version compatible Python software, while still limiting the risk of breaking currently working software when upgrading to a new Python 2.7 maintenance release. -In all cases where this policy is applied to backport enhancements to -Python 2.7 maintenance releases, it MUST be possible to write cross-version +In all cases where this policy allows new features to be backported to +the Python 2.7 release series, it is possible to write cross-version compatible code that operates by "feature detection" (for example, checking -for particular attributes in the module), without needing to explicitly check +for particular attributes in a module), without needing to explicitly check the Python version. It is then up to library and framework code to provide an appropriate warning @@ -124,16 +107,17 @@ some especially security sensitive softw security feature is unavailable, most software SHOULD instead emit a warning and continue operating using a slightly degraded security configuration. -Affected APIs SHOULD be designed to allow library and application code to -perform the following actions after detecting the presence of a relevant +The backported APIs allow library and application code to perform the +following actions after detecting the presence of a relevant network security related feature:

+.. [2] PEP 466 discussion (round 2)

+.. [3] Marc-Andre Lemburg's OpenSSL feedback for Windows

+.. [4] Ned Deily's OpenSSL feedback for Mac OS X

+.. [5] PEP 466 discussion (round 3)

+.. [6] PEP 466 discussion (round 4)

+.. [7] Donald Stufft's recommended set of backported features

+.. [8] Alex Gaynor's recommended set of backported features

Copyright