Add OpenSSL compat: BIO_get_new_index, i2d_PUBKEY_bio, OpenSSL_version#10294
Open
Roy-Carter wants to merge 3 commits intowolfSSL:masterfrom
Open
Add OpenSSL compat: BIO_get_new_index, i2d_PUBKEY_bio, OpenSSL_version#10294Roy-Carter wants to merge 3 commits intowolfSSL:masterfrom
Roy-Carter wants to merge 3 commits intowolfSSL:masterfrom
Conversation
Contributor
Author
|
@julek-wolfssl can you please run the workflow on this ? |
|
Can one of the admins verify this patch? |
Member
|
Okay to test. Contributor agreement on file. |
Contributor
Author
|
hey @julek-wolfssl would you mind checking why the packaging test failed ? looks like a false positive , I don't see any errors there on the log regarding the build process of wolfssl which can relate to my code , or maybe I missed something |
dgarske
requested changes
Apr 24, 2026
Member
dgarske
left a comment
There was a problem hiding this comment.
�[1;38;5;243m--enable-leantls --enable-session-ticket --enable-sni --enable-opensslextra
Testing DEFAULT: --enable-leantls --enable-session-ticket --enable-sni --enable-opensslextra --disable-shared
Configure RESULT = 0
make[2]: warning: -j9 forced in submake: resetting jobserver mode.
/usr/bin/ld: tests/unit_test-api.o: in function `test_wolfSSL_i2d_PUBKEY_bio':
api.c:(.text+0xcb74): undefined reference to `wolfSSL_i2d_PUBKEY_bio'
/usr/bin/ld: api.c:(.text+0xcbc9): undefined reference to `wolfSSL_i2d_PUBKEY_bio'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:7709: tests/unit.test] Error 1
make[1]: *** [Makefile:11517: all-recursive] Error 1
4a8f2a7 to
12e2b22
Compare
Contributor
Author
|
@dgarske @julek-wolfssl can we re-test ? fixed build errors |
Member
|
Retest this please. |
julek-wolfssl
requested changes
Apr 28, 2026
Comment on lines
+27899
to
+27926
| ExpectNotNull(ver = OpenSSL_version(OPENSSL_VERSION)); | ||
| ExpectIntEQ(XMEMCMP(ver, "wolfSSL " LIBWOLFSSL_VERSION_STRING, | ||
| XSTRLEN("wolfSSL " LIBWOLFSSL_VERSION_STRING)), 0); | ||
|
|
||
| /* Test OPENSSL_CFLAGS type */ | ||
| ExpectNotNull(ver = OpenSSL_version(OPENSSL_CFLAGS)); | ||
| ExpectNotNull(XSTRSTR(ver, "compiler:")); | ||
|
|
||
| /* Test OPENSSL_BUILT_ON type */ | ||
| ExpectNotNull(ver = OpenSSL_version(OPENSSL_BUILT_ON)); | ||
| ExpectNotNull(XSTRSTR(ver, "built on:")); | ||
|
|
||
| /* Test OPENSSL_PLATFORM type */ | ||
| ExpectNotNull(ver = OpenSSL_version(OPENSSL_PLATFORM)); | ||
| ExpectNotNull(XSTRSTR(ver, "platform:")); | ||
|
|
||
| /* Test OPENSSL_DIR type */ | ||
| ExpectNotNull(ver = OpenSSL_version(OPENSSL_DIR)); | ||
| ExpectNotNull(XSTRSTR(ver, "OPENSSLDIR:")); | ||
|
|
||
| /* Test OPENSSL_ENGINES_DIR type */ | ||
| ExpectNotNull(ver = OpenSSL_version(OPENSSL_ENGINES_DIR)); | ||
| ExpectNotNull(XSTRSTR(ver, "ENGINESDIR:")); | ||
|
|
||
| /* Test unknown type falls back to version string */ | ||
| ExpectNotNull(ver = OpenSSL_version(99)); | ||
| ExpectIntEQ(XMEMCMP(ver, "wolfSSL " LIBWOLFSSL_VERSION_STRING, | ||
| XSTRLEN("wolfSSL " LIBWOLFSSL_VERSION_STRING)), 0); |
Member
There was a problem hiding this comment.
It would be better to use ExpectStrEQ here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
As part of the continuous of the integration of openssl to wolfssl i've come across a few missing functions needed for OpenSSL-compat APIs: BIO_get_new_index() (unique custom BIO type IDs, 128–255), i2d_PUBKEY_bio() (write public-key DER to a BIO), and OpenSSL_version(type) handling for the six standard OPENSSL_* selector constants (plus unknown → version string). Headers/macros updated under OPENSSL_EXTRA / !NO_BIO as appropriate.
Testing
Ran ./tests/unit.test with -~BIO_get_new_index, -~OpenSSL_version, and -~i2d_PUBKEY_bio (substring filters). All passed.
Checklist