chiark
/
gitweb
/
~mdw
/
chopwood
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
httpauth.py: Use `base64' module's built-in character twiddles.
[chopwood]
/
httpauth.py
diff --git
a/httpauth.py
b/httpauth.py
index ea978eb123fa1ffd9b4cee82890d892382a711c5..6bb3ec83c14701433eeb6a83801ecf8a2000895f 100644
(file)
--- a/
httpauth.py
+++ b/
httpauth.py
@@
-149,9
+149,7
@@
def freshsecret():
def hack_octets(s):
"""Return the octet string S, in a vaguely pretty form."""
def hack_octets(s):
"""Return the octet string S, in a vaguely pretty form."""
- return BN.b64encode(s) \
- .rstrip('=') \
- .replace('/', '$')
+ return BN.b64encode(s, '+$').rstrip('=')
def auth_tag(sec, stamp, nonce, user):
"""Compute a tag using secret SEC on `STAMP.NONCE.USER'."""
def auth_tag(sec, stamp, nonce, user):
"""Compute a tag using secret SEC on `STAMP.NONCE.USER'."""