Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GREEN-66 Adding a timestamp to the message being signed by Crypto.sign() #17

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
}
const res = Crypto.sign({
success: true,
timestamp: Date.now(),
})
reply.send(res)
Collector.processGossipData(gossipPayload)
Expand Down Expand Up @@ -1098,6 +1099,7 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
addHashesGossip(gossipMessage.sender, gossipMessage.data)
const res = Crypto.sign({
success: true,
timestamp: Date.now(),
})
reply.send(res)
})
Expand Down
1 change: 1 addition & 0 deletions src/Data/Cycles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ export async function getNewestCycleFromArchivers(): Promise<P2PTypes.CycleCreat
const data = {
count: 1,
sender: config.ARCHIVER_PUBLIC_KEY,
timestamp: Date.now(),
}
Crypto.sign(data)

Expand Down
2 changes: 1 addition & 1 deletion src/GlobalAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const syncGlobalAccount = async (retry = 5): Promise<void> => {
const queryFn = async (node: Node): Promise<any> => {
return await postJson(
`http://${node.ip}:${node.port}/get_globalaccountreport_archiver`,
Crypto.sign({})
Crypto.sign({ timestamp: Date.now() })
)
}

Expand Down
Loading