digest algorithm

main
Bob Mottram 2021-11-23 13:12:09 +00:00
parent 9dc4189d57
commit 950d49b06b
1 changed files with 3 additions and 3 deletions

View File

@ -538,12 +538,12 @@ def verifyPostHeaders(httpPrefix: str,
else:
alg = hazutils.Prehashed(hashes.SHA256())
if algorithm == 'rsa-sha256' or algorithm == 'hs2019':
if digestAlgorithm == 'rsa-sha256':
headerDigest = getSHA256(signedHeaderText.encode('ascii'))
elif algorithm == 'rsa-sha512':
elif digestAlgorithm == 'rsa-sha512':
headerDigest = getSHA512(signedHeaderText.encode('ascii'))
else:
print('Unknown http signature algorithm: ' + algorithm)
print('Unknown http digest algorithm: ' + digestAlgorithm)
headerDigest = ''
paddingStr = padding.PKCS1v15()