Skip to content

Conversation

lxin
Copy link
Contributor

@lxin lxin commented Jul 17, 2025

This patch fixes these compiling errors with QUIC enabled:

client.c: In function ‘tlshd_quic_client_set_x509_session’: client.c:489:43: error: ‘xcred’ undeclared (first use in this function);
did you mean ‘cred’?
489 | ret = tlshd_client_get_truststore(xcred);
| ^~~~~
| cred

client.c:489:43: note: each undeclared identifier is reported only once
for each function it appears in
client.c: In function ‘tlshd_quic_client_set_psk_session’: client.c:544:31: error: incompatible types when initializing type
‘key_serial_t’ {aka ‘int’} using type ‘GArray’ {aka ‘struct _GArray’}
544 | key_serial_t peerid = conn->parms->peerids[0];
| ^~~~

server.c: In function ‘tlshd_quic_server_set_x509_session’: server.c:481:15: error: unused variable ‘cafile’ [-Werror=unused-variable]
481 | char *cafile;
| ^~~~~~

Commit fe3a78a ("tlshd: Refactor trust store management") passed incorrect 'xcred' to tlshd_client_get_truststore(), while it should be 'cred'. The unused variable 'cafile' should also be cleaned in tlshd_quic_server_set_x509_session().

Commit 18b04a6 ("tlshd: Store peer IDs in a GArray") forgot to fix the parms->peerids access in tlshd_quic_client_set_psk_session().

Fixes: fe3a78a ("tlshd: Refactor trust store management")
Fixes: 18b04a6 ("tlshd: Store peer IDs in a GArray")

This patch fixes these compiling errors with QUIC enabled:

client.c: In function ‘tlshd_quic_client_set_x509_session’:
client.c:489:43: error: ‘xcred’ undeclared (first use in this function);
  did you mean ‘cred’?
  489 |         ret = tlshd_client_get_truststore(xcred);
      |                                           ^~~~~
      |                                           cred

client.c:489:43: note: each undeclared identifier is reported only once
  for each function it appears in
client.c: In function ‘tlshd_quic_client_set_psk_session’:
client.c:544:31: error: incompatible types when initializing type
  ‘key_serial_t’ {aka ‘int’} using type ‘GArray’ {aka ‘struct _GArray’}
  544 |         key_serial_t peerid = conn->parms->peerids[0];
      |                               ^~~~

server.c: In function ‘tlshd_quic_server_set_x509_session’:
server.c:481:15: error: unused variable ‘cafile’ [-Werror=unused-variable]
  481 |         char *cafile;
      |               ^~~~~~

Commit fe3a78a ("tlshd: Refactor trust store management") passed
incorrect 'xcred' to tlshd_client_get_truststore(), while it should
be 'cred'. The unused variable 'cafile' should also be cleaned in
tlshd_quic_server_set_x509_session().

Commit 18b04a6 ("tlshd: Store peer IDs in a GArray") forgot to
fix the parms->peerids access in tlshd_quic_client_set_psk_session().

Fixes: fe3a78a ("tlshd: Refactor trust store management")
Fixes: 18b04a6 ("tlshd: Store peer IDs in a GArray")
Signed-off-by: Xin Long <[email protected]>
@chucklever
Copy link
Member

I didn't realize QUIC could be disabled. The compile test Actions need to be updated.

@lxin
Copy link
Contributor Author

lxin commented Jul 17, 2025

@chucklever it enables QUIC build in configure.ac only if /usr/include/linux/quic.h exists, as the QUIC build has dependence on this uapi header file (installed from kernel). Maybe we should do something like this?

diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml
index 5d16bd9..15138c0 100644
--- a/.github/workflows/makefile.yml
+++ b/.github/workflows/makefile.yml
@@ -22,6 +22,7 @@ jobs:
       run: |
         sudo apt-get update
         sudo apt-get -y install gnutls-dev libkeyutils-dev libnl-3-dev libnl-genl-3-dev libglib2.0-dev
+        sudo curl -s -o /usr/include/linux/quic.h https://raw.githubusercontent.com/lxin/quic/main/modules/include/uapi/linux/quic.h
 
     - name: Configure
       run: |

@chucklever
Copy link
Member

The handshake netlink protocol is defined by a kernel header too. I've dealt with that by copying it to src/tlshd/netlink.h every time the protocol changes. Maybe that's not the best approach. I'm not sure I want our testing apparatus to curl an external file, though. Any thoughts/opinions welcome.

Meanwhile I will plan to merge this PR into a minor release of 1.2.

@chucklever
Copy link
Member

Manually pushed to ktls-utils-1.2-fixes. An official 1.2 minor release that includes this PR is forthcoming.

@chucklever chucklever closed this Jul 18, 2025
@lxin
Copy link
Contributor Author

lxin commented Jul 18, 2025

@chucklever when will it go to 'main' branch?

@chucklever
Copy link
Member

@chucklever when will it go to 'main' branch?

I'm debating with myself whether to release ktls-utils-1.2.1 from a non-main branch or keep all the official releases on "main".

I hope to release in a week or two. Maybe earlier.

@chucklever
Copy link
Member

I guess I got this backwards. First, commit to main. Then cherry-pick to the release branch.

@chucklever chucklever reopened this Jul 18, 2025
@chucklever chucklever merged commit 89e80e0 into oracle:main Jul 18, 2025
8 checks passed
@lxin
Copy link
Contributor Author

lxin commented Jul 18, 2025

@chucklever That's great! ktils-utils main branch is used in the QUIC selftest Actions.

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.

2 participants