backport DSA truncation fix to 0.6.x

Fixes an issue with OpenSSL 1.0.0, 1.0.0a, and 1.0.0b. Changelog in the next PR.