diff --git a/test/tls-provider.c b/test/tls-provider.c index e5737dc5df..53e1d53ffa 100644 --- a/test/tls-provider.c +++ b/test/tls-provider.c @@ -385,6 +385,8 @@ static int tls_prov_get_capabilities(void *provctx, const char *capability, if (strcmp(capability, "TLS-GROUP") == 0) { /* Register our 2 groups */ + OPENSSL_assert(xor_group.group_id >= 65024 + && xor_group.group_id < 65279 - NUM_DUMMY_GROUPS); ret = cb(xor_group_params, arg); ret &= cb(xor_kemgroup_params, arg); @@ -396,6 +398,7 @@ static int tls_prov_get_capabilities(void *provctx, const char *capability, for (i = 0; i < NUM_DUMMY_GROUPS; i++) { OSSL_PARAM dummygroup[OSSL_NELEM(xor_group_params)]; + unsigned int dummygroup_id; memcpy(dummygroup, xor_group_params, sizeof(xor_group_params)); @@ -411,7 +414,8 @@ static int tls_prov_get_capabilities(void *provctx, const char *capability, dummygroup[0].data = dummy_group_names[i]; dummygroup[0].data_size = strlen(dummy_group_names[i]) + 1; /* assign unique group IDs also to dummy groups for registration */ - *((int *)(dummygroup[3].data)) = 65279 - NUM_DUMMY_GROUPS + i; + dummygroup_id = 65279 - NUM_DUMMY_GROUPS + i; + dummygroup[3].data = (unsigned char*)&dummygroup_id; ret &= cb(dummygroup, arg); } }