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

build: streamline non-UWP wincrypt detections #11657

Closed
wants to merge 5 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Aug 11, 2023

  • with CMake, use the variable WINDOWS_STORE to detect an UWP build
    and disable our non-UWP-compatible use the Windows crypto API. This
    allows to drop two dynamic feature checks.

    WINDOWS_STORE is true when invoking CMake with
    CMAKE_SYSTEM_NAME == WindowsStore. Introduced in CMake v3.1.

    Ref: https://cmake.org/cmake/help/latest/variable/WINDOWS_STORE.html

  • with autotools, drop the separate feature check for wincrypt.h. On
    one hand this header has been present for long (even Borland C 5.5 had
    it from year 2000), on the other we used the check result solely to
    enable another check for certain crypto functions. This fails anyway
    with the header not present. We save one dynamic feature check at the
    configure stage.

Closes #11657

@vszakats vszakats added build Windows Windows-specific labels Aug 11, 2023
@github-actions github-actions bot added the CI Continuous Integration label Aug 11, 2023
It was used only as a prerequisite for checking for
`CryptAcquireContext()` in wincrypt lib. The latter check fails anyway
if the header is missing.
It was a requirement for wincrypt.h. After deleting that check,
we need to move this requirement to the crypto API check directly.
Found the problem: it's MSYS2 env-related. Interestingly the win32
crypto check passes on MSYS2, even though it #includes windows.h.
While the pure windows.h check fails. Had to restore the windows.h
prereq for the crypto check to fix this.
@vszakats vszakats closed this in c90c783 Aug 13, 2023
@vszakats vszakats deleted the wincrypt-detect branch August 13, 2023 13:52
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
- with CMake, use the variable `WINDOWS_STORE` to detect an UWP build
  and disable our non-UWP-compatible use the Windows crypto API. This
  allows to drop two dynamic feature checks.

  `WINDOWS_STORE` is true when invoking CMake with
  `CMAKE_SYSTEM_NAME` == `WindowsStore`. Introduced in CMake v3.1.

  Ref: https://cmake.org/cmake/help/latest/variable/WINDOWS_STORE.html

- with autotools, drop the separate feature check for `wincrypt.h`. On
  one hand this header has been present for long (even Borland C 5.5 had
  it from year 2000), on the other we used the check result solely to
  enable another check for certain crypto functions. This fails anyway
  with the header not present. We save one dynamic feature check at the
  configure stage.

Reviewed-by: Marcel Raad
Closes curl#11657
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build CI Continuous Integration Windows Windows-specific
Development

Successfully merging this pull request may close these issues.

None yet

2 participants