Improve checks for invalid saltlen in DER writer.