Skip to content

Compilation of libssh2 v1.11.0 fails on 32-bit platforms #1053

Closed

Description

@giordano

Describe the bug

Compilation of libssh2 fails on 32-bit platforms with

[16:53:52] In file included from /workspace/srcdir/libssh2-1.11.0/src/crypto.h:46:0,
[16:53:52]                  from /workspace/srcdir/libssh2-1.11.0/src/libssh2_priv.h:149,
[16:53:52]                  from /workspace/srcdir/libssh2-1.11.0/src/crypt.c:39:
[16:53:52] /workspace/srcdir/libssh2-1.11.0/src/mbedtls.h:261:5: error: conflicting types for ‘_libssh2_mbedtls_rsa_sha1_verify’
[16:53:52]      _libssh2_mbedtls_rsa_sha1_verify(rsactx, sig, sig_len, m, m_len)
[16:53:52]      ^
[16:53:52] /workspace/srcdir/libssh2-1.11.0/src/crypto.h:146:5: note: in expansion of macro ‘_libssh2_rsa_sha1_verify’
[16:53:52]  int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx * rsa,
[16:53:52]      ^
[16:53:52] /workspace/srcdir/libssh2-1.11.0/src/mbedtls.h:527:1: note: previous declaration of ‘_libssh2_mbedtls_rsa_sha1_verify’ was here
[16:53:52]  _libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
[16:53:52]  ^
[16:53:52] /workspace/srcdir/libssh2-1.11.0/src/mbedtls.h:264:5: error: conflicting types for ‘_libssh2_mbedtls_rsa_sha2_verify’
[16:53:52]      _libssh2_mbedtls_rsa_sha2_verify(rsactx, hash_len, sig, sig_len, m, m_len)
[16:53:52]      ^
[16:53:52] /workspace/srcdir/libssh2-1.11.0/src/crypto.h:164:5: note: in expansion of macro ‘_libssh2_rsa_sha2_verify’
[16:53:52]  int _libssh2_rsa_sha2_verify(libssh2_rsa_ctx * rsa,
[16:53:52]      ^
[16:53:52] /workspace/srcdir/libssh2-1.11.0/src/mbedtls.h:540:1: note: previous declaration of ‘_libssh2_mbedtls_rsa_sha2_verify’ was here
[16:53:52]  _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
[16:53:52]  ^

For full build log see https://buildkite.com/julialang/yggdrasil/builds/3281#01886d93-971c-45a5-99f4-143310219ed3/652-1375

To Reproduce

Compile for a 32-bit platform. Full build script: https://github.com/giordano/Yggdrasil/blob/983d062f05278847e435476b7c0e66b76cde09bc/L/LibSSH2/build_tarballs.jl#L21-L36

Expected behavior

Compilation is successful.

Version (please complete the following information):

  • OS and version: linux on i686, armv6l, armv7l; also i686 and x86_64 mingw
  • libssh2 version: 1.11.0
  • crypto backend and version: mbedTLS 2.28.0

Additional context
Add any other context about the problem here.

Activity

  1. added a commit that references this issue on May 30, 2023
    6cad964
  2. willco007 commented on May 30, 2023

    @willco007
    Member

    Looks like _libssh2_mbedtls_rsa_sha1_verify() and _libssh2_mbedtls_rsa_sha2_verify() need to take size_t instead of unsigned long. Could you change those method sigs and see if that fixes the issue for you?

  3. willco007 commented on May 30, 2023

    @willco007
    Member

    Looks like @vszakats beat me to it! :)

  4. vszakats commented on May 30, 2023

    @vszakats
    Member

    Haven't had the time to test the patch, and our CI is blind to this (we do test x86_64/i686 mingw though), so build feedback is welcome!

    /sidenote It'd be worth bumping ecdsa_sign and dsa_sign to size_t, too.

  5. giordano commented on May 30, 2023

    @giordano
    Author

    I can confirm the patch in #1054 fixes this bug: https://buildkite.com/julialang/yggdrasil/builds/3285

    (we do test x86_64/i686 mingw though)

    But not with mbedtls:

    --with-crypto=openssl \
    ?

  6. vszakats commented on May 30, 2023

    @vszakats
    Member

    @giordano: True!

    I've added an i386 mbedTLS CI test, which now reproduces this.

  7. added a commit that references this issue on Mar 28, 2024
    1153ebd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions