Skip to content

Commit 159944f

Browse files
thatnealpatelgopherbot
authored andcommitted
ssh,acme: clean up tautological/impossible nil conditions
Change-Id: I4c6b4b6d8dc1e8a9d2ebfb8d350b7617d3cf7949 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/739780 Auto-Submit: Neal Patel <nealpatel@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
1 parent a408498 commit 159944f

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

acme/autocert/renewal_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ func TestRenewFromCacheAlreadyRenewed(t *testing.T) {
180180

181181
// set internal state to an almost expired cert
182182
oldCert := ca.LeafCert(exampleDomain, "ECDSA", now.Add(-2*time.Hour), now.Add(time.Minute))
183-
if err != nil {
184-
t.Fatal(err)
185-
}
186183
oldLeaf, err := validCert(exampleCertKey, oldCert.Certificate, oldCert.PrivateKey.(crypto.Signer), now)
187184
if err != nil {
188185
t.Fatal(err)

ssh/agent/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (s *server) processRequestBytes(reqData []byte) []byte {
3636
return []byte{agentFailure}
3737
}
3838

39-
if err == nil && rep == nil {
39+
if rep == nil {
4040
return []byte{agentSuccess}
4141
}
4242

ssh/certs_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,6 @@ func TestCertTypes(t *testing.T) {
330330
go NewServerConn(c1, conf)
331331

332332
priv := m.signer
333-
if err != nil {
334-
t.Fatalf("error generating ssh pubkey: %v", err)
335-
}
336-
337333
cert := &Certificate{
338334
CertType: UserCert,
339335
Key: priv.PublicKey(),

0 commit comments

Comments
 (0)