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

[libssh] Update libssh to version 0.9.3 #4983

Merged
merged 3 commits into from
Feb 6, 2020

Conversation

cryptomilk
Copy link
Contributor

This updates libssh to the lastest release. libssh 0.7.x is in security bugfix only mode.

@msftclas
Copy link

msftclas commented Dec 16, 2018

CLA assistant check
All CLA requirements met.

@cryptomilk cryptomilk force-pushed the master-libssh branch 3 times, most recently from f5a024d to f5d1815 Compare December 16, 2018 12:11
@cryptomilk cryptomilk changed the title Update libssh to version 0.8.5 [WIP] Update libssh to version 0.8.5 Dec 16, 2018
@ras0219-msft ras0219-msft self-assigned this Dec 19, 2018
@Codiferous
Copy link
Contributor

@cryptomilk Sorry for the delay in processing this PR.

We're seeing regressions on x64-linux and x64-osx. The failures look like this:

# x64-linux
/usr/bin/cc -DLIBSSH_EXPORTS -Isrc -I/s/buildtrees/libssh/src/0.8.5-531fc45269/src -I/s/buildtrees/libssh/src/0.8.5-531fc45269/include -I. -I/s/installed/x64-linux/include -fPIC -g -fPIC   -fvisibility=hidden -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Wimplicit-fallthrough -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wformat -Wformat-security -Werror=format-security -Wno-gnu-zero-variadic-macro-arguments -fno-common -fstack-protector-strong -MD -MT src/CMakeFiles/ssh_shared.dir/libcrypto.c.o -MF src/CMakeFiles/ssh_shared.dir/libcrypto.c.o.d -o src/CMakeFiles/ssh_shared.dir/libcrypto.c.o   -c /s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c: In function ‘evp_cipher_init’:
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:501:26: error: implicit declaration of function ‘EVP_bf_cbc’; did you mean ‘EVP_rc2_cbc’? [-Werror=implicit-function-declaration]
         cipher->cipher = EVP_bf_cbc();
                          ^~~~~~~~~~
                          EVP_rc2_cbc
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:501:24: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
         cipher->cipher = EVP_bf_cbc();
                        ^
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c: In function ‘aes_ctr_encrypt’:
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:635:3: error: implicit declaration of function ‘CRYPTO_ctr128_encrypt’; did you mean ‘AES_ctr128_encrypt’? [-Werror=implicit-function-declaration]
   CRYPTO_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num, (block128_f)AES_encrypt);
   ^~~~~~~~~~~~~~~~~~~~~
   AES_ctr128_encrypt
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:635:102: error: ‘block128_f’ undeclared (first use in this function); did you mean ‘lockf’?
   CRYPTO_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num, (block128_f)AES_encrypt);
                                                                                                      ^~~~~~~~~~
                                                                                                      lockf
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:635:102: note: each undeclared identifier is reported only once for each function it appears in
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:635:113: error: expected ‘)’ before ‘AES_encrypt’
   CRYPTO_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num, (block128_f)AES_encrypt);
                                                                                                                 ^~~~~~~~~~~

# x64-osx
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc  -Isrc -I/s/buildtrees/libssh/src/0.8.5-531fc45269/src -I/s/buildtrees/libssh/src/0.8.5-531fc45269/include -I. -I/s/installed/x64-osx/include -fPIC -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fPIC   -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Wimplicit-fallthrough -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wformat -Wformat-security -Werror=format-security -Wno-gnu-zero-variadic-macro-arguments -fno-common -fstack-protector-strong -Wno-deprecated-declarations -MD -MT src/CMakeFiles/ssh_static.dir/libcrypto.c.o -MF src/CMakeFiles/ssh_static.dir/libcrypto.c.o.d -o src/CMakeFiles/ssh_static.dir/libcrypto.c.o   -c /s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:501:26: error: implicit declaration of function 'EVP_bf_cbc' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        cipher->cipher = EVP_bf_cbc();
                         ^
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:501:26: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/s/buildtrees/libssh/src/0.8.5-531fc45269/src/libcrypto.c:501:24: warning: incompatible integer to pointer conversion assigning to 'const EVP_CIPHER *' (aka 'const struct evp_cipher_st *') from 'int' [-Wint-conversion]
        cipher->cipher = EVP_bf_cbc();

I believe all of the errors are related to types and functions defined in OpenSSL. Does OpenSSL need to be updated to coincide with this PR?

@fcharlie
Copy link
Contributor

fcharlie commented Feb 16, 2019

@cryptomilk @ras0219-msft @Codiferous
I think vcpkg should upgrade openssl to 1.1.1a first, or switch Libssh to depend with mbedTLS.

@Codiferous Codiferous removed their assignment Feb 25, 2019
@Rastaban
Copy link
Contributor

Rastaban commented May 2, 2019

Resolved merge conflict. The latest master introduced a new patch that may not be applicable after this PR but I did the safe thing and kept it until it is tested.

@Rastaban
Copy link
Contributor

Rastaban commented May 6, 2019

Also the patch did not apply cleanly so it will need to be cleaned up. OpenSSL has not been updated yet so those failues are also still there.

@grdowns
Copy link
Contributor

grdowns commented Jul 1, 2019

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@cryptomilk cryptomilk changed the title [WIP] Update libssh to version 0.8.5 [WIP] Update libssh to version 0.9.0 Jul 3, 2019
@cryptomilk
Copy link
Contributor Author

I'm not sure what is the error on Linux. However I found an issue in libssh we should fix first. Will update the PR to libssh 0.9.1 once I've fixed it and did a release.

@cryptomilk cryptomilk force-pushed the master-libssh branch 6 times, most recently from 4009441 to decd7b9 Compare July 4, 2019 15:20
@cryptomilk cryptomilk changed the title [WIP] Update libssh to version 0.9.0 Update libssh to version 0.9.0 Jul 4, 2019
@cryptomilk
Copy link
Contributor Author

As OpenSSL is only in version 1.0.x available I've moved it to mbedtls for now.

@NancyLi1013
Copy link
Contributor

Hi @cryptomilk
Could you please solve the conflicts about this PR?

@NancyLi1013
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@fcharlie
Copy link
Contributor

@NancyLi1013 You can push my modifications to this PR: https://github.com/fcharlie/vcpkg/tree/update_libssh

@cryptomilk
Copy link
Contributor Author

Why does someone else gets updates to libssh and this still PR still bit rots?

@cryptomilk
Copy link
Contributor Author

Ping!

@NancyLi1013
Copy link
Contributor

@vicroms
Could you help take a look if this PR can be merged now?
Thanks.

@illera88
Copy link
Contributor

Hi @cryptomilk. Can you please add x86-windows-static. There are a lot of projects that use libssh statically

@cryptomilk
Copy link
Contributor Author

@illera88 Please be more precise of your problem. libssh respects BUILD_SHARED_LIBS, see https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#choose-either-static-or-shared-binaries

If you have a real problem, please describe it. I don't see an issue.

@illera88
Copy link
Contributor

I thought I was being very clear with my comment.

It seems that static versions can not be built with the current port. ie x86-windows-static x64-windows-static can not be built.

Or did I miss something?


vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DWITH_STATIC_LIB=${WITH_STATIC_LIB}
${FEATURE_OPTIONS}
-DWITH_EXAMPLES=OFF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to pass BUILD_STATIC_LIB=ON when building the static library. This helps reduce the number of post-install clean-up tasks.

set (LIBSSH_BUILD_STATIC OFF)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
    set(LIBSSH_BUILD_STATIC ON)
endif()

vcpkg_configure_cmake(
   ...
    -DBUILD_STATIC_LIB=${LIBSSH_BUILD_STATIC}
)

After that you can remove these lines:

    file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)

and

if(VCPKG_TARGET_IS_WINDOWS)
    file(READ ${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake _contents)
    string(REPLACE ".dll" ".lib" _contents "${_contents}")
    file(WRITE ${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake "${_contents}")
endif()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, but BUILD_STATIC_LIB builds an internal static library which is only used for linking unit tests!

If you want to build a static library, you should use: -DBUILD_SHARED_LIBS=OFF. This is how it is supposed to work. See https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html

If you look at:

https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#choose-either-static-or-shared-binaries

It states:

By default, vcpkg_configure_cmake() will pass in the appropriate setting for BUILD_SHARED_LIBS

So vcpkg_configure_cmake() should do the right thing. If not it might have a bug ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vicroms So either your documentation is wrong or you have a bug in vcpkg_configure_cmake().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@ras0219-msft
Copy link
Contributor

This LGTM once the CI build passes 👍

@ras0219-msft
Copy link
Contributor

/azp run

@ras0219-msft ras0219-msft merged commit 53b4fba into microsoft:master Feb 6, 2020
@ras0219-msft
Copy link
Contributor

Thanks for the PR!

azure-sdk added a commit to azure-sdk/vcpkg that referenced this pull request Jan 11, 2024
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[microsoft#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[microsoft#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[microsoft#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[microsoft#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[microsoft#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
JavierMatosD pushed a commit that referenced this pull request Jan 12, 2024
* [azure-messaging-eventhubs-cpp] Update to 1.0.0-beta.5
## 1.0.0-beta.5 (2024-01-11)

### Breaking Changes

- EventHub `ConsumerClient` and `ProcessorClient` objects now return pointers to `EventData` objects instead of `EventData` objects by value.

* [azure-core-amqp-cpp] Update to 1.0.0-beta.6
## 1.0.0-beta.6 (2024-01-11)

### Features Added

- AMQP Value reference counts are now atomic, this fixes several AMQP related crashes.

### Breaking Changes

- `MessageReceiver` returns a pointer to the received message instead of a copy.

### Bugs Fixed

- Fixed several memory leaks.
- AMQP Link Credits now work as expected.
- Integrated the fix for NVD - CVE-2024-21646.

* [azure-core-cpp] Update to 1.11.0
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
Osyotr pushed a commit to Osyotr/vcpkg that referenced this pull request Jan 23, 2024
* [azure-messaging-eventhubs-cpp] Update to 1.0.0-beta.5
## 1.0.0-beta.5 (2024-01-11)

### Breaking Changes

- EventHub `ConsumerClient` and `ProcessorClient` objects now return pointers to `EventData` objects instead of `EventData` objects by value.

* [azure-core-amqp-cpp] Update to 1.0.0-beta.6
## 1.0.0-beta.6 (2024-01-11)

### Features Added

- AMQP Value reference counts are now atomic, this fixes several AMQP related crashes.

### Breaking Changes

- `MessageReceiver` returns a pointer to the received message instead of a copy.

### Bugs Fixed

- Fixed several memory leaks.
- AMQP Link Credits now work as expected.
- Integrated the fix for NVD - CVE-2024-21646.

* [azure-core-cpp] Update to 1.11.0
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[microsoft#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[microsoft#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[microsoft#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[microsoft#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[microsoft#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
TomKatom pushed a commit to TomKatom/vcpkg that referenced this pull request Feb 23, 2024
* [azure-messaging-eventhubs-cpp] Update to 1.0.0-beta.5
## 1.0.0-beta.5 (2024-01-11)

### Breaking Changes

- EventHub `ConsumerClient` and `ProcessorClient` objects now return pointers to `EventData` objects instead of `EventData` objects by value.

* [azure-core-amqp-cpp] Update to 1.0.0-beta.6
## 1.0.0-beta.6 (2024-01-11)

### Features Added

- AMQP Value reference counts are now atomic, this fixes several AMQP related crashes.

### Breaking Changes

- `MessageReceiver` returns a pointer to the received message instead of a copy.

### Bugs Fixed

- Fixed several memory leaks.
- AMQP Link Credits now work as expected.
- Integrated the fix for NVD - CVE-2024-21646.

* [azure-core-cpp] Update to 1.11.0
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[microsoft#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[microsoft#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[microsoft#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[microsoft#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[microsoft#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.