He said, "I passed by the Messenger of Allah ﷺ while he was praying, so I greeted him with salam, and he returned the greeting with a gesture." He added, "I do not recall it except that he said he gestured with his finger." This is the wording of Qutayba's narration.
حدثنا يزيد بن خالد بن موهب وقتيبة بن سعيد أن الليث حدثهم عن بكير عن نابل صاحب العباء عن ابن عمر
أنه قال مررت برسول الله ﷺ وهو يصلي فسلمت عليه فرد إشارة قال ولا أعلمه إلا قال إشارة بأصبعه وهذا لفظ حديث قتيبة
Sourcing, [sahih]. Reported by Tirmidhi, Book of Prayer, chapter on what has been said regarding gesturing during prayer, no. 367, from Qutayba, from him, and he said, "Hasan, we do not know it except from the hadith of Layth from Bukayr." There is another route in Ibn Majah, no. 1017, and others, and Ibn Khuzayma graded it sahih, no. 888, as did Ibn Hibban (al-Ihsan), no. 2255, and Hakim, 3/12, saying it meets the standard of the two shaikhs, and Dhahabi agreed with him.