Esempio n. 1
0
func NewAuthenticationResponse(packet *network.InboundPacket) *AuthenticationResponse {
	var salt []byte = nil
	var authData []byte = nil

	resultRaw := packet.ReadUInt32()
	result := constants.AuthenticationResult(resultRaw)
	other := packet.ReadRemaining()

	if result == constants.AuthenticationResultCryptPassword || result == constants.AuthenticationResultMD5Password {
		salt = other
	}

	if result == constants.AuthenticationResultGSSContinue {
		authData = other
	}

	return &AuthenticationResponse{result, salt, authData}
}
Esempio n. 2
0
func NewBackendKeyResponse(packet *network.InboundPacket) *BackendKeyResponse {
	pid := packet.ReadUInt32()
	key := packet.ReadUInt32()

	return &BackendKeyResponse{pid, key}
}