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

pkey: refactor PEM/DER serialization code #328

Merged
merged 6 commits into from
May 13, 2020

Commits on May 13, 2020

  1. pkey: simplify ossl_pkey_new()

    ossl_{rsa,dsa,dh,ec}_new() called from this function are not used
    anywhere else. Inline them into pkey_new0() and reduce code
    duplication.
    rhenium committed May 13, 2020
    Configuration menu
    Copy the full SHA
    94aeab2 View commit details
    Browse the repository at this point in the history
  2. pkey: inline {rsa,dsa,dh,ec}_instance()

    Merge the code into the callers so that the wrapping Ruby object is
    allocated before the raw key object is allocated. This prevents possible
    memory leak on Ruby object allocation failure, and also reduces the
    lines of code.
    rhenium committed May 13, 2020
    Configuration menu
    Copy the full SHA
    1eb1366 View commit details
    Browse the repository at this point in the history
  3. pkey: have PKey.read parse PEM-encoded DHParameter

    Try PEM_read_bio_Parameters(). Only PEM format is supported at the
    moment since corresponding d2i_* functions are not provided by OpenSSL.
    rhenium committed May 13, 2020
    Configuration menu
    Copy the full SHA
    867e5c0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cf92a3f View commit details
    Browse the repository at this point in the history
  5. pkey: refactor DER/PEM-encoded string parsing code

    Export the flow used by OpenSSL::PKey.read and let the subclasses call
    it before attempting other formats.
    rhenium committed May 13, 2020
    Configuration menu
    Copy the full SHA
    d963d4e View commit details
    Browse the repository at this point in the history
  6. pkey: refactor #export/#to_pem and #to_der

    Add ossl_pkey_export_traditional() and ossl_pkey_export_spki() helper
    functions, and use them. This reduces code duplication.
    rhenium committed May 13, 2020
    Configuration menu
    Copy the full SHA
    56f0d34 View commit details
    Browse the repository at this point in the history