Yes, and as I was thinking about this after posting, I also remembered the slightly more formal 'We shook hands in farewell', and at the same time I realized that context would usually tell us whether the speakers were coming or going, so that a simple 'We shook hands' may perhaps be the commonest of all.