fix DER encoding for signatures