Gerrit Bot would like Michael Cook to review this change.
all: fix ineffectual assignments
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 93fa7dce1bfeb7bdc50f607e0a9ba9d83fe292ce
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 12 insertions(+), 30 deletions(-)
diff --git a/ed25519/internal/edwards25519/edwards25519.go b/ed25519/internal/edwards25519/edwards25519.go
index fd03c25..1570bdb 100644
--- a/ed25519/internal/edwards25519/edwards25519.go
+++ b/ed25519/internal/edwards25519/edwards25519.go
@@ -1164,7 +1164,6 @@
s14 -= s23 * 997805
s15 += s23 * 136657
s16 -= s23 * 683901
- s23 = 0
s10 += s22 * 666643
s11 += s22 * 470296
@@ -1172,7 +1171,6 @@
s13 -= s22 * 997805
s14 += s22 * 136657
s15 -= s22 * 683901
- s22 = 0
s9 += s21 * 666643
s10 += s21 * 470296
@@ -1180,7 +1178,6 @@
s12 -= s21 * 997805
s13 += s21 * 136657
s14 -= s21 * 683901
- s21 = 0
s8 += s20 * 666643
s9 += s20 * 470296
@@ -1188,7 +1185,6 @@
s11 -= s20 * 997805
s12 += s20 * 136657
s13 -= s20 * 683901
- s20 = 0
s7 += s19 * 666643
s8 += s19 * 470296
@@ -1196,7 +1192,6 @@
s10 -= s19 * 997805
s11 += s19 * 136657
s12 -= s19 * 683901
- s19 = 0
s6 += s18 * 666643
s7 += s18 * 470296
@@ -1204,7 +1199,6 @@
s9 -= s18 * 997805
s10 += s18 * 136657
s11 -= s18 * 683901
- s18 = 0
carry[6] = (s6 + (1 << 20)) >> 21
s7 += carry[6]
@@ -1247,7 +1241,6 @@
s8 -= s17 * 997805
s9 += s17 * 136657
s10 -= s17 * 683901
- s17 = 0
s4 += s16 * 666643
s5 += s16 * 470296
@@ -1255,7 +1248,6 @@
s7 -= s16 * 997805
s8 += s16 * 136657
s9 -= s16 * 683901
- s16 = 0
s3 += s15 * 666643
s4 += s15 * 470296
@@ -1263,7 +1255,6 @@
s6 -= s15 * 997805
s7 += s15 * 136657
s8 -= s15 * 683901
- s15 = 0
s2 += s14 * 666643
s3 += s14 * 470296
@@ -1271,7 +1262,6 @@
s5 -= s14 * 997805
s6 += s14 * 136657
s7 -= s14 * 683901
- s14 = 0
s1 += s13 * 666643
s2 += s13 * 470296
@@ -1279,7 +1269,6 @@
s4 -= s13 * 997805
s5 += s13 * 136657
s6 -= s13 * 683901
- s13 = 0
s0 += s12 * 666643
s1 += s12 * 470296
@@ -1378,7 +1367,6 @@
s3 -= s12 * 997805
s4 += s12 * 136657
s5 -= s12 * 683901
- s12 = 0
carry[0] = s0 >> 21
s1 += carry[0]
@@ -1486,7 +1474,6 @@
s14 -= s23 * 997805
s15 += s23 * 136657
s16 -= s23 * 683901
- s23 = 0
s10 += s22 * 666643
s11 += s22 * 470296
@@ -1494,7 +1481,6 @@
s13 -= s22 * 997805
s14 += s22 * 136657
s15 -= s22 * 683901
- s22 = 0
s9 += s21 * 666643
s10 += s21 * 470296
@@ -1502,7 +1488,6 @@
s12 -= s21 * 997805
s13 += s21 * 136657
s14 -= s21 * 683901
- s21 = 0
s8 += s20 * 666643
s9 += s20 * 470296
@@ -1510,7 +1495,6 @@
s11 -= s20 * 997805
s12 += s20 * 136657
s13 -= s20 * 683901
- s20 = 0
s7 += s19 * 666643
s8 += s19 * 470296
@@ -1518,7 +1502,6 @@
s10 -= s19 * 997805
s11 += s19 * 136657
s12 -= s19 * 683901
- s19 = 0
s6 += s18 * 666643
s7 += s18 * 470296
@@ -1526,7 +1509,6 @@
s9 -= s18 * 997805
s10 += s18 * 136657
s11 -= s18 * 683901
- s18 = 0
var carry [17]int64
@@ -1571,7 +1553,6 @@
s8 -= s17 * 997805
s9 += s17 * 136657
s10 -= s17 * 683901
- s17 = 0
s4 += s16 * 666643
s5 += s16 * 470296
@@ -1579,7 +1560,6 @@
s7 -= s16 * 997805
s8 += s16 * 136657
s9 -= s16 * 683901
- s16 = 0
s3 += s15 * 666643
s4 += s15 * 470296
@@ -1587,7 +1567,6 @@
s6 -= s15 * 997805
s7 += s15 * 136657
s8 -= s15 * 683901
- s15 = 0
s2 += s14 * 666643
s3 += s14 * 470296
@@ -1595,7 +1574,6 @@
s5 -= s14 * 997805
s6 += s14 * 136657
s7 -= s14 * 683901
- s14 = 0
s1 += s13 * 666643
s2 += s13 * 470296
@@ -1603,7 +1581,6 @@
s4 -= s13 * 997805
s5 += s13 * 136657
s6 -= s13 * 683901
- s13 = 0
s0 += s12 * 666643
s1 += s12 * 470296
@@ -1702,7 +1679,6 @@
s3 -= s12 * 997805
s4 += s12 * 136657
s5 -= s12 * 683901
- s12 = 0
carry[0] = s0 >> 21
s1 += carry[0]
diff --git a/nacl/sign/sign_test.go b/nacl/sign/sign_test.go
index 0a6439a..db26901 100644
--- a/nacl/sign/sign_test.go
+++ b/nacl/sign/sign_test.go
@@ -40,7 +40,7 @@
if !bytes.Equal(message, testMessage) {
t.Fatalf("message did not match, got\n%x\n, expected\n%x", message, testMessage)
}
- message, ok = Open(nil, testSignedMessage[1:], &testPublicKey)
+ _, ok = Open(nil, testSignedMessage[1:], &testPublicKey)
if ok {
t.Fatalf("invalid signed message successfully verified")
}
diff --git a/ocsp/ocsp.go b/ocsp/ocsp.go
index f079d9e..d02b315 100644
--- a/ocsp/ocsp.go
+++ b/ocsp/ocsp.go
@@ -483,7 +483,7 @@
}
var basicResp basicResponse
- rest, err = asn1.Unmarshal(resp.Response.Response, &basicResp)
+ _, err = asn1.Unmarshal(resp.Response.Response, &basicResp)
if err != nil {
return nil, err
}
diff --git a/openpgp/packet/opaque_test.go b/openpgp/packet/opaque_test.go
index f27bbfe..d53da0a 100644
--- a/openpgp/packet/opaque_test.go
+++ b/openpgp/packet/opaque_test.go
@@ -33,6 +33,9 @@
}
// try to parse opaque packet
p, err := op.Parse()
+ if err != nil {
+ t.Errorf("#%d: opaque parse error: %v", count, err)
+ }
switch pkt := p.(type) {
case *UserId:
uid = pkt
diff --git a/otr/otr.go b/otr/otr.go
index 173b753..1be103f 100644
--- a/otr/otr.go
+++ b/otr/otr.go
@@ -637,7 +637,7 @@
}
func (c *Conversation) processDHKey(in []byte) (isSame bool, err error) {
- gy, in, ok := getMPI(in)
+ gy, _, ok := getMPI(in)
if !ok {
err = errors.New("otr: corrupt DH key message")
return
diff --git a/ssh/agent/client_test.go b/ssh/agent/client_test.go
index 2f798f9..2f8abf1 100644
--- a/ssh/agent/client_test.go
+++ b/ssh/agent/client_test.go
@@ -444,14 +444,14 @@
func TestAgentExtensions(t *testing.T) {
agent, _, cleanup := startOpenSSHAgent(t)
defer cleanup()
- result, err := agent.Extension("my-ext...@example.com", []byte{0x00, 0x01, 0x02})
+ _, err := agent.Extension("my-ext...@example.com", []byte{0x00, 0x01, 0x02})
if err == nil {
t.Fatal("should have gotten agent extension failure")
}
agent, cleanup = startAgent(t, &keyringExtended{})
defer cleanup()
- result, err = agent.Extension("my-ext...@example.com", []byte{0x00, 0x01, 0x02})
+ result, err := agent.Extension("my-ext...@example.com", []byte{0x00, 0x01, 0x02})
if err != nil {
t.Fatalf("agent extension failure: %v", err)
}
@@ -459,7 +459,7 @@
t.Fatalf("agent extension result invalid: %v", result)
}
- result, err = agent.Extension("bad-ex...@example.com", []byte{0x00, 0x01, 0x02})
+ _, err = agent.Extension("bad-ex...@example.com", []byte{0x00, 0x01, 0x02})
if err == nil {
t.Fatal("should have gotten agent extension failure")
}
diff --git a/ssh/benchmark_test.go b/ssh/benchmark_test.go
index 20c3307..a13235d 100644
--- a/ssh/benchmark_test.go
+++ b/ssh/benchmark_test.go
@@ -93,6 +93,9 @@
b.Fatalf("Client: %v", err)
}
ch, incoming, err := newCh.Accept()
+ if err != nil {
+ b.Fatalf("Accept: %v", err)
+ }
go DiscardRequests(incoming)
for i := 0; i < b.N; i++ {
if _, err := io.ReadFull(ch, output); err != nil {
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Congratulations on opening your first change. Thank you for your contribution!
Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.
Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.
During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.
Gerrit Bot uploaded patch set #2 to this change.
all: fix ineffectual assignments
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: e52e04548f31706934eea85baae4345129d87c43
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
File ed25519/internal/edwards25519/edwards25519.go:
Were these found by a tool? If so, include info in the commit message.
Any change in the generated code? Note in commit message. Any change to performance if so?
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot uploaded patch set #3 to this change.
all: fix ineffectual assignments
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: dc70cc93264b5741709ad6ebd54db3ec666ea528
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot uploaded patch set #4 to this change.
all: fix ineffectual assignments
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 11c5670d06c73b238dad83b968b49d39a87b6470
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot uploaded patch set #7 to this change.
all: fix ineffectual assignments
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 11c5670d06c73b238dad83b968b49d39a87b6470
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot uploaded patch set #9 to this change.
all: fix ineffectual assignments
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 11c5670d06c73b238dad83b968b49d39a87b6470
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot uploaded patch set #10 to this change.
all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 11c5670d06c73b238dad83b968b49d39a87b6470
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Michael Cook uploaded patch set #6 to the change originally created by Gerrit Bot.
all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 11c5670d06c73b238dad83b968b49d39a87b6470
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Patch Set 2:
(1 comment)
1 comment:
Were these found by a tool? If so, include info in the commit message. […]
I've updated the commit message to show the tool used and to note that go generate doesn't generate any changes.
go test -bench isn't showing noticeable differences.
Are there any other generators/benchmarks I should be kicking off?
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Michael Cook uploaded patch set #8 to the change originally created by Gerrit Bot.
all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 11c5670d06c73b238dad83b968b49d39a87b6470
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Michael Cook uploaded patch set #5 to the change originally created by Gerrit Bot.
all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 11c5670d06c73b238dad83b968b49d39a87b6470
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 10 insertions(+), 31 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
2 comments:
File ed25519/internal/edwards25519/edwards25519.go:
I'd like all these not to be removed. This function is overwhelming, any hint about what is not used anymore is useful. The compiler can ignore them.
Patch Set #10, Line 486: _, err = asn1.Unmarshal(resp.Response.Response, &basicResp)
len(rest) == 0 should be checked here like above.
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot uploaded patch set #11 to this change.
all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: 4b324c37064e8a6af227caf4e0e924240003167c
GitHub-Pull-Request: golang/crypto#70
---
M ed25519/internal/edwards25519/edwards25519.go
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
7 files changed, 12 insertions(+), 30 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
I've updated the ocsp change, waiting for your opinion on the ed24419 change since I've added more info for you.
1 comment:
I'd like all these not to be removed. […]
My read of it is that this was ported from another language and he's assigning `0` to clear the variable, but that's not needed with golang.
Here's the ineffassign output for edwards25519.go at 8d7daa0 (with full path truncated):
crypto/ed25519/internal/edwards25519/edwards25519.go:1167:2: ineffectual assignment to s23
crypto/ed25519/internal/edwards25519/edwards25519.go:1175:2: ineffectual assignment to s22
crypto/ed25519/internal/edwards25519/edwards25519.go:1183:2: ineffectual assignment to s21
crypto/ed25519/internal/edwards25519/edwards25519.go:1191:2: ineffectual assignment to s20
crypto/ed25519/internal/edwards25519/edwards25519.go:1199:2: ineffectual assignment to s19
crypto/ed25519/internal/edwards25519/edwards25519.go:1207:2: ineffectual assignment to s18
crypto/ed25519/internal/edwards25519/edwards25519.go:1250:2: ineffectual assignment to s17
crypto/ed25519/internal/edwards25519/edwards25519.go:1258:2: ineffectual assignment to s16
crypto/ed25519/internal/edwards25519/edwards25519.go:1266:2: ineffectual assignment to s15
crypto/ed25519/internal/edwards25519/edwards25519.go:1274:2: ineffectual assignment to s14
crypto/ed25519/internal/edwards25519/edwards25519.go:1282:2: ineffectual assignment to s13
crypto/ed25519/internal/edwards25519/edwards25519.go:1381:2: ineffectual assignment to s12
crypto/ed25519/internal/edwards25519/edwards25519.go:1489:2: ineffectual assignment to s23
crypto/ed25519/internal/edwards25519/edwards25519.go:1497:2: ineffectual assignment to s22
crypto/ed25519/internal/edwards25519/edwards25519.go:1505:2: ineffectual assignment to s21
crypto/ed25519/internal/edwards25519/edwards25519.go:1513:2: ineffectual assignment to s20
crypto/ed25519/internal/edwards25519/edwards25519.go:1521:2: ineffectual assignment to s19
crypto/ed25519/internal/edwards25519/edwards25519.go:1529:2: ineffectual assignment to s18
crypto/ed25519/internal/edwards25519/edwards25519.go:1574:2: ineffectual assignment to s17
crypto/ed25519/internal/edwards25519/edwards25519.go:1582:2: ineffectual assignment to s16
crypto/ed25519/internal/edwards25519/edwards25519.go:1590:2: ineffectual assignment to s15
crypto/ed25519/internal/edwards25519/edwards25519.go:1598:2: ineffectual assignment to s14
crypto/ed25519/internal/edwards25519/edwards25519.go:1606:2: ineffectual assignment to s13
crypto/ed25519/internal/edwards25519/edwards25519.go:1705:2: ineffectual assignment to s12
That said, this function is indeed overwhelming, and if reverting the changes in this file is what you prefer, then that of course is what I'll do.
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
My read of it is that this was ported from another language and he's assigning `0` to clear the vari […]
I do believe the lines are useless, but I think that even in whatever language this came from the point of zeroing them was to "free" this "manually allocated register". Entirely symbolical, but helps a bit the human trying to trace things.
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit Bot uploaded patch set #12 to this change.
all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: acd17cce410e9c68ce3c87b5546261be9153e3ea
GitHub-Pull-Request: golang/crypto#70
---
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
6 files changed, 12 insertions(+), 6 deletions(-)
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
I've pulled the changes to ed25519/internal/edwards25519/edwards25519.go
1 comment:
I do believe the lines are useless, but I think that even in whatever language this came from the po […]
Done
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
2 comments:
File ed25519/internal/edwards25519/edwards25519.go:
I've updated the commit message to show the tool used and to note that go generate doesn't generate […]
Done
Patch Set #10, Line 486: _, err = asn1.Unmarshal(resp.Response.Response, &basicResp)
len(rest) == 0 should be checked here like above.
Done
To view, visit change 155942. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 12:Code-Review +2
Filippo Valsorda merged this change.
all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes
Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: acd17cce410e9c68ce3c87b5546261be9153e3ea
GitHub-Pull-Request: golang/crypto#70
Reviewed-on: https://go-review.googlesource.com/c/155942
Reviewed-by: Filippo Valsorda <fil...@golang.org>
---
M nacl/sign/sign_test.go
M ocsp/ocsp.go
M openpgp/packet/opaque_test.go
M otr/otr.go
M ssh/agent/client_test.go
M ssh/benchmark_test.go
6 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/nacl/sign/sign_test.go b/nacl/sign/sign_test.go
index 0a6439a..db26901 100644
--- a/nacl/sign/sign_test.go
+++ b/nacl/sign/sign_test.go
@@ -40,7 +40,7 @@
if !bytes.Equal(message, testMessage) {
t.Fatalf("message did not match, got\n%x\n, expected\n%x", message, testMessage)
}
- message, ok = Open(nil, testSignedMessage[1:], &testPublicKey)
+ _, ok = Open(nil, testSignedMessage[1:], &testPublicKey)
if ok {
t.Fatalf("invalid signed message successfully verified")
}
diff --git a/ocsp/ocsp.go b/ocsp/ocsp.go
index f079d9e..d297ac9 100644
--- a/ocsp/ocsp.go
+++ b/ocsp/ocsp.go
@@ -487,6 +487,9 @@
if err != nil {
return nil, err
}
+ if len(rest) > 0 {
+ return nil, ParseError("trailing data in OCSP response")
+ }
if n := len(basicResp.TBSResponseData.Responses); n == 0 || cert == nil && n > 1 {
return nil, ParseError("OCSP response contains bad number of responses")
diff --git a/openpgp/packet/opaque_test.go b/openpgp/packet/opaque_test.go
index f27bbfe..61159f4 100644
--- a/openpgp/packet/opaque_test.go
+++ b/openpgp/packet/opaque_test.go
@@ -32,7 +32,7 @@
break
}
// try to parse opaque packet
- p, err := op.Parse()
+ p, _ := op.Parse()