Skip to content
Snippets Groups Projects
Commit 1ea556e8 authored by James Calfee's avatar James Calfee
Browse files

Add signing challenge prefix.

parent 1946ea33
No related branches found
No related tags found
No related merge requests found
......@@ -414,7 +414,9 @@ function* uploadImage({payload: {file, dataUrl, filename = 'image.txt', progress
data = new Buffer(dataBs64, 'base64')
}
const bufSha = hash.sha256(data)
// The challenge needs to be prefixed with a constant (both on the server and checked on the client) to make sure the server can't easily make the client sign a transaction doing something else.
const prefix = new Buffer('ImageSigningChallenge')
const bufSha = hash.sha256(Buffer.concat([prefix, data]))
const formData = new FormData()
if(file) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment