-
Notifications
You must be signed in to change notification settings - Fork 168
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
Better support for generic PKEYs #119
Commits on Mar 23, 2017
-
pkey: avoid unnecessary cache of rb_intern()
rb_intern() with a string literal caches the result. This is unnecessary for init functions.
Configuration menu - View commit details
-
Copy full SHA for 7eff12d - Browse repository at this point
Copy the full SHA 7eff12dView commit details -
pkey: assume generic PKey types contain private components
The EVP interface cannot tell whether if a pkey contains the private components or not. Assume it has, if the object does not respond to 'private?'.
Configuration menu - View commit details
-
Copy full SHA for d1e2932 - Browse repository at this point
Copy the full SHA d1e2932View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 860ebe6 - Browse repository at this point
Copy the full SHA 860ebe6View commit details -
pkey: remove {rsa,dsa,dh,ec}_instance()
Merge the code into the callers. They are used only once or twice. In fact, they are inconsistent and not useful - they are expected to return Qfalse on failure, but actually also raise NoMemoryError if a Ruby object allocation fails. This potentially causes memory leaks.
Configuration menu - View commit details
-
Copy full SHA for 0342c79 - Browse repository at this point
Copy the full SHA 0342c79View commit details -
pkey: add support for PKCS ruby#8 key serialization
OpenSSL::PKey::PKey#private_to_der, #private_to_pem are added to the generic PKey class. They serialize the private key to PKCS ruby#8 {Encrypted,}PrivateKeyInfo format, in DER- and PEM- encoding, respectively. For symmetry, also add #public_to_der and #public_to_pem that serialize the public key into X.509 SubjectPublicKeyInfo format. OpenSSL::PKey.read now reads DER-encoded PKCS ruby#8 keys as well as the "raw" private keys. PEM-encoded PKCS ruby#8 keys have been already handled by PEM_read_bio_PrivateKey().
Configuration menu - View commit details
-
Copy full SHA for 4ce54a5 - Browse repository at this point
Copy the full SHA 4ce54a5View commit details -
pkey: parse PEM-encoded DHParameter format
Try PEM_read_bio_Parameters() in OpenSSL::PKey.read.
Configuration menu - View commit details
-
Copy full SHA for 3322537 - Browse repository at this point
Copy the full SHA 3322537View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d3130e - Browse repository at this point
Copy the full SHA 0d3130eView commit details -
pkey: refactor reading PEM or DER encoded keys code
Let each class' initialize method use the same code as OpenSSL::PKey.read for loading a key from String.
Configuration menu - View commit details
-
Copy full SHA for c5a46d1 - Browse repository at this point
Copy the full SHA c5a46d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9527641 - Browse repository at this point
Copy the full SHA 9527641View commit details -
pkey: add OpenSSL::PKey::PKey#derive
Add OpenSSL::PKey::PKey#derive as the wrapper for EVP_PKEY_CTX_derive(). This is useful for pkey types that we don't have dedicated classes, such as X25519.
Configuration menu - View commit details
-
Copy full SHA for f8ecd42 - Browse repository at this point
Copy the full SHA f8ecd42View commit details -
pkey: implement DH#compute_key and EC#dh_compute_key in Ruby
Use the new OpenSSL::PKey::PKey#derive instead of the raw {EC,}DH_compute_key(), mainly to reduce amount of the C code.
Configuration menu - View commit details
-
Copy full SHA for 9516f9b - Browse repository at this point
Copy the full SHA 9516f9bView commit details -
pkey: add OpenSSL::PKey::PKey.generate_parameters and .generate_key
Add two methods to create a PKey using the EVP interface. This can be useful for PKey types we don't have a dedicated class.
Configuration menu - View commit details
-
Copy full SHA for 07653ef - Browse repository at this point
Copy the full SHA 07653efView commit details