Example #1
0
        public void Test_ScramSHA256SASLMechanism_4()
        {
            ScramSHA256SASLMechanism mechanism = new ScramSHA256SASLMechanism("user", "pencil", "rOprNGfwEbeRWgbNEkqO", null);

            mechanism.getSelectSASLMechanismMessage();
            MessageParser2           parser    = new MessageParser2();
            string                   s         = "<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj1yT3ByTkdmd0ViZVJXZ2JORWtxTyVodllEcFdVYTJSYVRDQWZ1eEZJbGopaE5sRiRrMCxzPVcyMlphSjBTTlk3c29Fc1VFamI2Z1E9PSxpPTQwOTY=</challenge>";
            List <AbstractMessage>   msgs      = parser.parseMessages(ref s);
            ScramSHAChallengeMessage challenge = (ScramSHAChallengeMessage)msgs[0];
            AbstractMessage          resp      = mechanism.generateResponse(challenge);

            Assert.IsTrue(resp is ScramSHAChallengeSolutionMessage);
        }
Example #2
0
        public void Test_ScramSHA1SASLMechanism_4()
        {
            ScramSHA1SASLMechanism mechanism = new ScramSHA1SASLMechanism("user", "pencil", "fyko+d2lbbFgONRv9qkxdawL", null);

            mechanism.getSelectSASLMechanismMessage();
            MessageParser2           parser    = new MessageParser2();
            string                   s         = "<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj1meWtvK2QybGJiRmdPTlJ2OXFreGRhd0wzcmZjTkhZSlkxWlZ2V1ZzN2oscz1RU1hDUitRNnNlazhiZjkyLGk9NDA5Ng==</challenge>";
            List <AbstractMessage>   msgs      = parser.parseMessages(ref s);
            ScramSHAChallengeMessage challenge = (ScramSHAChallengeMessage)msgs[0];
            AbstractMessage          resp      = mechanism.generateResponse(challenge);

            Assert.IsTrue(resp is ScramSHAChallengeSolutionMessage);
        }
Example #3
0
        public void Test_ScramSHA256SASLMechanism_5()
        {
            ScramSHA256SASLMechanism mechanism = new ScramSHA256SASLMechanism("user", "pencil", "rOprNGfwEbeRWgbNEkqO", null);

            mechanism.getSelectSASLMechanismMessage();
            MessageParser2                   parser    = new MessageParser2();
            string                           s         = "<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj1yT3ByTkdmd0ViZVJXZ2JORWtxTyVodllEcFdVYTJSYVRDQWZ1eEZJbGopaE5sRiRrMCxzPVcyMlphSjBTTlk3c29Fc1VFamI2Z1E9PSxpPTQwOTY=</challenge>";
            List <AbstractMessage>           msgs      = parser.parseMessages(ref s);
            ScramSHAChallengeMessage         challenge = (ScramSHAChallengeMessage)msgs[0];
            AbstractMessage                  resp      = mechanism.generateResponse(challenge);
            ScramSHAChallengeSolutionMessage respMsg   = (ScramSHAChallengeSolutionMessage)resp;

            Assert.IsTrue(string.Equals("Yz1iaXdzLHI9ck9wck5HZndFYmVSV2diTkVrcU8laHZZRHBXVWEyUmFUQ0FmdXhGSWxqKWhObEYkazAscD1kSHpiWmFwV0lrNGpVaE4rVXRlOXl0YWc5empmTUhnc3FtbWl6N0FuZFZRPQ==".ToLower(), respMsg.SOLUTION.ToLower()));
        }
Example #4
0
        public void Test_ScramSHA1SASLMechanism_5()
        {
            ScramSHA1SASLMechanism mechanism = new ScramSHA1SASLMechanism("user", "pencil", "fyko+d2lbbFgONRv9qkxdawL", null);

            mechanism.getSelectSASLMechanismMessage();
            MessageParser2                   parser    = new MessageParser2();
            string                           s         = "<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj1meWtvK2QybGJiRmdPTlJ2OXFreGRhd0wzcmZjTkhZSlkxWlZ2V1ZzN2oscz1RU1hDUitRNnNlazhiZjkyLGk9NDA5Ng==</challenge>";
            List <AbstractMessage>           msgs      = parser.parseMessages(ref s);
            ScramSHAChallengeMessage         challenge = (ScramSHAChallengeMessage)msgs[0];
            AbstractMessage                  resp      = mechanism.generateResponse(challenge);
            ScramSHAChallengeSolutionMessage respMsg   = (ScramSHAChallengeSolutionMessage)resp;

            Assert.IsTrue(string.Equals("Yz1iaXdzLHI9ZnlrbytkMmxiYkZnT05Sdjlxa3hkYXdMM3JmY05IWUpZMVpWdldWczdqLHA9djBYOHYzQnoyVDBDSkdiSlF5RjBYK0hJNFRzPQ==".ToLower(), respMsg.SOLUTION.ToLower()));
        }