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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: use char types that resemble C API of mbedtls more closely #19837

Merged
merged 4 commits into from Nov 13, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Nov 10, 2023

馃 Generated by Copilot at 707357f

Updated the net/mbedtls module to use &u8 instead of &char for byte parameters. This avoids unnecessary casting and aligns with V's byte type.

馃 Generated by Copilot at 707357f

  • Change the function signatures of mbedtls_x509_crt_parse, mbedtls_pk_parse_key, mbedtls_net_connect, mbedtls_ssl_read, and mbedtls_ssl_write to use &u8 instead of &char for byte array parameters (link, link). This improves the compatibility and correctness of the V bindings for the mbedtls C library in vlib/net/mbedtls/mbedtls.c.v.

@spytheman
Copy link
Member

The whole file needs to be reviewed and fixed; perhaps it was written before the introduction of the usize type.

@ttytm
Copy link
Member Author

ttytm commented Nov 11, 2023

Thanks a lot for the review @spytheman!

You are right all your suggestions should be implemented. It was just the char types that became obvious to me. I'll also go through the whole file later that day to have another pair of eyes on it.

@ttytm
Copy link
Member Author

ttytm commented Nov 11, 2023

First of the two new commits does the fixing, the second just organizing.

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Good work.

@spytheman spytheman merged commit 453f65a into vlang:master Nov 13, 2023
42 checks passed
@ttytm ttytm deleted the net/mbedtls-types branch November 13, 2023 14:44
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.

None yet

2 participants