Skip to content
Snippets Groups Projects
Commit 9db13fa7 authored by matograine's avatar matograine Committed by Vincent Texier
Browse files

[fix] 143 : computed_inner_hash():

  * computed from raw (unsigned)
  * computes everything before InnerHash (previously included InnerHash line)
parent ceb52a2b
No related branches found
No related tags found
2 merge requests!128Release 0.62.0,!122#143 block inner hash and sign
...@@ -540,8 +540,8 @@ Nonce: {nonce} ...@@ -540,8 +540,8 @@ Nonce: {nonce}
return hashlib.sha256(doc_str.encode("ascii")).hexdigest().upper() return hashlib.sha256(doc_str.encode("ascii")).hexdigest().upper()
def computed_inner_hash(self) -> str: def computed_inner_hash(self) -> str:
doc = self.signed_raw() doc = self.raw()
inner_doc = "\n".join(doc.split("\n")[:-2]) + "\n" inner_doc = "\n".join(doc.split("\n")[:-3]) + "\n"
return hashlib.sha256(inner_doc.encode("ascii")).hexdigest().upper() return hashlib.sha256(inner_doc.encode("ascii")).hexdigest().upper()
def sign(self, keys): def sign(self, keys):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment