If you touched your penis after fingering the other person, if there were rests of
rectal fluids on your finger, you could have been exposed to gonorrhea and chlamydia as well. But one more time, the risk is remote, if not negligible.
If you are concerned, you can test as follows:
-Syphilis, 6 weeks after the exposure, and if your result is negative, repeat it 3 months after the encounter, as there are people that take longer to show a positive result.