Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: revert to C implementation of OpenSSL::Config #342

Merged
merged 6 commits into from
May 13, 2020

Conversation

rhenium
Copy link
Member

@rhenium rhenium commented Feb 19, 2020

  config: remove deprecated methods
  test/openssl/test_config: add missing test case for Config.parse_config
  config: revert to C implementation of OpenSSL::Config
  config: replace DupConfigPtr() with GetConfig()

config: remove deprecated methods

Remove 4 deprecated methods.

The following two methods have been marked as deprecated since 2003,
by r4531 (ruby.git commit 78ff3833fb67c8005a9b851037e74b3eea940aa3).

  • OpenSSL::Config#value
  • OpenSSL::Config#section

Other two methods are removed because the corresponding functions
disappeared in OpenSSL 1.1.0.

  • OpenSSL::Config#add_value
  • OpenSSL::Config#[]=

test/openssl/test_config: add missing test case for Config.parse_config


config: revert to C implementation of OpenSSL::Config

Revert OpenSSL::Config to using the OpenSSL API and remove our own
parser implementation for the config file syntax.

OpenSSL::Config now wraps a CONF object.

This work is based on the old C code we used before 2010.


config: replace DupConfigPtr() with GetConfig()

Now that OpenSSL::Config wraps a real CONF object, the caller can just
borrow it rather than creating a new temporary CONF object.

DupConfigPtr() is now removed, and GetConfig() is exported instead.


[No History.md changes yet because this is targeting post-2.2; I don't want to deal with merge conflicts.]

Closes: #340

@rhenium rhenium added this to the v3.0.0 milestone Feb 19, 2020
@rhenium rhenium force-pushed the ky/config-use-openssl-api branch 3 times, most recently from 2371a78 to 8e9ef18 Compare April 22, 2020 12:52
Remove 4 deprecated methods.

The following two methods have been marked as deprecated since 2003,
by r4531 (ruby.git commit 78ff3833fb67c8005a9b851037e74b3eea940aa3).

 - OpenSSL::Config#value
 - OpenSSL::Config#section

Other two methods are removed because the corresponding functions
disappeared in OpenSSL 1.1.0.

 - OpenSSL::Config#add_value
 - OpenSSL::Config#[]=
Sort keys of a section before comparing. The ordering is not part of the
API. This can cause a test failure if we use OpenSSL's C implementation.

Fixes: 2ad65b5 ("config: support .include directive", 2018-08-16)
LibreSSL has removed the feature to map environment variables onto the
"ENV" section.
Revert OpenSSL::Config to using the OpenSSL API and remove our own
parser implementation for the config file syntax.

OpenSSL::Config now wraps a CONF object. Accessor methods deal with the
object directly rather than Ruby-level internal state.

This work is based on the old C code we used before 2010.
Now that OpenSSL::Config wraps a real CONF object, the caller can just
borrow it rather than creating a new temporary CONF object. CONF object
is usually treated as immutable.

DupConfigPtr() is now removed, and GetConfig() is exported instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Revert OpenSSL::Config to using OpenSSL API
1 participant