Skip to content

EVP_Cipher: correct parameter checking - #7143

Merged
SparkiDev merged 3 commits into
wolfSSL:masterfrom
julek-wolfssl:zd/17303
Jan 22, 2024
Merged

SparkiDev merged 3 commits into
wolfSSL:masterfrom
julek-wolfssl:zd/17303

Conversation

@julek-wolfssl

Copy link
Copy Markdown
Member
  • EVP_Cipher(ctx, NULL, NULL, 0) is a valid call for all algorithms. For none-AEAD it results in a no-op.
  • Added libssh2 test

Fixes ZD17303

EVP_Cipher(ctx, NULL, NULL, 0) is a valid call for all algorithms. For none-AEAD it results in a no-op.
@julek-wolfssl julek-wolfssl self-assigned this Jan 19, 2024
@julek-wolfssl

Copy link
Copy Markdown
Member Author

Retest this please

Comment thread wolfcrypt/src/evp.c Resolved
Comment thread wolfcrypt/src/evp.c Resolved
@SparkiDev
SparkiDev merged commit b0de0a1 into wolfSSL:master Jan 22, 2024
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jun 21, 2024
wolfSSL 5.7.0 fixes this bug that affects libssh2#1020 and libssh2#1299:
wolfSSL/wolfssl#7143

`-DWOLFSSL_OPENSSLALL=ON` necessary for `wolfSSL_FIPS_mode()`

Closes #xxxx
vszakats added a commit to libssh2/libssh2 that referenced this pull request Jun 21, 2024
After this patch it's possible to run tests with wolfSSL 5.7.0.

wolfSSL 5.7.0 fixes this bug that affects open issues #1020 and #1299:
wolfSSL/wolfssl#7143

`-DWOLFSSL_OPENSSLALL=ON` is necessary for `wolfSSL_FIPS_mode()`

Closes #1408
vszakats added a commit to libssh2/libssh2 that referenced this pull request Jun 24, 2024
Add workaround for the wolfSSL `EVP_Cipher(*p, NULL, NULL, 0)` bug to
make libssh2 work with wolfSSL v5.6.0 and older.

wolfSSL fixed this issue in v5.7.0:
wolfSSL/wolfssl#7143
wolfSSL/wolfssl@b0de0a1

Without our local workaround:

- v5.3.0 and older fail most tests:
  Ref: https://github.com/libssh2/libssh2/actions/runs/9646827522/job/26604211476#step:17:1263

- v5.4.0, v5.5.x, v5.6.0 fail these:
  ```
  29 - test_read-aes128-cbc (Failed)
  30 - test_read-aes128-ctr (Failed)
  32 - test_read-aes192-cbc (Failed)
  33 - test_read-aes192-ctr (Failed)
  34 - test_read-aes256-cbc (Failed)
  35 - test_read-aes256-ctr (Failed)
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/9646827522/job/26604233819#step:17:978

Oddly enough the workaround breaks OpenSSL tests, so only enable it for
the affected wolfSSL versions.

Also add new build-from-source wolfSSL CI job to test the new codepath.

wolfSSL has a build bug where `wolfssl/options.h` and
`wolfssl/version.h` are not copied to the `install` destination with
autotools. With CMake it has a different bug where `wolfcrypt/sp_int.h`
is not copied (with v5.4.0). And another with CMake where `FIPS_mode()`
remains missing (with v5.6.0 and earlier.)

Therefore use CMake with v5.5.4 and a workaround for `FIPS_mode()`.
Another option is autotools with v5.4.0 and a workaround for `install`,
but CMake builds quicker.

Regression-from 3c953c0 #797
Fixes #1020
Fixes #1299
Assisted-by: Michael Buckley via #1394
Closes #1394 (another attempt to fix the mentioned wolfSSL bug)
Closes #1407
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
After this patch it's possible to run tests with wolfSSL 5.7.0.

wolfSSL 5.7.0 fixes this bug that affects open issues libssh2#1020 and libssh2#1299:
wolfSSL/wolfssl#7143

`-DWOLFSSL_OPENSSLALL=ON` is necessary for `wolfSSL_FIPS_mode()`

Closes libssh2#1408
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
Add workaround for the wolfSSL `EVP_Cipher(*p, NULL, NULL, 0)` bug to
make libssh2 work with wolfSSL v5.6.0 and older.

wolfSSL fixed this issue in v5.7.0:
wolfSSL/wolfssl#7143
wolfSSL/wolfssl@b0de0a1

Without our local workaround:

- v5.3.0 and older fail most tests:
  Ref: https://github.com/libssh2/libssh2/actions/runs/9646827522/job/26604211476#step:17:1263

- v5.4.0, v5.5.x, v5.6.0 fail these:
  ```
  29 - test_read-aes128-cbc (Failed)
  30 - test_read-aes128-ctr (Failed)
  32 - test_read-aes192-cbc (Failed)
  33 - test_read-aes192-ctr (Failed)
  34 - test_read-aes256-cbc (Failed)
  35 - test_read-aes256-ctr (Failed)
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/9646827522/job/26604233819#step:17:978

Oddly enough the workaround breaks OpenSSL tests, so only enable it for
the affected wolfSSL versions.

Also add new build-from-source wolfSSL CI job to test the new codepath.

wolfSSL has a build bug where `wolfssl/options.h` and
`wolfssl/version.h` are not copied to the `install` destination with
autotools. With CMake it has a different bug where `wolfcrypt/sp_int.h`
is not copied (with v5.4.0). And another with CMake where `FIPS_mode()`
remains missing (with v5.6.0 and earlier.)

Therefore use CMake with v5.5.4 and a workaround for `FIPS_mode()`.
Another option is autotools with v5.4.0 and a workaround for `install`,
but CMake builds quicker.

Regression-from 3c953c0 libssh2#797
Fixes libssh2#1020
Fixes libssh2#1299
Assisted-by: Michael Buckley via libssh2#1394
Closes libssh2#1394 (another attempt to fix the mentioned wolfSSL bug)
Closes libssh2#1407
@julek-wolfssl
julek-wolfssl deleted the zd/17303 branch May 12, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants