Skip to content

Rust wrapper: validate WOLFSSL_PREFIX in build.rs#10703

Open
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:rust-validate-prefix-env-var
Open

Rust wrapper: validate WOLFSSL_PREFIX in build.rs#10703
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:rust-validate-prefix-env-var

Conversation

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor

Description

Check that WOLFSSL_PREFIX/lib directory exists if WOLFSSL_PREFIX is specified.
Check that WOLFSSL_PREFIX environment variable does not contain a newline character.

Testing

Build and run unit tests for Rust wrapper.

Checklist

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

@holtrop-wolfssl holtrop-wolfssl self-assigned this Jun 16, 2026
Copilot AI review requested due to automatic review settings June 16, 2026 19:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the Rust wrapper’s build script handling of the WOLFSSL_PREFIX environment variable, aiming to avoid misconfiguration and reduce risk from malformed values when locating wolfSSL headers/libs.

Changes:

  • Adds a helper to read/validate WOLFSSL_PREFIX (currently rejecting newline-containing values).
  • Validates that ${WOLFSSL_PREFIX}/lib exists before using it for linking; otherwise falls back to system/in-tree behavior.
  • Routes both include-dir and lib-dir selection through the same prefix helper for consistent behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wrapper/rust/wolfssl-wolfcrypt/build.rs
Comment thread wrapper/rust/wolfssl-wolfcrypt/build.rs Outdated
@holtrop-wolfssl holtrop-wolfssl force-pushed the rust-validate-prefix-env-var branch from 568e901 to d523e46 Compare June 16, 2026 19:22
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.

2 participants