It seems like all of this new code is very paramiko-specific. It seems like it should live in the Paramiko ssh class rather than in the generic get_transport_* function (which not all Dulwich users use).