Add OpenSSL compat: BIO_get_new_index, i2d_PUBKEY_bio, OpenSSL_version#10294
Add OpenSSL compat: BIO_get_new_index, i2d_PUBKEY_bio, OpenSSL_version#10294Roy-Carter wants to merge 6 commits into
Conversation
|
@julek-wolfssl can you please run the workflow on this ? |
|
Can one of the admins verify this patch? |
|
Okay to test. Contributor agreement on file. |
|
|
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
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
|
@dgarske @julek-wolfssl can we re-test ? fixed build errors |
|
Retest this please. |
12e2b22 to
c3a8004
Compare
|
openvpn test failed due to what seems like diffs from master and not my code , i rebased to master can we re-run workflow @julek-wolfssl |
4dfa2fc to
74bd323
Compare
|
@julek-wolfssl @dgarske can we re-run workflows ? there was a conflict on two of the test files |
|
Jenkins retest this please |
julek-wolfssl
left a comment
There was a problem hiding this comment.
Please rebase before pushing to this branch.
75748d0 to
c2e9c6c
Compare
|
@julek-wolfssl @dgarske I updated the branch and rebased to master , all tests passed before so i assume it only relates to the branch being out-dated . |
|
Jenkins okay to test |
There was a problem hiding this comment.
Pull request overview
Adds several OpenSSL compatibility APIs for BIO type allocation, public-key DER encoding to BIOs, and richer OpenSSL_version() selector handling.
Changes:
- Adds
BIO_get_new_index()constants, mapping, implementation, and BIO API tests. - Adds
i2d_PUBKEY_bio()mapping, implementation, and RSA/ECC round-trip tests. - Expands
OpenSSL_version()selector constants and test coverage.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
wolfssl/ssl.h |
Declares new BIO index constants/API and wolfSSL_i2d_PUBKEY_bio. |
wolfssl/openssl/ssl.h |
Maps i2d_PUBKEY_bio to wolfSSL implementation. |
wolfssl/openssl/opensslv.h |
Adds OpenSSL version selector constants. |
wolfssl/openssl/bio.h |
Maps BIO_TYPE_START and BIO_get_new_index. |
wolfcrypt/src/evp_pk.c |
Implements DER public key encoding to BIO. |
tests/api/test_ossl_bio.h |
Registers new BIO index API test. |
tests/api/test_ossl_bio.c |
Adds BIO index allocation test. |
tests/api.c |
Adds i2d_PUBKEY_bio tests and expands OpenSSL_version tests. |
src/ssl.c |
Implements selector-specific OpenSSL_version() responses. |
src/bio.c |
Implements custom BIO type index allocation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Just the one copilot comment to address and CI failures. Thanks @Roy-Carter
c2e9c6c to
46f6269
Compare
Hey , Just pushed the change , I assume the failures happened due to the openssl fix copilot suggested the fix for since I see that those cases now run fine |
| /* Test unknown type falls back to version string */ | ||
| ExpectNotNull(ver = OpenSSL_version(99)); | ||
| ExpectStrEQ(ver, "not available"); |
There was a problem hiding this comment.
NIT: comment is wrong here
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