-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Description
Remove ENGINE initialization from provider startup
Issue Summary
Remove ENGINE initialization during provider initialization. Provider code must not depend on ENGINE registration.
Problem Description
The current GOST provider implementation creates and populates an internal ENGINE instance during provider startup in provider_ctx_new(). This ENGINE is used as a bridge to access legacy cryptographic implementations, but it creates unnecessary dependencies and complexity.
With the migration to direct provider-native implementations for ciphers, digests, and MACs (issues #116 and #117), the ENGINE layer becomes obsolete and should be removed entirely.
Current Implementation
PROV_CTXstructure containsENGINE *efieldprovider_ctx_new()createsENGINE_new()and callspopulate_gost_engine(ctx->e)populate_gost_engine()ingost_eng.cregisters all ENGINE methods (digests, ciphers, pkey methods, etc.)provider_ctx_free()callsENGINE_free(ctx->e)
Required Changes
1. Remove ENGINE field from PROV_CTX
- Remove
ENGINE *e;fromstruct provider_ctx_stingost_prov.h - Update all code that accesses
ctx->e
2. Simplify provider context creation
- Remove ENGINE creation and population from
provider_ctx_new() - Remove
populate_gost_engine()call - Simplify error handling in context creation
3. Update provider context cleanup
- Remove
ENGINE_free(ctx->e)fromprovider_ctx_free()
4. Preserve necessary initialization from populate_gost_engine
- Move
create_NIDs()call to provider initialization (NID creation is still needed for algorithm identification) - Evaluate if ENGINE control function (
gost_control_func) needs to be preserved for provider parameter configuration
5. Remove ENGINE dependencies
- Ensure no remaining code depends on the ENGINE instance
- After cipher/digest/MAC refactoring (ASan tests for Travis-CI #116, travis: Enable ASan build #117), ENGINE should not be needed
Files to Modify
gost_prov.h: Remove ENGINE field from PROV_CTXgost_prov.c: Update context creation and cleanup, add NID initializationgost_eng.c: Extractcreate_NIDs()function for provider use
Dependencies
This task depends on completion of:
- ASan tests for Travis-CI #116: Decouple cipher provider logic from EVP_CIPHER* APIs
- travis: Enable ASan build #117: Decouple digest and MAC provider logic from EVP_MD* APIs
Acceptance Criteria
- Provider initializes without creating ENGINE instance
- PROV_CTX no longer contains ENGINE pointer
- All cryptographic operations work through direct provider implementations
- NID creation happens during provider initialization
Metadata
Metadata
Assignees
Labels
No labels