1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

5 Commits

Author SHA1 Message Date
72982d1589 build: sync up picky warnings with curl, fix fallouts
- cmake: sync `-ftree-vrp` behavior with autotools.
- build: enable `-Wjump-misses-init` for GCC 4.5+.
  Credits-to: Marcel Raad
- packet: fix `-Wjump-misses-init` warnings.
  ```
  src/packet.c: In function ‘_libssh2_packet_add’:
  src/packet.c:671:9: error: jump skips variable initialization [-Werror=jump-misses-init]
  src/packet.c:920:31: note: ‘want_reply’ declared here
  src/packet.c:671:9: error: jump skips variable initialization [-Werror=jump-misses-init]
  src/packet.c:919:26: note: ‘len’ declared here
  src/packet.c:669:9: error: jump skips variable initialization [-Werror=jump-misses-init]
  src/packet.c:1121:31: note: ‘want_reply’ declared here
  src/packet.c:669:9: error: jump skips variable initialization [-Werror=jump-misses-init]
  src/packet.c:1120:26: note: ‘len’ declared here
  src/packet.c:669:9: error: jump skips variable initialization [-Werror=jump-misses-init]
  src/packet.c:1119:26: note: ‘channel’ declared here
  ```
- build: enable gcc-12/13+, clang-10+ picky warnings
- acinclude.m4: sync formatting/comments with curl.
- autotools: fix `-Wtrampolines` picky warning for gcc 4.x versions.
  Follow-up to 854cfa8292 #1524
- cmake: enable `-Wall` for MSVC when `PICKY_COMPILER=ON`.
- MSVC: fix `-Wall` warnings.
  Seen on VS2015. Not seen on VS2022. Unknown for other versions.
  ```
  tests\test_simple.c(60): warning C4777: 'fprintf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'std::size_t'
  tests\test_simple.c(60): warning C4777: 'fprintf' : format string '%.*s' requires an argument of type 'int', but variadic argument 2 has type 'std::size_t'
  ```
- mbedtls: stop silencing warnings in 3rd-party header.
  Follow-up to a3aa6b4ca8 #1525
- cmake: stop deleting `-W<n>` from `CMAKE_C_FLAGS` (MSVC)
  1. `CMAKE_C_FLAGS` may apply to other projects, and deleting/altering it
     may be unexpected.
  2. We pass `-W4`/`-Wall` internally now, which do override custom
     `-W<n>` options as tested with VS2008 and newer VS generators.

Closes #1588
2025-05-07 23:24:41 +02:00
f6aa31f48f provide SPDX identifiers
- All files have prominent copyright and SPDX identifier
- If not embedded in the file, in the .reuse/dep5 file
- All used licenses are in LICENSES/ (not shipped in tarballs)
- A new REUSE CI job verify that all files are OK

Assisted-by: Viktor Szakats

Closes #1084
2023-06-07 08:18:55 +02:00
187d89bb07 copyright: remove years from copyright headers
Also:
- uppercase `(C)`.
- add missing 'All rights reserved.' lines.
- drop duplicate 'Author' lines.
- add copyright headers where missing.
- enable copyright header check in checksrc.

Reasons for deleting years (copied as-is from curl):
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

Closes #1082
2023-06-04 19:19:16 +00:00
739e41bf40 switch to internal base64 decode that uses size_t
Make the public `libssh2_base64_decode()` a wrapper for that.
Bump up length sizes in callers.

Also fix output size calculation to first divide then multiply.

Closes #978
2023-04-17 14:30:51 +00:00
9ecb22daab tests: build improvements and more
- rename tests to have more succint names and a more useful natural
  order.

- rename `simple` and `ssh2` in tests to have the `test_` prefix.

  This avoids a name collisions with `ssh2` in examples.

- cmake: drop the `example-` prefix for generated examples.

  Bringing their names in sync with other build tools, like autotools.

- move common auth test code into the fixture and simplify tests by
  using that.

- move feature guards from CMake to preprocessor for auth tests.

  Now it works with all build tools and it's easier to keep it in sync
  with the lib itself.

  For this we need to include `libssh2_priv.h` in tests, which in turn
  needs tweaking on the trick we use to suppress extra MSVS warnings
  when building tests and examples.

- move mbedTLS blocklist for crypto tests from CMake to the test
  fixture.

- add ed25519 hostkey tests to `test_hostkey` and `test_hostkey_hash`.

- add shell script to regenerate all test keys used for our tests.

- alpha-sort tests.

- rename `signed_*` keys to begin with `key` like the rest of the keys
  do.

- whitespace fixes.

Closes #969
2023-04-16 22:50:01 +00:00