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

Sni csharp wrapper patch #7692

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

gasbytes
Copy link
Contributor

@gasbytes gasbytes commented Jun 27, 2024

Description

Fixes zd#17990

Testing

server:

mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs -OUT:server.exe

client:

mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \
wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs -OUT:client.exe

Checklist

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

/* print out results of TLS/SSL accept */
Console.WriteLine("SSL version is " + wolfssl.get_version(ssl));
Console.WriteLine("SSL cipher suite is " + wolfssl.get_current_cipher(ssl));

/* read and print out the message then reply */
if (wolfssl.read(ssl, buff, 1023) < 0)
if (wolfssl.read(ssl, buff, 1024) < 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

The point of reading 1023 is to leave a null terminator. Buff is 1024, so this is 1024-1. We use this same pattern in a few of the examples.

IntPtr result = Marshal.AllocHGlobal(32);
IntPtr inOutSz = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(inOutSz, 32);
byte [] buffer = { /* www.paypal.com */
Copy link
Contributor

Choose a reason for hiding this comment

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

Please avoid the full link, just say from PayPal website client hello. Is there a reason you didn't use our own or something not money related like google.com?

@gasbytes gasbytes marked this pull request as ready for review June 27, 2024 15:32
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Looks good! Please get customer feedback. You’re welcome to put this PR into non-draft

@JacobBarthelmeh JacobBarthelmeh merged commit 5aca239 into wolfSSL:master Jul 2, 2024
119 checks passed
@gasbytes gasbytes deleted the sni-csharp-wrapper-patch branch August 28, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants