mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 15:25:06 -05:00
nts: refactor NTS context
Add a context structure for the algorithm and keys established by NTS-KE. Modify the client to save the context and reset the SIV key to the C2S/S2C key before each request/response instead of keeping two SIV instances. This will make it easier for the server to support different algorithms and allow the client to save the context with cookies to disk.
This commit is contained in:
@@ -33,10 +33,10 @@
|
||||
extern void NKS_Initialise(int scfilter_level);
|
||||
extern void NKS_Finalise(void);
|
||||
|
||||
/* Generate a new NTS cookie containing the C2S and S2C keys */
|
||||
extern int NKS_GenerateCookie(NKE_Key *c2s, NKE_Key *s2c, NKE_Cookie *cookie);
|
||||
/* Generate an NTS cookie with a given context */
|
||||
extern int NKS_GenerateCookie(NKE_Context *context, NKE_Cookie *cookie);
|
||||
|
||||
/* Validate a cookie and extract the C2S and S2C keys */
|
||||
extern int NKS_DecodeCookie(NKE_Cookie *cookie, NKE_Key *c2s, NKE_Key *s2c);
|
||||
/* Validate a cookie and decode the context */
|
||||
extern int NKS_DecodeCookie(NKE_Cookie *cookie, NKE_Context *context);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user