~singpolyma/network-protocol-xmpp

b78487a01ea84bbb0360046d49458f5b11576c4e — John Millikin 13 years ago f22ab0c
Update authentication for public release of gsasl 0.3.
1 files changed, 4 insertions(+), 1 deletions(-)

M Network/Protocol/XMPP/Internal/Authentication.hs
M Network/Protocol/XMPP/Internal/Authentication.hs => Network/Protocol/XMPP/Internal/Authentication.hs +4 -1
@@ 52,7 52,7 @@ authenticate stream mechanisms userJID serverJID username password = do
			Just m -> return m
			Nothing -> error "No supported SASL mechanisms advertised"
		let (SASL.Mechanism mechBytes) = mechanism
		SASL.runClient mechanism $ do
		result <- SASL.runClient mechanism $ do
			SASL.setProperty SASL.PropertyAuthzID $ utf8 authz
			SASL.setProperty SASL.PropertyAuthID $ utf8 username
			SASL.setProperty SASL.PropertyPassword $ utf8 password


@@ 68,6 68,9 @@ authenticate stream mechanisms userJID serverJID username password = do
			case rc of
				SASL.Complete -> liftIO $ saslFinish stream
				SASL.NeedsMore -> saslLoop stream
		case result of
			Right x -> return x
			Left err -> error $ show err

saslLoop :: S.Stream s => s -> SASL.Session Result
saslLoop stream = do