Skip to content
Open
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
8 changes: 4 additions & 4 deletions fiskalhr/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<Reference>
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue></DigestValue>
</Reference>
</SignedInfo>
Expand Down Expand Up @@ -126,7 +126,7 @@ def sign_zki_payload(self, data: str) -> str:
"""
Sign raw ZKI payload using the private key

Payload is signed using SHA1+RSA algorithm. The signature is
Payload is signed using SHA256+RSA algorithm. The signature is
hashed using MD5 digest algorithm. The resulting digest is
returned as hexadecimal string.

Expand All @@ -144,7 +144,7 @@ def sign_zki_payload(self, data: str) -> str:
signature = self.hazmat_key.sign(
data.encode("utf-8"),
padding.PKCS1v15(),
hashes.SHA1(),
hashes.SHA256(),
)
return md5(signature).hexdigest()

Expand Down