Refactored random byte generation functions.

This commit is contained in:
Jakob Friedl
2025-08-25 20:08:23 +02:00
parent 84f889451c
commit dd7433588f
11 changed files with 18 additions and 26 deletions

View File

@@ -12,7 +12,7 @@ proc createHeartbeat*(ctx: AgentCtx): Heartbeat =
size: 0'u32,
agentId: string.toUuid(ctx.agentId),
seqNr: 0'u32,
iv: generateIV(),
iv: generateBytes(Iv),
gmac: default(AuthenticationTag)
),
listenerId: string.toUuid(ctx.listenerId),

View File

@@ -203,7 +203,7 @@ proc collectAgentMetadata*(ctx: AgentCtx): AgentRegistrationData =
size: 0'u32,
agentId: string.toUuid(ctx.agentId),
seqNr: nextSequence(string.toUuid(ctx.agentId)),
iv: generateIV(),
iv: generateBytes(Iv),
gmac: default(AuthenticationTag)
),
agentPublicKey: ctx.agentPublicKey,

View File

@@ -11,7 +11,7 @@ proc createTaskResult*(task: Task, status: StatusType, resultType: ResultType, r
size: 0'u32,
agentId: task.header.agentId,
seqNr: nextSequence(task.header.agentId),
iv: generateIV(),
iv: generateBytes(Iv),
gmac: default(array[16, byte])
),
taskId: task.taskId,