Skip to content

Commit

Permalink
variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
orangepizza authored and ldez committed Apr 23, 2023
1 parent 9fa8c7e commit 46299b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions challenge/tlsalpn01/tls_alpn_challenge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ func TestChallengeIPaddress(t *testing.T) {
assert.NotEmpty(t, remoteCert.Extensions, "Expected the challenge certificate to contain extensions")

var foundAcmeIdentifier bool
for i, ext := range remoteCert.Extensions {
var extValue []byte
for _, ext := range remoteCert.Extensions {
if idPeAcmeIdentifierV1.Equal(ext.Id) {
assert.True(t, ext.Critical, "Expected the challenge certificate id-pe-acmeIdentifier extension to be marked as critical")
foundAcmeIdentifier = true
extValue = ext.Value
break
}
}
Expand All @@ -156,7 +158,7 @@ func TestChallengeIPaddress(t *testing.T) {
value, err := asn1.Marshal(zBytes[:sha256.Size])
require.NoError(t, err, "Expected marshaling of the keyAuth to return no error")

require.EqualValues(t, value, ext.Value, "Expected the challenge certificate id-pe-acmeIdentifier extension to contain the SHA-256 digest of the keyAuth")
require.EqualValues(t, value, extValue, "Expected the challenge certificate id-pe-acmeIdentifier extension to contain the SHA-256 digest of the keyAuth")

return nil
}
Expand Down Expand Up @@ -184,4 +186,4 @@ func TestChallengeIPaddress(t *testing.T) {
}

require.NoError(t, solver.Solve(authz))
}
}

0 comments on commit 46299b5

Please sign in to comment.