The AWS-LC API 30-34 curve fetch declares the group variable after
statements, which fails builds using -Werror=declaration-after-statement.
Move the declaration to the beginning of smp_fetch_ssl_fc_ec() and keep
the assignment in the AWS-LC branch. Mark the variable __maybe_unused
for builds using other SSL libraries.
This fix must be backported wherever commit
e671cb696d ("MINOR: ssl:
support curve fetches with AWS-LC API 30") was backported.
struct connection *conn;
SSL *ssl;
int __maybe_unused nid;
+ uint16_t __maybe_unused group;
char *curve_name;
if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
curve_name[i] = toupper((unsigned char)curve_name[i]);
}
# elif defined(OPENSSL_IS_AWSLC) && AWSLC_API_VERSION < 35
- uint16_t group = SSL_get_group_id(ssl);
+ group = SSL_get_group_id(ssl);
/* Match the NIST curve short names returned by the NID-based API in
* newer AWS-LC versions. Other groups, including PQ/hybrid groups,