diff options
| author | 2019-02-06 21:05:20 +0000 | |
|---|---|---|
| committer | 2019-02-06 21:05:20 +0000 | |
| commit | 90b540d5dcef0bf796c3ee565e3ca4088282ad90 (patch) | |
| tree | 533fe5ccbe5d0c4b8d03cd9a6adc912e61bf0f66 | |
| parent | If a server has a hostname that's not an IP, use it as SNI server name (diff) | |
| signature | ||
Add type annotations to scram util functions (sasl)
| -rw-r--r-- | modules/sasl/scram.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/sasl/scram.py b/modules/sasl/scram.py index b7aa3986..fe898613 100644 --- a/modules/sasl/scram.py +++ b/modules/sasl/scram.py @@ -1,12 +1,12 @@ import base64, enum, hashlib, hmac, typing, uuid -def _scram_nonce(): +def _scram_nonce() -> bytes: return uuid.uuid4().hex.encode("utf8") -def _scram_escape(s): +def _scram_escape(s: bytes) -> bytes: return s.replace(b"=", b"=3D").replace(b",", b"=2C") -def _scram_unescape(s): +def _scram_unescape(s: bytes) -> bytes: return s.replace(b"=3D", b"=").replace(b"=2C", b",") -def _scram_xor(s1, s2): +def _scram_xor(s1: bytes, s2: bytes) -> bytes: return bytes(a ^ b for a, b in zip(s1, s2)) class SCRAMState(enum.Enum): |
