diff --git a/irctest/irc_utils/sasl.py b/irctest/irc_utils/sasl.py new file mode 100644 index 0000000..8bf075c --- /dev/null +++ b/irctest/irc_utils/sasl.py @@ -0,0 +1,6 @@ +import base64 + +def sasl_plain_blob(username, passphrase): + blob = base64.b64encode(b'\x00'.join((username.encode('utf-8'), username.encode('utf-8'), passphrase.encode('utf-8')))) + blobstr = blob.decode('ascii') + return f'AUTHENTICATE {blobstr}'