Commit af85dd69 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Fix ballot hashing issue

Following discussion on [1], use JSON stringification.

[1]: https://github.com/benadida/helios-server/pull/28
parent 618c1813
......@@ -475,7 +475,7 @@ HELIOS.EncryptedVote = Class.extend({
},
get_hash: function() {
return b64_sha256(this.toString());
return b64_sha256(JSON.stringify(this.toJSONObject()));
},
get_audit_trail: function() {
......
......@@ -416,7 +416,7 @@ BOOTH._after_ballot_encryption = function() {
BOOTH.encrypted_vote_json = BOOTH.encrypted_ballot_serialized || JSON.stringify(BOOTH.encrypted_ballot.toJSONObject());
var do_hash = function() {
BOOTH.encrypted_ballot_hash = BOOTH.encrypted_ballot.get_hash();
BOOTH.encrypted_ballot_hash = b64_sha256(BOOTH.encrypted_vote_json); // BOOTH.encrypted_ballot.get_hash();
window.setTimeout(show_cast, 0);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment