Compound literals go out of scope, too

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-03-23 08:13:51 +01:00 committed by eboasson
parent 0768ad59ed
commit cec8aea6c9

View file

@ -1536,12 +1536,13 @@ static DDS_Security_ValidationResult_t validate_handshake_token_impl (const DDS_
DDS_Security_BinaryProperty_t hash_c2_val = { DDS_Security_BinaryProperty_t hash_c2_val = {
.name = "hash_c2", .value = { ._length = sizeof (handshake->hash_c2), ._buffer = handshake->hash_c2 } .name = "hash_c2", .value = { ._length = sizeof (handshake->hash_c2), ._buffer = handshake->hash_c2 }
}; };
const DDS_Security_BinaryProperty_t **properties; DDS_Security_ValidationResult_t result;
if (token_type == HS_TOKEN_REPLY) if (token_type == HS_TOKEN_REPLY)
properties = (const DDS_Security_BinaryProperty_t *[]) { &hash_c2_val, challenge2, dh2, challenge1, dh1, &hash_c1_val }; result = validate_signature (public_key, (const DDS_Security_BinaryProperty_t *[]) {
&hash_c2_val, challenge2, dh2, challenge1, dh1, &hash_c1_val }, 6, signature->value._buffer, signature->value._length, ex);
else else
properties = (const DDS_Security_BinaryProperty_t *[]) { &hash_c1_val, challenge1, dh1, challenge2, dh2, &hash_c2_val }; result = validate_signature (public_key, (const DDS_Security_BinaryProperty_t *[]) {
const DDS_Security_ValidationResult_t result = validate_signature (public_key, properties, 6, signature->value._buffer, signature->value._length, ex); &hash_c1_val, challenge1, dh1, challenge2, dh2, &hash_c2_val }, 6, signature->value._buffer, signature->value._length, ex);
EVP_PKEY_free (public_key); EVP_PKEY_free (public_key);
if (result != DDS_SECURITY_VALIDATION_OK) if (result != DDS_SECURITY_VALIDATION_OK)
return result; return result;