mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:05:06 -05:00
nts: define type for credentials
Add a NKSN_Credentials type to avoid referring to it as void *.
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include "nts_ke.h"
|
||||
#include "siv.h"
|
||||
|
||||
typedef struct NKSN_Credentials_Record *NKSN_Credentials;
|
||||
|
||||
typedef struct NKSN_Instance_Record *NKSN_Instance;
|
||||
|
||||
/* Handler for received NTS-KE messages. A zero return code stops
|
||||
@@ -39,11 +41,11 @@ typedef int (*NKSN_MessageHandler)(void *arg);
|
||||
/* Get server or client credentials using a server certificate and key,
|
||||
or certificates of trusted CAs. The credentials may be shared between
|
||||
different clients or servers. */
|
||||
extern void *NKSN_CreateServerCertCredentials(const char *cert, const char *key);
|
||||
extern void *NKSN_CreateClientCertCredentials(const char *trusted_certs);
|
||||
extern NKSN_Credentials NKSN_CreateServerCertCredentials(const char *cert, const char *key);
|
||||
extern NKSN_Credentials NKSN_CreateClientCertCredentials(const char *trusted_certs);
|
||||
|
||||
/* Destroy the credentials */
|
||||
extern void NKSN_DestroyCertCredentials(void *credentials);
|
||||
extern void NKSN_DestroyCertCredentials(NKSN_Credentials credentials);
|
||||
|
||||
/* Create an instance */
|
||||
extern NKSN_Instance NKSN_CreateInstance(int server_mode, const char *server_name,
|
||||
@@ -54,7 +56,7 @@ extern void NKSN_DestroyInstance(NKSN_Instance inst);
|
||||
|
||||
/* Start a new NTS-KE session */
|
||||
extern int NKSN_StartSession(NKSN_Instance inst, int sock_fd, const char *label,
|
||||
void *credentials, double timeout);
|
||||
NKSN_Credentials credentials, double timeout);
|
||||
|
||||
/* Begin an NTS-KE message. A request should be made right after starting
|
||||
the session and response should be made in the message handler. */
|
||||
|
||||
Reference in New Issue
Block a user