| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
func generateCert(ctx context.Context, csrPath, hostname string) error {Just out of curiosity, why did you invert these two values? Was it to sort them alphabetically?
if err := cr.CheckSignature(); err != nil {Good explicit check.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
Thanks.
func generateCert(ctx context.Context, csrPath, hostname string) error {Just out of curiosity, why did you invert these two values? Was it to sort them alphabetically?
It wasn't about alphabetical order; my intent was to leave the parameters in what seemed like a descending order, placing the core parameter towards the front, secondary parameter later. That is, I thought for purposes of `readAndCheckCSR` the csrPath is the main input. Hostname is only being passed in to double-check that the CSR was generated for the intended hostname.
I try to refrain from reordering parameters of the same time type, since it's more risky and not always an improvement to readability for other people, but here it seemed worth doing alongside the refactoring for tests.
if err := cr.CheckSignature(); err != nil {Good explicit check.
For posterity, I'll add a note here that I don't expect it to be neccessary because if it fails here, it shouldn't succeed in the future step of creating the certificate remotely.
But it seemed consistent to add a local check here since we're already checking other things that should always match when a sufficiently new version of genbotcert was used to create the CSR.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
cmd/genbotcert: add detail to hostname mismatch error
Previously, if the CSR was somehow generated without a .bots.golang.org
suffix, the hostname check would catch that it didn't match but print a
message that's not very clear. Make it more detailed.
Also check some other fields that should match provided that genbotcert,
an appropriately-new version thereof, was used to create the CSR rather
than something else.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |