示例#1
0
        private static void Main(string[] args)
        {
            byte[] clientSecret = new byte[]
            {
                176,
                78,
                211,
                218,
                114,
                8,
                0,
                13,
                123,
                221,
                218,
                157,
                108,
                99,
                149,
                198,
                119,
                9,
                57,
                63,
                0,
                71,
                192,
                27,
                250,
                64,
                179,
                242,
                236,
                206,
                83,
                13
            };
            byte[] joinSecret = new byte[]
            {
                125,
                73,
                96,
                253,
                110,
                64,
                35,
                206,
                201,
                11,
                222,
                183,
                70,
                22,
                93,
                32,
                137,
                184,
                228,
                228,
                142,
                16,
                50,
                68,
                42,
                99,
                74,
                105,
                38,
                131,
                42,
                69
            };
            byte[] clientChallenge = new byte[]
            {
                215,
                45,
                27,
                195,
                145,
                121,
                49,
                207,
                52,
                62,
                232,
                194,
                241,
                226,
                8,
                189
            };
            byte[] serverChallenge = new byte[]
            {
                216,
                246,
                86,
                53,
                124,
                144,
                185,
                179,
                47,
                229,
                128,
                162,
                102,
                108,
                178,
                29
            };
            byte[] userRouterChallenge = new byte[]
            {
                78,
                227,
                176,
                41,
                143,
                104,
                175,
                7,
                56,
                183,
                byte.MaxValue,
                18,
                byte.MaxValue,
                55,
                78,
                109
            };
            ulong connectionKey = 5793138720705260506UL;

            byte[] array = new byte[]
            {
                73,
                217,
                13,
                12,
                31,
                228,
                141,
                202,
                216,
                215,
                67,
                157,
                130,
                132,
                127,
                190,
                140,
                67,
                2,
                225,
                154,
                29,
                230,
                39
            };
            byte[] left = new byte[]
            {
                74,
                43,
                54,
                227,
                47,
                242,
                173,
                15,
                166,
                230,
                105,
                27,
                126,
                94,
                167,
                172,
                173,
                109,
                25,
                146,
                229,
                113,
                125,
                45,
                125,
                168,
                233,
                176,
                201,
                155,
                71,
                12,
                199,
                110,
                211,
                48,
                92,
                160,
                231,
                41
            };
            byte[] left2 = new byte[]
            {
                122,
                17,
                5,
                194,
                174,
                42,
                175,
                11,
                175,
                153,
                229,
                247,
                188,
                184,
                17,
                100,
                32,
                127,
                229,
                167,
                236,
                74,
                96,
                132
            };
            byte[] right = WowAuthCrypto.ProveRealmJoinChallenge(clientSecret, joinSecret, clientChallenge, serverChallenge);
            Console.WriteLine(WowAuthCrypto.CompareBytes(array, right));
            Console.WriteLine(WowAuthCrypto.VerifyRealmJoinChallenge(array, clientSecret, joinSecret, clientChallenge, serverChallenge));
            byte[] array2 = WowAuthCrypto.MakeSessionKey(clientSecret, joinSecret, clientChallenge, userRouterChallenge);
            Console.WriteLine(WowAuthCrypto.CompareBytes(left, array2));
            byte[] array3 = WowAuthCrypto.ProveContinueSessionChallenge(array2, clientChallenge, serverChallenge, connectionKey);
            Console.WriteLine(WowAuthCrypto.CompareBytes(left2, array3));
            Console.WriteLine(WowAuthCrypto.VerifyContinueSessionChallenge(array3, array2, clientChallenge, serverChallenge, connectionKey));
        }
示例#2
0
 public static bool VerifyContinueSessionChallenge(byte[] proof, byte[] sessionKey, byte[] clientChallenge, byte[] serverChallenge, ulong connectionKey)
 {
     WowAuthCrypto.ValidateParameter(proof, 24, "proof");
     byte[] right = WowAuthCrypto.ProveContinueSessionChallenge(sessionKey, clientChallenge, serverChallenge, connectionKey);
     return(WowAuthCrypto.CompareBytes(proof, right));
 }