Skip to content

Refactor provider helpers - #683

Open
olszomal wants to merge 3 commits into
OpenSC:masterfrom
olszomal:provider_refactor
Open

Refactor provider helpers#683
olszomal wants to merge 3 commits into
OpenSC:masterfrom
olszomal:provider_refactor

Conversation

@olszomal

@olszomal olszomal commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Type

  • Bug fix
  • New feature
  • Code style / formatting / renaming
  • Refactoring (no functional or API changes)
  • Build / CI related changes
  • Documentation
  • Other (please describe):

Related Issue

Issue number: N/A

Current Behavior

Provider helper functions are not grouped consistently, and provider algorithms are advertised with fips=yes.

New Behavior

Provider helper functions are reorganized for clarity.
The fips=yes property is removed, since FIPS approval depends on the PKCS#11 module, token, and operation parameters.

Scope of Changes

  • Reorganize provider helper functions.
  • Remove fips=yes from provider algorithm definitions.
  • Load OpenSSL settings in the duplicate EC key test.

Testing

  • Existing tests
  • New tests added
  • Manual testing

Additional Notes

License Declaration

  • I hereby agree to license my contribution under the project's license.

Whether a PKCS#11 operation is FIPS approved depends
on the underlying PKCS#11 module, token, and operation
parameters, which the provider cannot generally guarantee.
@mtrojnar

mtrojnar commented Sep 4, 2026

Copy link
Copy Markdown
Member

Behavioral changes worth mentioning in the PR description

Although primarily a reorganization, the final commit includes functional changes:

  • src/provider_helpers.c:2938-2969, 3717-3745, and 4127-4149 now apply parameters supplied during signature, asymmetric-cipher, and key-exchange initialization; the previous helpers ignored some initialization parameters.
  • src/provider_helpers.c:2450-2486 replaces permissive atoi()-style PSS salt-length parsing with validated numeric parsing.
  • src/provider_helpers.c:3130, 3384, 3429, and 3444 initialize *siglen from the output capacity before calling the PKCS#11 signing layer.

These appear beneficial, but mean the change is not strictly behavior-neutral. They would be worth documenting and possibly also covering with focused tests.

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