equal
deleted
inserted
replaced
56 |
56 |
57 let clientHash = h [clientSalt, serverSalt cl, webPassword cl, showB $ clientProto cl, "!hedgewars"] |
57 let clientHash = h [clientSalt, serverSalt cl, webPassword cl, showB $ clientProto cl, "!hedgewars"] |
58 let serverHash = h [serverSalt cl, clientSalt, webPassword cl, showB $ clientProto cl, "!hedgewars"] |
58 let serverHash = h [serverSalt cl, clientSalt, webPassword cl, showB $ clientProto cl, "!hedgewars"] |
59 |
59 |
60 if passwd == clientHash then |
60 if passwd == clientHash then |
61 return $ |
61 return [ |
62 AnswerClients [sendChan cl] ["SERVER_AUTH", serverHash] |
62 AnswerClients [sendChan cl] ["SERVER_AUTH", serverHash] |
63 : JoinLobby |
63 , JoinLobby |
64 : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl] |
64 ] |
65 else |
65 else |
66 return [ByeClient "Authentication failed"] |
66 return [ByeClient "Authentication failed"] |
67 where |
67 where |
68 h = B.pack . showDigest . sha1 . BL.fromChunks |
68 h = B.pack . showDigest . sha1 . BL.fromChunks |
69 |
69 |