|
|
@@ -44,6 +44,12 @@ func TestParse(t *testing.T) {
|
|
|
testParse(t, clearsignInput2, "\r\n\r\n(This message has a couple of blank lines at the start and end.)\r\n\r\n", "\n\n(This message has a couple of blank lines at the start and end.)\n\n\n")
|
|
|
}
|
|
|
|
|
|
+func TestParseInvalid(t *testing.T) {
|
|
|
+ if b, _ := Decode(clearsignInput3); b != nil {
|
|
|
+ t.Fatal("decoded a bad clearsigned message without any error")
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func TestParseWithNoNewlineAtEnd(t *testing.T) {
|
|
|
input := clearsignInput
|
|
|
input = input[:len(input)-len("trailing")-1]
|
|
|
@@ -161,6 +167,13 @@ qZg6BaTvOxepqOxnhVU=
|
|
|
|
|
|
trailing`)
|
|
|
|
|
|
+var clearsignInput3 = []byte(`
|
|
|
+-----BEGIN PGP SIGNED MESSAGE-----
|
|
|
+Hash: SHA256
|
|
|
+
|
|
|
+(This message was truncated.)
|
|
|
+`)
|
|
|
+
|
|
|
var signingKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
|
|
Version: GnuPG v1.4.10 (GNU/Linux)
|
|
|
|