Dolda2000 GitWeb
/
utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0756cac
)
acmecert: Fix cryptography bugs.
master
author
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 28 Jul 2023 10:03:19 +0000
(12:03 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 28 Jul 2023 10:03:19 +0000
(12:03 +0200)
acmecert
patch
|
blob
|
blame
|
history
diff --git
a/acmecert
b/acmecert
index
84c212a
..
14d0f00
100755
(executable)
--- a/
acmecert
+++ b/
acmecert
@@
-462,8
+462,9
@@
def mkorder(acct, csr):
def httptoken(acct, ch):
from cryptography.hazmat.primitives import hashes
def httptoken(acct, ch):
from cryptography.hazmat.primitives import hashes
- jwk = {"kty": "RSA", "e": ebignum(acct.key.e), "n": ebignum(acct.key.n)}
- dig = hashes.Hash(hashes.SHA256())
+ pub = acct.key.public_key().public_numbers()
+ jwk = {"kty": "RSA", "e": ebignum(pub.e), "n": ebignum(pub.n)}
+ dig = hashes.Hash(hashes.SHA256(), backend=cryptobke())
dig.update(json.dumps(jwk, separators=(',', ':'), sort_keys=True).encode("us-ascii"))
khash = base64url(dig.finalize())
return ch["token"], ("%s.%s" % (ch["token"], khash))
dig.update(json.dumps(jwk, separators=(',', ':'), sort_keys=True).encode("us-ascii"))
khash = base64url(dig.finalize())
return ch["token"], ("%s.%s" % (ch["token"], khash))