aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/err
Commit message (Collapse)AuthorAgeFilesLines
* In UI_OpenSSL's open(), generate an error on unknown errnoRichard Levitte2016-12-081-0/+1
| | | | | | | | | TTY_get() sometimes surprises us with new errno values to determine if we have a controling terminal or not. This generated error is a helpful tool to figure out that this was what happened and what the unknown value is. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2043)
* Ensure we handle len == 0 in ERR_err_string_nMatt Caswell2016-10-151-0/+3
| | | | | | | | | | | | If len == 0 in a call to ERR_error_string_n() then we can read beyond the end of the buffer. Really applications should not be calling this function with len == 0, but we shouldn't be letting it through either! Thanks to Agostino Sarubbo for reporting this issue. Agostino's blog on this issue is available here: https://blogs.gentoo.org/ago/2016/10/14/openssl-libcrypto-stack-based-buffer-overflow-in-err_error_string_n-err-c/ Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix mem leaks during auto-deinitMatt Caswell2016-09-081-0/+1
| | | | | | | | | | | | | | Certain functions are automatically called during auto-deinit in order to deallocate resources. However, if we have never entered a function which marks lib crypto as inited then they never get called. This can happen if the user only ever makes use of a small sub-set of functions that don't hit the auto-init code. This commit ensures all such resources deallocated by these functions also init libcrypto when they are initially allocated. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Ben Laurie <ben@openssl.org>
* Remove get_hash completelyRich Salz2016-08-041-24/+9
| | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1389)
* Remove "lockit" from internal error-hash functionRich Salz2016-08-041-22/+7
| | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1389)
* Check for errors allocating the error strings.Kurt Roeckx2016-07-202-37/+45
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #1330
* Change all our uses of CRYPTO_THREAD_run_once to use RUN_ONCE insteadRichard Levitte2016-07-191-12/+27
| | | | | | | That way, we have a way to check if the init function was successful or not. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* GH1278: Removed error code for alertsRich Salz2016-07-081-0/+32
| | | | | | | | Commit aea145e removed some error codes that are generated algorithmically: mapping alerts to error texts. Found by Andreas Karlsson. This restores them, and adds two missing ones. Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix some OPENSSL_API_COMPAT valuesMatt Caswell2016-06-271-1/+1
| | | | | | | There are 3 OPENSSL_API_COMPAT values that are incorrect in the header files, and one inconsistency between the header and the .c Reviewed-by: Richard Levitte <levitte@openssl.org>
* Clean up "generic" intro pod files.Rich Salz2016-06-091-0/+44
| | | | | | | | | | | | Files like dh.pod, etc., mostly duplicated the API-specific pod files. Removed the duplicated content; that often mean the whole file could be removed. Some of the content about internals got moved into README files in the source tree. Some content (e.g., err.pod) got moved into other pod pages. Annotate generic pages, remove dup NAME Reviewed-by: Richard Levitte <levitte@openssl.org>
* Use strerror_r()/strerror_s() instead of strerror() where possibleMatt Caswell2016-05-231-5/+1
| | | | | | | | | The function strerror() is not thread safe. We should use strerror_r() where possible, or strerror_s() on Windows. RT#2267 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove unused error/function codes.Rich Salz2016-05-232-13/+1
| | | | | | | | Add script to find unused err/reason codes Remove unused reason codes. Remove entries for unused functions Reviewed-by: Matt Caswell <matt@openssl.org>
* Cleanup openssl.ecRichard Levitte2016-05-181-2/+1
| | | | | | | | STORE doesn't exist for now HMAC doesn't have any error codes Reviewed-by: Rich Salz <rsalz@openssl.org>
* Copyright consolidation 05/10Rich Salz2016-05-173-215/+18
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fold threads.h into crypto.h making API publicViktor Dukhovni2016-05-162-2/+0
| | | | | | Document thread-safe lock creation Reviewed-by: Richard Levitte <levitte@openssl.org>
* Restore the ERR_remove_thread_state() API and make it a no-opRichard Levitte2016-05-101-2/+7
| | | | | | | | | | | The ERR_remove_thread_state() API is restored to take a pointer argument, but does nothing more. ERR_remove_state() is also made into a no-op. Both functions are deprecated and users are recommended to use OPENSSL_thread_stop() instead. Documentation is changed to reflect this. Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove --classic build entirelyRichard Levitte2016-04-201-43/+0
| | | | | | | | The Unix build was the last to retain the classic build scheme. The new unified scheme has matured enough, even though some details may need polishing. Reviewed-by: Rich Salz <rsalz@openssl.org>
* The err_cleanup() funtion is internal so shouldn't be exportedMatt Caswell2016-04-141-1/+1
| | | | | | | Running a "make update" wanted to add err_cleanup to libcrypto.num which is wrong. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Ensure all locks are properly cleaned upMatt Caswell2016-04-141-2/+7
| | | | | | Some locks were not being properly cleaned up during close down. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Need err_load_crypto_strings_int declared.Rich Salz2016-04-131-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Rename int_*() functions to *_int()Matt Caswell2016-04-132-2/+2
| | | | | | | | | | 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-132-2/+2
| | | | | | | | 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>
* Deprecate ERR_free_strings() and make it a no-opMatt Caswell2016-04-131-2/+2
| | | | | | | | ERR_free_strings() should not be called expicitly - we should leave auto-deinit to clean this up instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix no-ocspMatt Caswell2016-04-061-0/+2
| | | | | | Misc fixes for no-ocsp Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix "no-ui" configurationRichard Levitte2016-03-311-0/+2
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix a big leak when using stack-allocated BIO items.FdaSilvaYY2016-03-291-17/+12
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Move dso.h to internalRich Salz2016-03-232-2/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove the remainder of util/mk1mf.pl and companion scriptsRichard Levitte2016-03-211-3/+0
| | | | | | | This removes all scripts that deal with MINFO as well, since that's only used by mk1mf. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove #error from include files.Rich Salz2016-03-201-24/+8
| | | | | | | | 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>
* Implement support for no-tsRichard Levitte2016-03-181-0/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove the old threading APIMatt Caswell2016-03-091-5/+13
| | | | | | | | | | All OpenSSL code has now been transferred to use the new threading API, so the old one is no longer used and can be removed. We provide some compat macros for removed functions which are all no-ops. There is now no longer a need to set locking callbacks!! Reviewed-by: Richard Levitte <levitte@openssl.org>
* err_lcl.h is gone, don't pretend it's thereRichard Levitte2016-03-091-1/+1
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Convert ERR_STRING_DATA to new multi-threading APIAlessandro Ghedini2016-03-081-22/+39
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Convert ERR_STATE to new multi-threading APIAlessandro Ghedini2016-03-082-168/+32
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add KDF error codesDr. Stephen Henson2016-03-023-0/+4
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Public API for Certificate TransparencyRob Percival2016-02-263-2/+6
| | | | | Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Always build library object files with shared library cflagsRichard Levitte2016-02-201-1/+1
| | | | | | | | | | | | | | | | This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte2016-02-181-1/+1
| | | | | | | | | | All those flags existed because we had all the dependencies versioned in the repository, and wanted to have it be consistent, no matter what the local configuration was. Now that the dependencies are gone from the versioned Makefile.ins, it makes much more sense to use the exact same flags as when compiling the object files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove JPAKERich Salz2016-02-172-7/+0
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Move to REF_DEBUG, for consistency.Rich Salz2016-02-111-14/+11
| | | | | | | Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT This is also RT 4181 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Attempt to log an error if init failedMatt Caswell2016-02-101-0/+1
| | | | | | | | | If init failed we'd like to set an error code to indicate that. But if init failed then when the error system tries to load its strings its going to fail again. We could get into an infinite loop. Therefore we just set a single error the first time around. After that no error is set. Reviewed-by: Rich Salz <rsalz@openssl.org>
* The new init functions can now fail so shouldn't be voidMatt Caswell2016-02-101-1/+2
| | | | | | | The new init functions can fail if the library has already been stopped. We should be able to indicate failure with a 0 return value. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Rename INIT funtions, deprecate old ones.Rich Salz2016-02-101-2/+1
| | | | | | Man, there were a lot of renamings :) Reviewed-by: Richard Levitte <levitte@openssl.org>
* Auto init/deinit libcryptoMatt Caswell2016-02-092-2/+7
| | | | | | | This builds on the previous commit to auto initialise/deinitialise libcrypto. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Use WSAGetLastError() on windowsKurt Roeckx2016-02-041-0/+1
| | | | | | | | Windows doesn't have h_error or hstrerror() Reviewed-by: Richard Levitte <levitte@openssl.org> MR: #1848
* Refactoring BIO: new socket-handling functions, deprecate older onesRichard Levitte2016-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | | Added functions: BIO_socket BIO_connect BIO_listen BIO_accept_ex BIO_closesocket BIO_sock_info These get deprecated: BIO_gethostbyname BIO_get_port BIO_get_host_ip BIO_get_accept_socket BIO_accept Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Refactoring BIO: add error macros & text, and make updateRichard Levitte2016-02-031-0/+2
| | | | Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* unified build scheme: add build.info filesRichard Levitte2016-02-011-0/+3
| | | | | | | | | Now that we have the foundation for the "unified" build scheme in place, we add build.info files. They have been generated from the Makefiles in the same directories. Things that are platform specific will appear in later commits. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Templatize util/domdRich Salz2016-01-291-2/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-263-3/+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>