Beispiel #1
0
        /// <summary>
        /// Adds the account login information (for SID_AUTH_ACCOUNTLOGON)
        /// to the specified packet.
        /// </summary>
        /// <param name="loginPacket">The packet to which to add the login information.</param>
        /// <exception cref="InvalidOperationException">Thrown if the object has not
        /// yet been initialized.</exception>
        /// <remarks>
        /// <para>This method may be called first after creating the instance, or after the
        /// <see cref="CreateAccount(DataBuffer)">CreateAccount</see> method.</para>
        /// </remarks>
        /// <returns>The total number of bytes written to the buffer.</returns>
        public int LoginAccount(DataBuffer loginPacket)
        {
            byte[] temp = new byte[33 + userNameAscii.Length];
            int    len  = LoginAccount(temp, 0, temp.Length);

            loginPacket.Insert(temp);
            return(len);
        }
Beispiel #2
0
        /// <summary>
        /// Adds the account login proof (for SID_AUTH_ACCOUNTLOGONPROOF)
        /// to the specified packet.
        /// </summary>
        /// <param name="logonProofPacket">The BNCS packet to which to add the account logon data.</param>
        /// <param name="serverSalt">The salt value, sent from the server
        /// in SID_AUTH_ACCOUNTLOGON.</param>
        /// <param name="serverKey">The server key, sent from the server
        /// in SID_AUTH_ACCOUNTLOGON.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown if
        /// the salt or server key values are not exactly 32 bytes.</exception>
        /// <exception cref="InvalidOperationException">Thrown if the object has not
        /// yet been initialized.</exception>
        /// <remarks>
        /// <para>This method should be called after the <see cref="LoginAccount(DataBuffer)">LoginAccount</see> method.</para>
        /// </remarks>
        /// <returns>The total number of bytes written to the buffer.</returns>
        public int LoginProof(DataBuffer logonProofPacket, byte[] serverSalt, byte[] serverKey)
        {
            byte[] temp = new byte[20];
            int    len  = LoginProof(temp, 0, 20, serverSalt, serverKey);

            logonProofPacket.Insert(temp);
            return(len);
        }
Beispiel #3
0
 /// <summary>
 /// Adds the account login proof (for SID_AUTH_ACCOUNTLOGONPROOF)
 /// to the specified packet.
 /// </summary>
 /// <param name="logonProofPacket">The BNCS packet to which to add the account logon data.</param>
 /// <param name="serverSalt">The salt value, sent from the server
 /// in SID_AUTH_ACCOUNTLOGON.</param>
 /// <param name="serverKey">The server key, sent from the server
 /// in SID_AUTH_ACCOUNTLOGON.</param>
 /// <exception cref="ArgumentOutOfRangeException">Thrown if 
 /// the salt or server key values are not exactly 32 bytes.</exception>
 /// <exception cref="InvalidOperationException">Thrown if the object has not 
 /// yet been initialized.</exception>
 /// <remarks>
 /// <para>This method should be called after the <see cref="LoginAccount(DataBuffer)">LoginAccount</see> method.</para>
 /// </remarks>
 /// <returns>The total number of bytes written to the buffer.</returns>
 public int LoginProof(DataBuffer logonProofPacket, byte[] serverSalt, byte[] serverKey)
 {
     byte[] temp = new byte[20];
     int len = LoginProof(temp, 0, 20, serverSalt, serverKey);
     logonProofPacket.Insert(temp);
     return len;
 }
Beispiel #4
0
 /// <summary>
 /// Adds the account login information (for SID_AUTH_ACCOUNTLOGON)
 /// to the specified packet.
 /// </summary>
 /// <param name="loginPacket">The packet to which to add the login information.</param>
 /// <exception cref="InvalidOperationException">Thrown if the object has not 
 /// yet been initialized.</exception>
 /// <remarks>
 /// <para>This method may be called first after creating the instance, or after the 
 /// <see cref="CreateAccount(DataBuffer)">CreateAccount</see> method.</para>		
 /// </remarks>
 /// <returns>The total number of bytes written to the buffer.</returns>
 public int LoginAccount(DataBuffer loginPacket)
 {
     byte[] temp = new byte[33 + userNameAscii.Length];
     int len = LoginAccount(temp, 0, temp.Length);
     loginPacket.Insert(temp);
     return len;
 }