mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 20:45:07 -05:00
nts: allow missing SIV support
When compiled with NTS support, don't require a SIV cipher to be always supported (e.g. due to a different version of a library used for building). Handle this case with a fatal message instead of crash. Also, check the support early in the client unit test to prevent a hang.
This commit is contained in:
@@ -433,8 +433,11 @@ generate_key(int index)
|
||||
assert(0);
|
||||
|
||||
UTI_GetRandomBytesUrandom(server_keys[index].key, key_length);
|
||||
if (!SIV_SetKey(server_keys[index].siv, server_keys[index].key, key_length))
|
||||
assert(0);
|
||||
|
||||
if (!server_keys[index].siv ||
|
||||
!SIV_SetKey(server_keys[index].siv, server_keys[index].key, key_length)) {
|
||||
LOG_FATAL("Could not set SIV key");
|
||||
}
|
||||
|
||||
UTI_GetRandomBytes(&server_keys[index].id, sizeof (server_keys[index].id));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user