Skip to content

Conversation

@padelsbach
Copy link
Contributor

@padelsbach padelsbach commented Jan 8, 2026

Description

Add ability to generate a certificate revocation list (CRL), in addition to the existing CRL decode logic.

Testing

New unit test in C, and new test script which uses openssl to validate the output.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@padelsbach padelsbach force-pushed the crl-generation branch 21 times, most recently from 575cc9c to 42524ec Compare January 13, 2026 18:18
@padelsbach padelsbach marked this pull request as ready for review January 13, 2026 19:24
src/crl.c Outdated
if (tbsSz < 0) {
WOLFSSL_MSG("wc_MakeCRL_ex failed");
ret = tbsSz;
goto cleanup;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest refactoring out goto, as per coding standards unless absolutely necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see over 600 uses of goto from various developers in the code base, many touched/added within the last year and even a few from 2026. How rigorous should we be here?

I'm guessing do { ... } while(0); is also frowned upon?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I interpret our coding standard rule of "Avoid gotos unless absolutely necessary" to be worded strictly. In my opinion until a day that changes, PR reviewers should be enforcing it when reviewing new code and changes to existing code.

One common practice used instead of goto for us is falling through with ret checks like so:

ret = func_call();
if (ret == 0) {
    ret = func2_call();
}

if (ret == 0) {
    ret = func3_call();
}

<cleanup logic>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider a different solution rather than SIGN_CRL_CLEANUP(). That does avoid goto, but also seems error prone in that future devs may forget to go update that macro to free new/needed things if changing that function.

@padelsbach padelsbach force-pushed the crl-generation branch 14 times, most recently from 327b4a4 to 21eb421 Compare February 3, 2026 18:13
@padelsbach padelsbach assigned cconlon and douzzer and unassigned padelsbach Feb 3, 2026
@padelsbach padelsbach requested a review from cconlon February 3, 2026 20:50
Copy link
Member

@cconlon cconlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just a few more small items


ret = AddSignature(NULL, tbsSz, &sigDummy, sigSz, sigType);
if (ret < 0) {
ret = tbsSz + sigSz + 64;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this + 64 have a meaning or is a known size? Maybe a small comment if so would be helpful.

src/crl.c Outdated
entry->lastDate, entry->lastDateFormat,
entry->nextDate, entry->nextDateFormat,
entry->certs, entry->totalCerts,
entry->crlNumberSet ? (const byte*)entry->crlNumber : NULL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a pass and shorten/wrap all lines longer than 80 chars, thanks

src/crl.c Outdated
}

/* Build to-be-signed (TBS) portion of the CRL buffer.
* Note that we pass the fields rather than the CRL_entry struct so
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and a few other comments in this file needs backing up a few spaces to line up

@cconlon cconlon assigned padelsbach and unassigned cconlon and douzzer Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants