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

crypto: ensure crypto initialization works #10733

Closed
wants to merge 4 commits into from

Conversation

danielgustafsson
Copy link
Member

Make sure that context initialization during hash setup works to avoid going forward with the risk of a null pointer dereference.

Closes: xxxx
Reported-by: Philippe Antoine on HackerOne

Make sure that context initialization during hash setup works to avoid
going forward with the risk of a null pointer dereference.

Closes: xxxx
Reported-by: Philippe Antoine on HackerOne
@catenacyber
Copy link

(Found by nallocfuzz)

@bagder
Copy link
Member

bagder commented Mar 10, 2023

Windows related compiler warnings:

sha256.c: In function 'my_sha256_init':
sha256.c:231:25: error: passing argument 1 of 'CryptReleaseContext' makes integer from pointer without a cast [-Wint-conversion]
  231 |     CryptReleaseContext(&ctx->hCryptProv, 0);
      |                         ^~~~~~~~~~~~~~~~
      |                         |
      |                         HCRYPTPROV * {aka long unsigned int *}
In file included from sha256.c:82:
C:/msys64/mingw32/i686-w64-mingw32/include/wincrypt.h:783:58: note: expected 'HCRYPTPROV' {aka 'long unsigned int'} but argument is of type 'HCRYPTPROV *' {aka 'long unsigned int *'}
  783 |   WINIMPM WINBOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags);
      |                                               ~~~~~~~~~~~^~~~~

@bagder bagder added the TLS label Mar 10, 2023
@danielgustafsson
Copy link
Member Author

Windows related compiler warnings:

Ah yes, silly mistake, fixed.

There are still test failures in the NTLM code that I have to hunt down.

@catenacyber
Copy link

@danielgustafsson do you need some help on this ?

@bagder
Copy link
Member

bagder commented Aug 7, 2023

I squashed these and rebased on current master and made #11614 in an attempt to fix this.

@bagder bagder closed this Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants