Backport old digest auth to 1.7

Prior patch added old style digest auth to 1.8. Need to get this
backported to 1.7
Merge pull request #408 from taer/authfix

Backport old digest auth to 1.7