New submission from Christian Heimes <li...@cheimes.de>:

Python uses valid Python identifiers for hashing algorithms while OpenSSL uses 
slightly different default names. For example OpenSSL uses "SHA3-256" while 
Python has "sha3_256". The function py_digest_by_name() in _hashopenssl.c maps 
from Python names to EVP_MD pointer.

It's possible to simplify the lookup by registering Python's aliases with 
OpenSSL, e.g. EVP_add_digest_alias(SN_sha3_512, "sha3_512").

Also see https://github.com/openssl/openssl/issues/11715

----------
assignee: christian.heimes
components: Library (Lib), SSL
messages: 367968
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
stage: patch review
status: open
title: _hashlib: register Python names as OpenSSL aliases
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

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

Reply via email to