openssl / openssl/openssl

Bug in "crypto/cversion.c"?

Open
#28,330 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triaged: bug
Dominant language
C
Stars
30.8k
Forks
11.5k
Avg merge
10m
Merged PRs (30d)
1

Description

Hi,

I think there is a bug in the definition of "OSSL_WINCTX_STRING", isn't?

OpenSSL Version: 3.5.2
File: crypto/cversion.c
Line: 74, 75:

""

define TOSTR(x) #x

define OSSL_WINCTX_STRING "OSSL_WINCTX: "" TOSTR(OSSL_WINCTX) """

""

In my opinion, the problem is that OSSL_WINCTX_STRING is being assigned with "OSSL_WINCTX" and not with ""

In consequence

""
openssl version -w
""

reports

"OSSL_WINCTX: OSSL_WINCTX"

and not

"OSSL_WINCTX: ".

Due to the test "test/recipes/02-test_windows_registry.t" uses "openssl version -w" this test doesn't work, does it?

I think, in file "crypto/defaults.c" it is correct ( using "MAKESTR(OSSL_WINCTX)" ):

""

define TOSTR(x) #x

define MAKESTR(x) TOSTR(x)

...

if defined(OSSL_WINCTX)

define REGISTRY_KEY "SOFTWARE\WOW6432Node\OpenSSL" "-" MAKESTR(OPENSSL_VERSION_MAJOR) "." MAKESTR(OPENSSL_VERSION_MINOR) "-" MAKESTR(OSSL_WINCTX)

""

Regards
Jan

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crypto/cversion.c around OSSL_WINCTX_STRING and compare its preprocessing behavior with the MAKESTR usage in crypto/defaults.c. Run openssl version -w and test/recipes/02-test_windows_registry.t to confirm the reported output. Done means the intended OSSL_WINCTX value is reported and the Windows registry test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.