Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashlib: build fails when blake2 is disabled in OpenSSL #82865

Closed
commodo mannequin opened this issue Nov 4, 2019 · 4 comments
Closed

hashlib: build fails when blake2 is disabled in OpenSSL #82865

commodo mannequin opened this issue Nov 4, 2019 · 4 comments
Assignees
Labels
3.8 only security fixes build The build process and cross-build topic-SSL

Comments

@commodo
Copy link
Mannequin

commodo mannequin commented Nov 4, 2019

BPO 38684
Nosy @tiran, @commodo, @miss-islington
PRs
  • bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL #17043
  • [3.8] bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (GH-17043) #17044
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tiran'
    closed_at = <Date 2019-11-06.06:14:43.831>
    created_at = <Date 2019-11-04.12:24:10.859>
    labels = ['expert-SSL', 'build', '3.8']
    title = 'hashlib: build fails when blake2 is disabled in OpenSSL'
    updated_at = <Date 2019-11-06.06:14:43.830>
    user = 'https://github.com/commodo'

    bugs.python.org fields:

    activity = <Date 2019-11-06.06:14:43.830>
    actor = 'christian.heimes'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2019-11-06.06:14:43.831>
    closer = 'christian.heimes'
    components = ['Build', 'SSL']
    creation = <Date 2019-11-04.12:24:10.859>
    creator = 'Alexandru Ardelean'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38684
    keywords = ['patch']
    message_count = 4.0
    messages = ['355940', '355946', '356099', '356100']
    nosy_count = 3.0
    nosy_names = ['christian.heimes', 'Alexandru Ardelean', 'miss-islington']
    pr_nums = ['17043', '17044']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue38684'
    versions = ['Python 3.8']

    @commodo
    Copy link
    Mannequin Author

    commodo mannequin commented Nov 4, 2019

    This was caught via OpenWrt's build, when upgrading to 3.8.
    By default, Blake2 is not enabled in OpenWrt's OpenSSL.
    Not sure if this is an issue in OpenSSL or Python or both.

    After digging through the _hashopenssl.c, it seems that the check for Blake2 being enabled/present in OpenSSL is not consistent with how OpenSSL does it.

    The build error is:

    86_64-openwrt-linux-musl-gcc -shared -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -znow -zrelro -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -znow -zrelro -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -znow -zrelro -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0=Python-3.8.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DNDEBUG -fno-inline -I/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include -I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/include -I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/include/fortify -I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/include build/temp.linux2-3.8/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_curses_panel.o -L. -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/x86_64-openwrt-linux-musl/lib -lpanelw -lncursesw -o build/lib.linux2-3.8/_curses_panel.cpython-38.so
    /home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c: In function 'py_digest_by_name':
    /home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:220:22: error: implicit declaration of function 'EVP_blake2s256'; did you mean 'SN_blake2s256'? [-Werror=implicit-function-declaration]
    digest = EVP_blake2s256();
    ^~~~~~~~~~~~~~
    SN_blake2s256
    /home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:220:20: warning: assignment to 'const EVP_MD *' {aka 'const struct evp_md_st *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
    digest = EVP_blake2s256();
    ^
    /home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:223:22: error: implicit declaration of function 'EVP_blake2b512'; did you mean 'LN_blake2b512'? [-Werror=implicit-function-declaration]
    digest = EVP_blake2b512();
    ^~~~~~~~~~~~~~
    LN_blake2b512
    /home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:223:20: warning: assignment to 'const EVP_MD *' {aka 'const struct evp_md_st *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
    digest = EVP_blake2b512();
    ^

    @commodo commodo mannequin added the 3.8 only security fixes label Nov 4, 2019
    @commodo commodo mannequin assigned tiran Nov 4, 2019
    @commodo commodo mannequin added build The build process and cross-build topic-SSL labels Nov 4, 2019
    @tiran
    Copy link
    Member

    tiran commented Nov 4, 2019

    New changeset 6552563 by Christian Heimes (Alexandru Ardelean) in branch 'master':
    bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (bpo-17043)
    6552563

    @miss-islington
    Copy link
    Contributor

    New changeset 7c20888 by Miss Islington (bot) in branch '3.8':
    bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (GH-17043)
    7c20888

    @tiran
    Copy link
    Member

    tiran commented Nov 6, 2019

    Thanks!

    @tiran tiran closed this as completed Nov 6, 2019
    @tiran tiran added the build The build process and cross-build label Nov 6, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes build The build process and cross-build topic-SSL
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants