Skip to content

Change: only compile credential store code when needed#2802

Merged
greenbonebot merged 4 commits intomainfrom
stray-fns-cs
Mar 2, 2026
Merged

Change: only compile credential store code when needed#2802
greenbonebot merged 4 commits intomainfrom
stray-fns-cs

Conversation

@mattmundell
Copy link
Contributor

What

These commits reduce the amount of credential store code that is compiled when ENABLE_CREDENTIAL_STORES is true.

See commit logs for rationales.

Why

This prevents many unused functions when ENABLE_CREDENTIAL_STORES is 0.

References

Follows /pull/2789.

Testing

  • edited the credential store in gsa
  • ran GMP CREATE_CREDENTIAL and MODIFY_CREDENTIAL with type cs_up, both with credential stores compiled in and compiled out

@mattmundell mattmundell requested review from a team as code owners February 28, 2026 12:35
@greenbonebot greenbonebot enabled auto-merge (rebase) February 28, 2026 12:35
This file is already behind an ENABLE_CREDENTIAL_STORES check in cmake, so
these #ifs are redundant, they're always true.
These variables (credential_store_id etc) are only set in gmp.c when
ENABLE_CREDENTIAL_STORES is true.
4 means that the feature is not enabled, which is always the case when credential
stores are not compiled in.

Also wrap the whole "cs_" type handling in a check, because that block is only
used when the feature is enabled.

I'm doing this to prevent the regular code from calling credential store
functions when credential stores are not compiled in.
@greenbonebot greenbonebot merged commit 869cc28 into main Mar 2, 2026
31 of 32 checks passed
@greenbonebot greenbonebot deleted the stray-fns-cs branch March 2, 2026 07:56
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