Skip to content

Commit

Permalink
Fixup doRemoteOperation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
beautifulentropy committed Dec 6, 2024
1 parent 54f37f2 commit 5cd629c
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions va/vampic.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,15 @@ func (va *ValidationAuthorityImpl) doRemoteOperation(ctx context.Context, op rem
}
if len(passed) >= required && len(passedRIRs) >= requiredRIRs {
return summarizeMPIC(passed, failed, passedRIRs), nil
} else if len(passed) >= required && firstProb == nil {
}
if firstProb == nil {
// This should never happen. If we didn't meet the thresholds above we
// should have seen at least one error.
return summarizeMPIC(passed, failed, passedRIRs), probs.Unauthorized(
"During secondary validation: validation could not be corroborated by enough distinct RIRs",
)
} else if len(failed) > va.maxRemoteFailures {
firstProb.Detail = fmt.Sprintf("During secondary validation: %s", firstProb.Detail)
return summarizeMPIC(passed, failed, passedRIRs), firstProb
} else {
// This condition should not occur - it indicates the passed/failed counts
// neither met the required threshold nor the maxRemoteFailures threshold.
return summarizeMPIC(passed, failed, passedRIRs), probs.ServerInternal("Too few remote RPC results")
return summarizeMPIC(passed, failed, passedRIRs), probs.ServerInternal(
"During secondary validation: validation failed but the problem is unavailable")
}
firstProb.Detail = fmt.Sprintf("During secondary validation: %s", firstProb.Detail)
return summarizeMPIC(passed, failed, passedRIRs), firstProb
}

// validationLogEvent is a struct that contains the information needed to log
Expand Down

0 comments on commit 5cd629c

Please sign in to comment.