Skip to content

Missing compatibility layer functionality #10518

Open
Roy-Carter wants to merge 2 commits into
wolfSSL:masterfrom
Roy-Carter:feature/missing_openssl_functionality
Open

Missing compatibility layer functionality #10518
Roy-Carter wants to merge 2 commits into
wolfSSL:masterfrom
Roy-Carter:feature/missing_openssl_functionality

Conversation

@Roy-Carter
Copy link
Copy Markdown
Contributor

Description

Implement needed as part of migrating from OpenSSL -> WolfSSL
wolfSSL_SSL_CIPHER_find - find cipher by 2 bytes in wired like openssl
wolfSSL_sk_SSL_CIPHER_delete - remove cipher at given index
SSL_clear_chain_certs

Testing

created unitests .

Checklist

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

wolfSSL_SSL_CIPHER_find - find cipher by 2 bytes in wired like openssl
wolfSSL_sk_SSL_CIPHER_delete - remove cipher at given index
SSL_clear_chain_certs
@Roy-Carter
Copy link
Copy Markdown
Contributor Author

@julek-wolfssl adding PR for the 3 functions i've seen problems with (missing functionality) lmk what you think

@wolfSSL-Bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@Roy-Carter
Copy link
Copy Markdown
Contributor Author

Hey @julek-wolfssl before I fix anything here since I wasn't 100% sure this is correct implementation I'd like if you can verify on your end if it's fine or not before I continue editing this

Copy link
Copy Markdown
Member

@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.

@Roy-Carter looks like issue with --enable-asynccrypt "FAIL: scripts/unit.test"

@dgarske dgarske assigned Roy-Carter and unassigned julek-wolfssl May 26, 2026
Copy link
Copy Markdown
Member

@julek-wolfssl julek-wolfssl left a comment

Choose a reason for hiding this comment

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

I would like a test to check that the connection still completes after a call to SSL_clear_chain_certs.

Comment thread src/ssl.c
Comment on lines +10997 to +11005
/* Locate a cipher in the SSL's cipher list by 2-byte wire-format suite id.
*
* Mirrors OpenSSL's SSL_CIPHER_find(ssl, ptr). The two bytes pointed to by
* ptr are the on-the-wire cipher suite identifier (ptr[0] is the high byte,
* ptr[1] is the low byte). Lookup is restricted to ciphers in ssl's cipher
* list, matching OpenSSL semantics.
*
* Returned pointer references storage owned by the SSL object's internal
* cipher list; callers must not free it. It remains valid until SSL_free.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This entire comment except maybe the first line is redundant.

Comment thread src/ssl_sk.c
Comment on lines +1228 to +1241
num = wolfSSL_sk_SSL_CIPHER_num(sk);
if (idx >= num)
return NULL;

/* Walk to the node so we can capture its inline cipher value before the
* pop_node call frees the underlying memory. */
node = sk;
{
int i;
for (i = 0; i < idx && node != NULL; i++)
node = node->next;
}
if (node == NULL)
return NULL;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just use wolfSSL_sk_SSL_CIPHER_value.

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