summaryrefslogtreecommitdiffstats
path: root/engines/e_capi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Stop raising ERR_R_MALLOC_FAILURE in most placesRichard Levitte2022-10-051-61/+65
| | | | | | | | | | | | | | | | | | | | | | | Since OPENSSL_malloc() and friends report ERR_R_MALLOC_FAILURE, and at least handle the file name and line number they are called from, there's no need to report ERR_R_MALLOC_FAILURE where they are called directly, or when SSLfatal() and RLAYERfatal() is used, the reason `ERR_R_MALLOC_FAILURE` is changed to `ERR_R_CRYPTO_LIB`. There were a number of places where `ERR_R_MALLOC_FAILURE` was reported even though it was a function from a different sub-system that was called. Those places are changed to report ERR_R_{lib}_LIB, where {lib} is the name of that sub-system. Some of them are tricky to get right, as we have a lot of functions that belong in the ASN1 sub-system, and all the `sk_` calls or from the CRYPTO sub-system. Some extra adaptation was necessary where there were custom OPENSSL_malloc() wrappers, and some bugs are fixed alongside these changes. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19301)
* fix some code with obvious wrong coding stylex20182021-10-281-2/+2
| | | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16918)
* Update copyright yearMatt Caswell2021-05-201-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15381)
* Add bounds checking to length returned by wcslen in wide_to_asc conversion ↵Jake Cooke2021-05-191-1/+10
| | | | | | | | | to resolve integer overflow flaw Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15316)
* Don't clear the whole error stack when loading enginesMatt Caswell2020-11-061-1/+11
| | | | | | | | | | | | | Loading the various built-in engines was unconditionally clearing the whole error stack. During config file processing processing a .include directive which fails results in errors being added to the stack - but we carry on anyway. These errors were then later being removed by the engine loading code, meaning that problems with the .include directive never get shown. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13311)
* Fix safestack issues in x509.hMatt Caswell2020-09-131-3/+0
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
* engines: fixed to work with EVP_*_meth calls deprecatedPauli2020-07-221-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11082)
* deprecate enginesPauli2020-07-161-0/+3
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12226)
* Update copyright yearMatt Caswell2020-05-151-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11839)
* In OpenSSL builds, declare STACK for datatypes ...Rich Salz2020-04-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | ... and only *define* them in the source files that need them. Use DEFINE_OR_DECLARE which is set appropriately for internal builds and not non-deprecated builds. Deprecate stack-of-block Better documentation Move some ASN1 struct typedefs to types.h Update ParseC to handle this. Most of all, ParseC needed to be more consistent. The handlers are "recursive", in so far that they are called again and again until they terminate, which depends entirely on what the "massager" returns. There's a comment at the beginning of ParseC that explains how that works. {Richard Levtte} Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10669)
* Explicitly test against NULL; do not use !p or similarRich Salz2019-10-091-3/+4
| | | | | | | | Also added blanks lines after declarations in a couple of places. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9916)
* Following the license change, modify the boilerplates in engines/Richard Levitte2018-12-061-1/+1
| | | | | | | [skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7832)
* CAPI engine: add support for RSA_NO_PADDINGRichard Levitte2018-09-111-7/+21
| | | | | | | | | | | Since the SSL code started using RSA_NO_PADDING, the CAPI engine became unusable. This change fixes that. Fixes #7131 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7174)
* Update copyright yearMatt Caswell2018-05-011-1/+1
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6145)
* Fix mixed indentation (and other whitespace issues)Dr. Matthias St. Pierre2018-04-261-7/+9
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6094)
* engines/e_capi.c: slip in PROV_RSA_AES for interchangable CSP only.Andy Polyakov2017-03-291-12/+15
| | | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3034)
* engines/e_capi.c: adhere to CryptAcquireContextW unconditionally.Andy Polyakov2017-03-291-47/+27
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* engine/e_capi.c: more formatting and styling fixes.Andy Polyakov2017-03-291-31/+31
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* engines/e_capi.c: formatting and styling fixes.Andy Polyakov2017-03-251-70/+59
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* include/openssl: don't include <windows.h> in public headers.Andy Polyakov2016-07-081-17/+16
| | | | | | | | | | | If application uses any of Windows-specific interfaces, make it application developer's respondibility to include <windows.h>. Rationale is that <windows.h> is quite "toxic" and is sensitive to inclusion order (most notably in relation to <winsock2.h>). It's only natural to give complete control to the application developer. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* engines/e_capi.c: accommodate recent DSA_SIG_[get|set]0 changes.Andy Polyakov2016-06-271-9/+9
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add some check for malloc failure in the CAPI engineMatt Caswell2016-05-181-6/+26
| | | | | | | | In the CAPI engine there were some unchecked calls to OPENSSL_strdup(). GH Issue #830 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation 02/10Rich Salz2016-05-171-49/+5
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix capi engine for no-dsaMatt Caswell2016-04-221-0/+22
| | | | | | | The capi engine was failing to compile on Windows if the no-dsa option was selected. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename internal symbol to follow internal naming patternRichard Levitte2016-04-131-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Rename int_*() functions to *_int()Matt Caswell2016-04-131-3/+3
| | | | | | | | | | There is a preference for suffixes to indicate that a function is internal rather than prefixes. Note: the suffix is only required to disambiguate internal functions and public symbols with the same name (but different case) Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename lots of *_intern or *_internal function to int_*Matt Caswell2016-04-131-4/+4
| | | | | | | | There was a lot of naming inconsistency, so we try and standardise on one form. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix forgotten adaptation to opaque RSA and RSA_METHODRichard Levitte2016-04-071-32/+48
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Rename get/set_app_data to get0/set0_app_dataMatt Caswell2016-04-031-3/+3
| | | | | | | Also fixed a style issue Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* Various DSA opacity fixupsMatt Caswell2016-04-031-6/+10
| | | | | | | Numerous fixups based on feedback of the DSA opacity changes. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* Make DSA_METHOD opaqueMatt Caswell2016-04-031-29/+26
| | | | | | | | Move the dsa_method structure out of the public header file, and provide getter and setter functions for creating and modifying custom DSA_METHODs. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* Adapt e_capi to the DSA_SIG_get0() APIRichard Levitte2016-03-081-6/+4
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Test for and use AES CSP for RSA if present.Dr Stephen Henson2016-02-111-2/+22
| | | | | | | Some keys are attached to the full RSA CSP which doesn't support SHA2 algorithms: uses the AES CSP if present. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Auto init/deinit libcryptoMatt Caswell2016-02-091-2/+5
| | | | | | | This builds on the previous commit to auto initialise/deinitialise libcrypto. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | 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>
* Rename some BUF_xxx to OPENSSL_xxxRich Salz2015-12-161-3/+3
| | | | | | | | | Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Remove RSA_FLAG_SIGN_VER flag.Dr. Stephen Henson2015-12-021-1/+1
| | | | | | | | Remove RSA_FLAG_SIGN_VER: this was origininally used to retain binary compatibility after RSA_METHOD was extended to include rsa_sign and rsa_verify fields. It is no longer needed. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Continue malloc standardisation in enginesMatt Caswell2015-11-091-11/+12
| | | | | | Continuing from previous work standardise use of malloc in the engine code. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Replace "SSLeay" in API with OpenSSLRich Salz2015-10-301-1/+1
| | | | | | | All instances of SSLeay (any combination of case) were replaced with the case-equivalent OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
* engine/e_capi.c: fix various warnings.Andy Polyakov2015-09-291-16/+22
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* remove 0 assignments.Rich Salz2015-09-031-6/+1
| | | | | | | After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Use p==NULL not !p (in if statements, mainly)Rich Salz2015-05-111-3/+3
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Use safer sizeof variant in mallocRich Salz2015-05-041-4/+4
| | | | | | | | | | | | | 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>
* free null cleanup finaleRich Salz2015-05-011-32/+16
| | | | | | Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanupRich Salz2015-03-251-4/+2
| | | | | | | | Start ensuring all OpenSSL "free" routines allow NULL, and remove any if check before calling them. This gets DH_free, DSA_free, RSA_free Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove X509_PAIRRich Salz2015-02-061-1/+0
| | | | | | Unused type; a pair X509 certificates. Intended for LDAP support. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-221-1757/+1680
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* For master windows build dsa.h is now needed.Dr. Stephen Henson2015-01-131-0/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* capi_ctrl, capi_vtrace: check for NULL after allocating and free itKurt Roeckx2014-12-101-0/+11
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* capi_get_provname: Check return valuesKurt Roeckx2014-12-041-6/+12
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>