diff --git a/kpgpbase.cpp b/kpgpbase.cpp index 1d188ee4e..f6192ccda 100644 --- a/kpgpbase.cpp +++ b/kpgpbase.cpp @@ -1183,8 +1183,14 @@ KpgpBase5::encsign(const QStrList *_recipients, const char *passphrase, status |= MISSINGKEY; } - if(signonly) + if(signonly) { + // dash-escape the input + if (input[0] == '-') + input = "- " + input; + input.replace(QRegExp("\n-"), "\n- -"); + output = "-----BEGIN PGP SIGNED MESSAGE-----\n\n" + input + "\n" + output; + } return status; }