~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/golang.org/x/crypto/openpgp/clearsign/clearsign_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        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")
45
45
}
46
46
 
 
47
func TestParseInvalid(t *testing.T) {
 
48
        if b, _ := Decode(clearsignInput3); b != nil {
 
49
                t.Fatal("decoded a bad clearsigned message without any error")
 
50
        }
 
51
}
 
52
 
47
53
func TestParseWithNoNewlineAtEnd(t *testing.T) {
48
54
        input := clearsignInput
49
55
        input = input[:len(input)-len("trailing")-1]
161
167
 
162
168
trailing`)
163
169
 
 
170
var clearsignInput3 = []byte(`
 
171
-----BEGIN PGP SIGNED MESSAGE-----
 
172
Hash: SHA256
 
173
 
 
174
(This message was truncated.)
 
175
`)
 
176
 
164
177
var signingKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
165
178
Version: GnuPG v1.4.10 (GNU/Linux)
166
179