Skip to content

Return new error CTX_BUSY_E on APIs which would modify aliased buffers#10877

Draft
padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:block-apis-in-sni-callback
Draft

Return new error CTX_BUSY_E on APIs which would modify aliased buffers#10877
padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:block-apis-in-sni-callback

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Description

Alternate approach to #10860. Prevent several APIs from running in SNI callback since they would free buffers pointed to by both the WOLFSSL and WOLFSSL_CTX objects.

Fixes zd 22107

The full list of newly disallowed functions is below. Instead, applications should use wolfSSL_use_certificate_file, wolfSSL_use_PrivateKey_file, wolfSSL_SetTmpDH, wolfSSL_set_SSL_CTX, wolfSSL_CTX_load_verify_locations.

Certificate (leaf)

wolfSSL_CTX_use_certificate_file
wolfSSL_CTX_use_certificate_buffer
wolfSSL_CTX_use_certificate_ASN1
wolfSSL_CTX_use_certificate (X509)
wolfSSL_CTX_use_certificate_label (WOLF_CRYPTO_CB)
wolfSSL_CTX_use_certificate_id (WOLF_CRYPTO_CB)

Certificate chain

wolfSSL_CTX_use_certificate_chain_file
wolfSSL_CTX_use_certificate_chain_file_format
wolfSSL_CTX_use_certificate_chain_buffer
wolfSSL_CTX_use_certificate_chain_buffer_format
wolfSSL_CTX_add_extra_chain_cert
wolfSSL_CTX_add0_chain_cert → via add1
wolfSSL_CTX_add1_chain_cert
wolfSSL_CTX_ctrl — SSL_CTRL_CHAIN (and SSL_CTRL_EXTRA_CHAIN_CERT via add_extra_chain_cert)

Private key

wolfSSL_CTX_use_PrivateKey_file
wolfSSL_CTX_use_PrivateKey_buffer
wolfSSL_CTX_use_PrivateKey_ASN1
wolfSSL_CTX_use_PrivateKey (EVP_PKEY)
wolfSSL_CTX_use_RSAPrivateKey
wolfSSL_CTX_use_RSAPrivateKey_file → via use_PrivateKey_file
wolfSSL_CTX_use_PrivateKey_Id (WOLF_PRIVATE_KEY_ID)
wolfSSL_CTX_use_PrivateKey_Id_ex → via _Id
wolfSSL_CTX_use_PrivateKey_Label (WOLF_PRIVATE_KEY_ID)

Alt private key (WOLFSSL_DUAL_ALG_CERTS)

wolfSSL_CTX_use_AltPrivateKey_file
wolfSSL_CTX_use_AltPrivateKey_buffer
wolfSSL_CTX_use_AltPrivateKey_Id
wolfSSL_CTX_use_AltPrivateKey_Id_ex → via _Id
wolfSSL_CTX_use_AltPrivateKey_Label

DH parameters

wolfSSL_CTX_SetTmpDH
wolfSSL_CTX_SetTmpDH_buffer
wolfSSL_CTX_SetTmpDH_file
wolfSSL_CTX_set_tmp_dh (OpenSSL-compat, WOLFSSL_DH*)

Cert manager

wolfSSL_CTX_UnloadIntermediateCerts

Testing

Added unit tests.

Checklist

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

@padelsbach padelsbach force-pushed the block-apis-in-sni-callback branch from 7c41cb0 to 5f45c6a Compare July 10, 2026 19:38
@padelsbach padelsbach force-pushed the block-apis-in-sni-callback branch from 5f45c6a to d4cab69 Compare July 10, 2026 22:58
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.

1 participant