Skip to content

fix: write certificate chains with Unicode subjects - #14

Merged
ancwrd1 merged 1 commit into
ancwrd1:mainfrom
domenkozar:fix/unicode-certificate-labels
Oct 13, 2026
Merged

ancwrd1 merged 1 commit into
ancwrd1:mainfrom
domenkozar:fix/unicode-certificate-labels

Conversation

@domenkozar

Copy link
Copy Markdown
Contributor

Writing a key chain fails when a certificate subject contains a supplementary Unicode character, even though that subject is valid UTF8String data in the certificate. The writer currently copies each subject into a BMPString friendlyName attribute.

Omit that optional generated attribute when the subject cannot be represented as BMPString. Preserve certificate DER, private-key DER, and local key IDs so leaf association and chain construction continue to work. Explicit aliases still require BMP characters, and BMP subjects keep their existing labels.

Add an OpenSSL-generated Unicode leaf/CA fixture and regression tests for round trips and explicit alias rejection. The fixture contains disposable test keys and has a regeneration script; OpenSSL is not required to build or run the tests.

Validation on Rust 1.92:

  • cargo test --workspace --offline: passed, including integration tests and doctests.
  • cargo clippy --workspace --examples --tests --offline -- -D warnings: passed.
  • cargo fmt --all -- --check: passed.

SecretSpec needs this fix to rewrap imported PKCS#12 identities without restricting certificate subjects to BMP characters. A bugfix release containing it would let SecretSpec use the registry dependency instead of a temporary Git pin.

@ancwrd1
ancwrd1 merged commit 06bdb4d into ancwrd1:main Oct 13, 2026
1 check passed
@ancwrd1

ancwrd1 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix.

@domenkozar

Copy link
Copy Markdown
Contributor Author

Thanks for the quick merge! Any chance for 0.4.1 release?

@ancwrd1

ancwrd1 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Sure, released.

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