summaryrefslogtreecommitdiffstats
path: root/crypto/evp/p_lib.c
AgeCommit message (Collapse)Author
2017-10-18Remove parentheses of return.KaoruToda
Since return is inconsistent, I removed unnecessary parentheses and unified them. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4541)
2017-10-12Add EVP_PKEY_set1_engine() function.Dr. Stephen Henson
Add an ENGINE to EVP_PKEY structure which can be used for cryptographic operations: this will typically be used by an HSM key to redirect calls to a custom EVP_PKEY_METHOD. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4503)
2017-08-30Move the REF_PRINT support from e_os.h to internal/refcount.h.Pauli
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
2017-08-30e_os.h removal from other headers and source files.Pauli
Removed e_os.h from all bar three headers (apps/apps.h crypto/bio/bio_lcl.h and ssl/ssl_locl.h). Added e_os.h into the files that need it now. Directly reference internal/nelem.h when required. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
2017-02-01Add support for parameterized SipHashTodd Short
The core SipHash supports either 8 or 16-byte output and a configurable number of rounds. The default behavior, as added to EVP, is to use 16-byte output and 2,4 rounds, which matches the behavior of most implementations. There is an EVP_PKEY_CTRL that can control the output size. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2216)
2017-01-24Add support for Poly1305 in EVP_PKEYTodd Short
Add Poly1305 as a "signed" digest. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2128)
2016-11-17Add support for reference counting using C11 atomicsKurt Roeckx
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1500
2016-09-07GH1537: Avoid double-free in the EVP_PKEY APIAlex Gaynor
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-17Convert X509* functions to use const gettersDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-08-13Add point ctrls to X25519Dr. Stephen Henson
Add ctrl operations to set or retrieve encoded point in EVP_PKEY structures containing X25519 keys. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-16Add EVP_PKEY_get0_hmac() functionNathaniel McCallum
Before the addition of this function, it was impossible to read the symmetric key from an EVP_PKEY_HMAC type EVP_PKEY. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1217)
2016-05-31Parameter copy sanity checks.Dr. Stephen Henson
Don't copy parameters is they're already present in the destination. Return error if an attempt is made to copy different parameters to destination. Update documentation. If key type is not initialised return missing parameters RT#4149 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-17Copyright consolidation 04/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-16Unify <TYPE>_up_ref methods signature and behaviour.FdaSilvaYY
Add a status return value instead of void. Add some sanity checks on reference counter value. Update the docs. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-20Remove #error from include files.Rich Salz
Don't have #error statements in header files, but instead wrap the contents of that file in #ifndef OPENSSL_NO_xxx This means it is now always safe to include the header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-08Convert CRYPTO_LOCK_EVP_PKEY to new multi-threading APIAlessandro Ghedini
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-25GH715: ENGINE_finish can take NULLRich Salz
Simplifies calling code. Also fixed up any !ptr tests that were nearby, turning them into NULL tests. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-22GH678: Add a few more zallocFdaSilvaYY
Remove some duplicated NULL/zero init. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-11Move to REF_DEBUG, for consistency.Rich Salz
Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT This is also RT 4181 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-20make EVP_PKEY opaqueDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-14Add EVP_PKEY_get0_* functions.Dr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-14Extend EVP_PKEY_copy_parameters()Dr. Stephen Henson
Make EVP_PKEY_copy_parameters() work if the destination has no type (e.g. if obtained from EVP_PKEY_new()) or the underlying key is NULL. This is useful where we want to copy the parameters from an existing key to a new key. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-09-10RT3754: check for NULL pointerEmilia Kasper
Fix both the caller to error out on malloc failure, as well as the eventual callee to handle a NULL gracefully. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte
There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-04Use safer sizeof variant in mallocRich Salz
For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-30free NULL cleanup 5aRich Salz
Don't check for NULL before calling a free routine. This gets X509_.*free: x509_name_ex_free X509_policy_tree_free X509_VERIFY_PARAM_free X509_STORE_free X509_STORE_CTX_free X509_PKEY_free X509_OBJECT_free_contents X509_LOOKUP_free X509_INFO_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-28remove malloc castsRich Salz
Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-30Remove unnecessary asn1_mac.h includes.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-03-28free NULL cleanupRich Salz
EVP_.*free; this gets: EVP_CIPHER_CTX_free EVP_PKEY_CTX_free EVP_PKEY_asn1_free EVP_PKEY_asn1_set_free EVP_PKEY_free EVP_PKEY_free_it EVP_PKEY_meth_free; and also EVP_CIPHER_CTX_cleanup Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-03-24Move some ASN.1 internals to asn1_int.hDr. Stephen Henson
Move ASN.1 internals used across multiple directories into new internal header file asn1_int.h remove crypto/Makefile hack which allowed other directories to include "asn1_locl.h" Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-03-28Add functions returning security bits.Dr. Stephen Henson
Add functions to return the "bits of security" for various public key algorithms. Based on SP800-57.
2012-04-18recognise X9.42 DH certificates on serversDr. Stephen Henson
2010-11-30PR: 2385Dr. Stephen Henson
Submitted by: Stefan Birrer <stefan.birrer@adnovum.ch> Reviewed by: steve Zero key->pkey.ptr after it is freed so the structure can be reused.
2009-11-12set engine to NULL after releasing itDr. Stephen Henson
2006-07-04Typos(?) in HEAD/crypto/evp/p_lib.c.Andy Polyakov
2006-07-02Make return value from EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters() consistent.Dr. Stephen Henson
2006-06-05Complete EVP_PKEY_ASN1_METHOD ENGINE support.Dr. Stephen Henson
2006-05-11New functions to get key types without dereferncing EVP_PKEY.Dr. Stephen Henson
More error checking for RSA pmeth.
2006-05-07Add support for default public key digest type ctrl.Dr. Stephen Henson
2006-04-28Update EVP_PKEY_cmp() and X509_check_private() to return sensible values andDr. Stephen Henson
handle unsupported key types.
2006-04-05Last arg to EVP_PKEY_assign() should be void *.Dr. Stephen Henson
2006-03-24Initial support for generalized public key parameters.Dr. Stephen Henson
2006-03-22Make EVP_PKEY_ASN1_METHOD opaque. Add application level functions toDr. Stephen Henson
initialize it. Initial support for application added public key ASN1.
2006-03-22Gather printing routines into EVP_PKEY_ASN1_METHOD.Dr. Stephen Henson
2006-03-20Transfer parameter handling and key comparison to algorithm methods.Dr. Stephen Henson
2005-07-16makeNils Larsch
./configure no-deprecated [no-dsa] [no-dh] [no-ec] [no-rsa] make depend all test work again PR: 1159
2005-05-16ecc api cleanup; summary:Nils Larsch
- hide the EC_KEY structure definition in ec_lcl.c + add some functions to use/access the EC_KEY fields - change the way how method specific data (ecdsa/ecdh) is attached to a EC_KEY - add ECDSA_sign_ex and ECDSA_do_sign_ex functions with additional parameters for pre-computed values - rebuild libeay.num from 0.9.7
2005-05-15Make -CSP option work again in pkcs12 utility by checking forDr. Stephen Henson
attribute in EVP_PKEY structure.