classification
Title: Numerous warnings with blake2 module
Type: compile error Stage: resolved
Components: Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, gregory.p.smith, inada.naoki, lukasz.langa, miss-islington, pablogsal, remi.lapeyre
Priority: release blocker Keywords: patch

Created on 2019-05-26 16:08 by remi.lapeyre, last changed 2019-08-26 20:43 by christian.heimes. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14646 merged inada.naoki, 2019-07-08 12:02
PR 15525 merged miss-islington, 2019-08-26 17:52
Messages (11)
msg343556 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-05-26 16:08
Issue 33164 (commit 51aa35e9e17eef60d04add9619fe2a7eb938358c) introduced numerous new warnings on MacOS:

/Users/remi/src/cpython/Modules/_blake2/impl/blake2b.c:192:9: warning: 'blake2b_init' macro redefined
      [-Wmacro-redefined]
#define blake2b_init BLAKE2_IMPL_NAME(blake2b_init)
        ^
/Users/remi/src/cpython/Modules/_blake2/blake2ns.h:10:9: note: previous definition is here
#define blake2b_init       PyBlake2_blake2b_init
        ^
In file included from /Users/remi/src/cpython/Modules/_blake2/blake2b_impl.c:32:
/Users/remi/src/cpython/Modules/_blake2/impl/blake2b.c:193:9: warning: 'blake2b_init_param' macro redefined
      [-Wmacro-redefined]
#define blake2b_init_param BLAKE2_IMPL_NAME(blake2b_init_param)
        ^
/Users/remi/src/cpython/Modules/_blake2/blake2ns.h:12:9: note: previous definition is here
#define blake2b_init_param PyBlake2_blake2b_init_param
        ^
In file included from /Users/remi/src/cpython/Modules/_blake2/blake2b_impl.c:32:
/Users/remi/src/cpython/Modules/_blake2/impl/blake2b.c:194:9: warning: 'blake2b_init_key' macro redefined
      [-Wmacro-redefined]
#define blake2b_init_key BLAKE2_IMPL_NAME(blake2b_init_key)
        ^
/Users/remi/src/cpython/Modules/_blake2/blake2ns.h:11:9: note: previous definition is here
#define blake2b_init_key   PyBlake2_blake2b_init_key
        ^
In file included from /Users/remi/src/cpython/Modules/_blake2/blake2b_impl.c:32:
/Users/remi/src/cpython/Modules/_blake2/impl/blake2b.c:195:9: warning: 'blake2b_update' macro redefined
      [-Wmacro-redefined]
#define blake2b_update BLAKE2_IMPL_NAME(blake2b_update)
        ^
/Users/remi/src/cpython/Modules/_blake2/blake2ns.h:13:9: note: previous definition is here
#define blake2b_update     PyBlake2_blake2b_update
        ^
In file included from /Users/remi/src/cpython/Modules/_blake2/blake2b_impl.c:32:
/Users/remi/src/cpython/Modules/_blake2/impl/blake2b.c:196:9: warning: 'blake2b_final' macro redefined
      [-Wmacro-redefined]
#define blake2b_final BLAKE2_IMPL_NAME(blake2b_final)
        ^
/Users/remi/src/cpython/Modules/_blake2/blake2ns.h:9:9: note: previous definition is here
#define blake2b_final      PyBlake2_blake2b_final
        ^
In file included from /Users/remi/src/cpython/Modules/_blake2/blake2b_impl.c:32:
/Users/remi/src/cpython/Modules/_blake2/impl/blake2b.c:197:9: warning: 'blake2b' macro redefined [-Wmacro-redefined]
#define blake2b BLAKE2_IMPL_NAME(blake2b)
        ^
/Users/remi/src/cpython/Modules/_blake2/blake2ns.h:7:9: note: previous definition is here
#define blake2b            PyBlake2_blake2b


I'm not sure what should be the public API exactly and where to fix that.
msg343559 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-05-26 16:32
The file blake2ns.h renames some of the exported constants to prefix them with PyBlake2_foo. The file needs to be updated every time the sources are updated.

I'll look into the issue.
msg350293 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2019-08-23 14:09
This is marked as a release blocker. The last beta is scheduled for Monday. Please decide how to proceed ASAP.
msg350299 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-08-23 14:33
Related to this, the blake2 function (declared as static inline) is not used, which makes the Solaris and compilers unhappy. Patch for reference:

--- a/Modules/_blake2/impl/blake2.h
+++ b/Modules/_blake2/impl/blake2.h
@@ -169,11 +169,6 @@
   BLAKE2_API int blake2sp( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
   BLAKE2_API int blake2bp( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );

-  static inline int blake2( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
-  {
-    return blake2b( out, in, key, outlen, inlen, keylen );
-  }
-
 #if defined(__cplusplus)
 }
 #endif
msg350551 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-08-26 17:32
META: Do we still have platforms we support that we do not also require a modern enough OpenSSL version in order for CPython to build that'd provide blake2 for us?

I'd love to ditch maintenance of our own copies of the various secure hash function implementations.
msg350553 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-08-26 17:50
Although OpenSSL comes with blake2, it does not support any of the advanced features like keying, personalization, or tree hashing. See https://github.com/openssl/openssl/issues/980
msg350554 - (view) Author: miss-islington (miss-islington) Date: 2019-08-26 17:52
New changeset b27cbec801e17a13d7fef49116a8fc279930d2b1 by Miss Islington (bot) (Inada Naoki) in branch 'master':
bpo-37055: fix warnings in _blake2 module (GH-14646)
https://github.com/python/cpython/commit/b27cbec801e17a13d7fef49116a8fc279930d2b1
msg350555 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-08-26 17:53
oh well, no pony for us this decade. :)
msg350557 - (view) Author: miss-islington (miss-islington) Date: 2019-08-26 18:23
New changeset 2bb4fc379b14377e1cdcefad8d5f2fbbb1172524 by Miss Islington (bot) in branch '3.8':
bpo-37055: fix warnings in _blake2 module (GH-14646)
https://github.com/python/cpython/commit/2bb4fc379b14377e1cdcefad8d5f2fbbb1172524
msg350563 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-08-26 19:54
I hope that I'll be able to drop our sha3 copy soonish. OpenSSL 1.0.2 reaches EOL by the end of the year. In theory I could require >= 1.1.1 in 3.9...
msg350566 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-08-26 20:15
Can we close this issue or remove the release blocker?
History
Date User Action Args
2019-09-11 09:09:56benjamin.petersonlinkissue29171 superseder
2019-08-26 20:43:53christian.heimessetstatus: open -> closed
type: compile error
resolution: fixed
stage: patch review -> resolved
2019-08-26 20:15:50pablogsalsetmessages: + msg350566
2019-08-26 19:54:53christian.heimessetmessages: + msg350563
2019-08-26 18:23:58miss-islingtonsetmessages: + msg350557
2019-08-26 17:53:04gregory.p.smithsetmessages: + msg350555
2019-08-26 17:52:50miss-islingtonsetpull_requests: + pull_request15207
2019-08-26 17:52:39miss-islingtonsetnosy: + miss-islington
messages: + msg350554
2019-08-26 17:50:51christian.heimessetmessages: + msg350553
2019-08-26 17:32:10gregory.p.smithsetnosy: + gregory.p.smith
messages: + msg350551
2019-08-23 14:33:38pablogsalsetnosy: + pablogsal
messages: + msg350299
2019-08-23 14:09:52lukasz.langasetpriority: deferred blocker -> release blocker
nosy: + lukasz.langa
messages: + msg350293

2019-07-08 12:02:05inada.naokisetkeywords: + patch
stage: patch review
pull_requests: + pull_request14457
2019-05-26 16:32:14christian.heimessetpriority: normal -> deferred blocker
versions: + Python 3.8, Python 3.9
nosy: + christian.heimes, inada.naoki

messages: + msg343559
2019-05-26 16:08:52remi.lapeyrecreate