Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure.ac: Add in --enable-rpk option #7379

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

mrdeep1
Copy link
Contributor

@mrdeep1 mrdeep1 commented Mar 30, 2024

Description

By default RPK (RFC7250) support is not enabled, but is enabled when
--enable-rpk, --enable-all or --enable-dist is used.

Makes use of the HAVE_RPK compile time option.

Note: should not be merged until after #7375 is merged.

Testing

Checking that the CFLAGS -DHAVE_RPK option is created when --enable-rpk, --enable-all or --enable-dist options are used, but not set otherwise.

Checklist

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

@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Apr 1, 2024

Thank you @mrdeep1 . Okay to test. I see this is related to #7375. I do not see a contributor agreement on file yet. I think you are working with Kareem on this.

@mrdeep1
Copy link
Contributor Author

mrdeep1 commented Apr 1, 2024

Please see https://wolfssl.zendesk.com/hc/requests/17707 for a copy of my Contributor Agreement.

@dgarske
Copy link
Contributor

dgarske commented Apr 1, 2024

Thanks @mrdeep1 we will work on getting your contributor agreement processed. I'm assigning this ticket to @anhu for now.

@anhu
Copy link
Member

anhu commented Apr 1, 2024

Hello @mrdeep1, I noticed a clang tidy error with your change so added a fix. That said, I'm not sure my fix was valid. I will have other members of our team have a look at my work as a double check.

@anhu anhu requested a review from wolfSSL-Bot April 1, 2024 16:58
@anhu
Copy link
Member

anhu commented Apr 1, 2024

By the way, I can confirm that the Contributor Agreement was accepted.

@anhu
Copy link
Member

anhu commented Apr 1, 2024

@mrdeep1 ,
I hope you don't mind that I directly pushed commits to you PR. All tests are now passing.
@wolfSSL-Bot , Contributor agreement has been accepted and this PR is now ready for a second look and merge if satisfactory.

Warm regards, Anthony

@mrdeep1
Copy link
Contributor Author

mrdeep1 commented Apr 1, 2024

@anhu No issues with the additional changes that you have made in the clang tidy up found in other code given that this PR now enables HAVE_RPK by default. Thanks for sorting that out.

@mrdeep1
Copy link
Contributor Author

mrdeep1 commented Apr 1, 2024

I don't know if you need the commits squashed into a single commit.

configure.ac Outdated
@@ -8211,6 +8212,13 @@ AC_ARG_ENABLE([dual-alg-certs],

AS_IF([ test "$ENABLED_DUAL_ALG_CERTS" != "no" && test "$ENABLED_EXPERIMENTAL" != "yes" ],[ AC_MSG_ERROR([dual-alg-certs requires --enable-experimental.]) ])

# Adds functionality to support RPK
AC_ARG_ENABLE([rpk],
[AS_HELP_STRING([--enable-rpk],[Enable support for RPK (default: disabled)])],
Copy link
Contributor

Choose a reason for hiding this comment

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

Please expand description for RPK to "Raw Public Key (RPC) RFC7250"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

src/tls.c Outdated
ret = (int)(OPAQUE8_LEN + cnt * OPAQUE8_LEN);
}
else if (msgType == server_hello || msgType == encrypted_extensions) {
/* sever side */
cnt = ssl->options.rpkState.sending_ClientCertTypeCnt;/* must be one */
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure removing this information about the ssl->options.rpkState.sending_ClientCertTypeCnt must be one is good. Can you at least leave a comment in there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment, as well as sanity check that the Cert type actually is RPK as per RFC7250.
Code changes pushed.

douzzer
douzzer previously requested changes Apr 5, 2024
Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

@mrdeep1 We just merged another PR (#7395) that addresses many of the same defects, and even one of the same comment spelling errors, due to duplicated/uncoordinated efforts. Can you rebase your PR on latest master and resolve the conflicts? Thanks!

@mrdeep1
Copy link
Contributor Author

mrdeep1 commented Apr 5, 2024

@douzzer Rebased, merge errors fixed and code pushed. Various commits squashed. Tidied further the code @anhu changed for clang tidy issues.

@mrdeep1
Copy link
Contributor Author

mrdeep1 commented Apr 20, 2024

@douzzer @anhu I have removed the clang tidy updates as they have all been fixed in #7395 so the only change now is in configure.ac. Code pushed.

@dgarske
Copy link
Contributor

dgarske commented Apr 23, 2024

Okay to test

@mrdeep1
Copy link
Contributor Author

mrdeep1 commented Apr 23, 2024

Do I need a login to Jenkins to look at the PRB-master-job failure?

@dgarske
Copy link
Contributor

dgarske commented Apr 23, 2024

Sorry we will have to post the results here:

[all-c89-clang-tidy] [1 of 1] [e8426ea6f3]
    autogen.sh e8426ea6f3...   real 0m18.836s  user 0m16.959s  sys 0m1.042s
    configure...   real 0m44.523s  user 0m29.887s  sys 0m17.768s
    build.../var/lib/jenkins/workspace/PRB-multi-test-script/wolfssl/tests/api.c:68808:9: warning: mixing declarations and code is a C99 extension [clang-diagnostic-declaration-after-statement]
int isServer = 0;
^

Looks like this change is part of the original PR and is a mixed declaration. Would you mind applying this patch to the PR?

% git diff
diff --git a/tests/api.c b/tests/api.c
index ad07619f7..b07b232fb 100644
--- a/tests/api.c
+++ b/tests/api.c
@@ -68186,6 +68186,9 @@ static int test_tls13_rpk_handshake(void)
     int typeCnt_c;
     int typeCnt_s;
     int tp;
+#if defined(WOLFSSL_ALWAYS_VERIFY_CB)
+    int isServer;
+#endif

     (void)err;
     (void)typeCnt_c;
@@ -68804,8 +68807,9 @@ static int test_tls13_rpk_handshake(void)
     ExpectIntEQ(wolfSSL_set_server_cert_type(ssl_s, certType_s, typeCnt_s),
                                                         WOLFSSL_SUCCESS);

+
     /* set certificate verify callback to both client and server */
-    int isServer = 0;
+    isServer = 0;
     wolfSSL_SetCertCbCtx(ssl_c, &isServer);
     wolfSSL_set_verify(ssl_c, SSL_VERIFY_PEER, MyRpkVerifyCb);

Thanks,
David Garske, wolfSSL

@dgarske dgarske assigned mrdeep1 and dgarske and unassigned anhu and douzzer Apr 23, 2024
By default RPK (RFC7250) support is not enabled, but is enabled when
--enable-rpk, --enable-all or --enable-dist is used.

Makes use of the HAVE_RPK compile time option.

Fix clang issue reported in tests/api.c during test suites
@dgarske
Copy link
Contributor

dgarske commented Apr 23, 2024

Okay to test

@mrdeep1
Copy link
Contributor Author

mrdeep1 commented Apr 24, 2024

Need to understand the new issue thrown up by PRB-master-job failure

@mrdeep1 mrdeep1 requested a review from dgarske April 24, 2024 13:33
@dgarske
Copy link
Contributor

dgarske commented Apr 24, 2024

It was a FIPS test failure and test results were already removed from history. Jenkins retest this please.

@dgarske dgarske assigned SparkiDev and unassigned dgarske and mrdeep1 Apr 30, 2024
@SparkiDev SparkiDev requested review from douzzer and removed request for anhu and douzzer April 30, 2024 22:42
@SparkiDev SparkiDev dismissed douzzer’s stale review April 30, 2024 22:44

Changes made as requested in review.

@SparkiDev SparkiDev merged commit 72d4996 into wolfSSL:master Apr 30, 2024
114 checks passed
@SparkiDev SparkiDev removed the request for review from wolfSSL-Bot April 30, 2024 22:44
@mrdeep1 mrdeep1 deleted the enable-rpk branch May 1, 2024 09:02
jefferyq2 pushed a commit to jefferyq2/wolfssl that referenced this pull request Jun 9, 2024
configure.ac: Add in --enable-rpk option
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.

7 participants