The previous code was obviously incorrect and caused strange side effects
depending on the compiler and its optimization flags (infinite looping seen
with GCC 4.8.4, segfault when destroying the private key in build() seen
with clang 4.0.0 on FreeBSD).
Fixes #2579.
signature_scheme_t schemes[] = {
SIGN_RSA_EMSA_PKCS1_SHA2_384,
SIGN_RSA_EMSA_PKCS1_SHA2_256,
- }, contained;
+ };
bool found;
int i, j;
found = FALSE;
for (j = 0; j < array_count(selected); j++)
{
- array_get(selected, j, &contained);
- if (scheme == contained)
+ array_get(selected, j, &config);
+ if (scheme == config->scheme)
{
found = TRUE;
break;