mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-07 16:45:06 -05:00
nts: allow multiple server keys and certificates
Allow the ntsservercert and ntsserverkey directives to be specified multiple times to enable the NTS-KE server to operate under multiple names.
This commit is contained in:
@@ -163,19 +163,23 @@ void
|
||||
test_unit(void)
|
||||
{
|
||||
NKSN_Credentials client_cred, server_cred;
|
||||
const char *cert, *key;
|
||||
int sock_fds[2], i;
|
||||
|
||||
LCL_Initialise();
|
||||
TST_RegisterDummyDrivers();
|
||||
|
||||
cert = "nts_ke.crt";
|
||||
key = "nts_ke.key";
|
||||
|
||||
for (i = 0; i < 50; i++) {
|
||||
SCH_Initialise();
|
||||
|
||||
server = NKSN_CreateInstance(1, NULL, handle_request, NULL);
|
||||
client = NKSN_CreateInstance(0, "test", handle_response, NULL);
|
||||
|
||||
server_cred = NKSN_CreateServerCertCredentials("nts_ke.crt", "nts_ke.key");
|
||||
client_cred = NKSN_CreateClientCertCredentials("nts_ke.crt");
|
||||
server_cred = NKSN_CreateServerCertCredentials(&cert, &key, 1);
|
||||
client_cred = NKSN_CreateClientCertCredentials(cert);
|
||||
|
||||
TEST_CHECK(socketpair(AF_UNIX, SOCK_STREAM, 0, sock_fds) == 0);
|
||||
TEST_CHECK(fcntl(sock_fds[0], F_SETFL, O_NONBLOCK) == 0);
|
||||
|
||||
Reference in New Issue
Block a user