Christian Heimes <li...@cheimes.de> added the comment:

The weird argument style of a required digestmod with None as default is an 
unfortunate outcome of the old API. The msg and digestmod argument can be 
passed in as keyword and as positional argument. I studied existing code and 
have considered to make digestmod a required keyword-only argument, but that 
would have broken too much code. The current style is backwards compatible with 
all code except for code that must be changed any way.

Only code that depends on implicit default digestmod="md5" breaks. The code 
must adjusted for the deprecation no matter the argument style. The required 
change is fully backwards compatible with Python 2.7 to 3.7. Bottle is such a 
case that got broken by the deprecation.

It does not make sense to default to another hashing algorithm:
* This would also break software. Applications would suddenly get a different 
MAC for the same function call and arguments.
* In cryptography the HMAC algorithm is an operation on a key, message, and 
PRF. Defaulting to MD5 didn't make sense in the first place.
* Cryptographic primitives have a 'best before' date. SHA256 might become 
broken in a decade -- maybe 9 years and 364 days earlier, maybe 20 years later. 
I don't want to do another deprecation cycle.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33604>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to