summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/cryptlib.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-26Recent discussions about abort() potentially leaving key material inderaadt1-5/+8
core files (which can depend upon various file layouts) have resonated with my hate for this function outside a purely debugging context. I also dislike how the report goes to stderr which may get lost or ignored. Increase the noise (with syslog_r) and use _exit(1) to gaurantee termination. ok jsing
2018-11-24Store and return the locking callbacks, restoring previous behaviour.jsing1-6/+12
The previous code meant that a caller could set the locking callback, after which CRYPTO_get_locking_callback() would return non-NULL. Some existing code depends on this behaviour, specifically to identify if lock handling has been configured. As such, always returning NULL from CRYPTO_get_locking_callback() can result in unexpected application behaviour. ok bcook@
2018-11-11Add back a few missing compatibility stubsbcook1-1/+36
ok beck@
2018-11-11Add automatic threading initialization for libcrypto.bcook1-415/+54
This implements automatic thread support initialization in libcrypto. This does not remove any functions from the ABI, but does turn them into no-ops. Stub implementations of pthread_mutex_(init|lock|unlock) are provided for ramdisks. This does not implement the new OpenSSL 1.1 thread API internally, keeping the original CRYTPO_lock / CRYPTO_add_lock functions for library locking. For -portable, crypto_lock.c can be reimplemented with OS-specific primitives as needed. ok beck@, tb@, looks sane guenther@
2017-04-29Stop calling OPENSSL_init() internally, since it is a no-op. Also placejsing1-2/+1
it under #ifndef LIBRESSL_INTERNAL. ok beck@
2017-01-29Send the function codes from the error functions to the bit bucket,beck1-11/+7
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
2016-11-04Replace all uses of magic numbers when operating on OPENSSL_ia32_P[] bymiod1-22/+5
meaningful constants in a private header file, so that reviewers can actually get a chance to figure out what the code is attempting to do without knowing all cpuid bits. While there, turn it from an array of two 32-bit ints into a properly aligned 64-bit int. Use of OPENSSL_ia32_P is now restricted to the assembler parts. C code will now always use OPENSSL_cpu_caps() and check for the proper bits in the whole 64-bit word it returns. i386 tests and ok jsing@
2016-11-04Remove I386_ONLY define. It was only used to prefer amiod1-2/+2
faster-on-genuine-80386-but-slower-on-80486-onwards innstruction sequence in the SHA512 code, and had not been enabled in years, if at all. ok tom@ bcook@
2015-09-13Since a major bump of libcrypto is coming, remove OPENSSL_ia32cap andmiod1-13/+1
OPENSSL_ia32cap_loc; nothing in ports uses them besides embedded copies of OpenSSL. This opens the `all hell gets loose' window.
2015-09-13Add a new interface, OPENSSL_cpu_caps(), to return the currently runningmiod1-1/+13
cpu's specific hardware capabilities users of libcrypto might be interested in, as an integer value. This deprecates the existing OPENSSL_ia32cap() macro and the OPENSSL_ia32cap_loc() function (which returns the pointer so that you can mess with stuff you shouldn't mess with). Interpreting the value returned by OPENSSL_cpu_caps() is, of course, machine-dependent. Minor version bump for libcrypto. ok beck@ jsing@
2015-06-27Fix pointer to unsigned long conversion.doug1-3/+5
bcook@ notes that this check really only impacted 64-bit Windows. Also, changed the check to be unsigned for consistency. ok bcook@
2015-01-22Assume that the size of a pointer will not change at runtime.bcook1-28/+15
Change the runtime check for whether a long is smaller than a pointer to a compile-time check. Replace the silly hash for LLP64 platforms. ok tedu@
2014-07-22Kill a bunch more BUF_strdup's - these are converted to have a check forbeck1-2/+2
NULL before an intrinsic strdup. ok miod@
2014-07-11Only import cryptlib.h in the four source files that actually need it.jsing1-2/+5
Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
2014-07-10Explicitly include <openssl/opensslconf.h> in every file that referencesjsing1-1/+3
an OPENSSL_NO_* define. This avoids relying on something else pulling it in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is never going to do anything, since OPENSSL_NO_XYZ will never defined, due to the fact that opensslconf.h has not been included. This also includes some miscellaneous sorting/tidying of headers.
2014-07-10OPENSSL_stderr() is unused so nuke it. OPENSSL_showfatal() is only used byjsing1-9/+2
OpenSSLDie(), which is in the same file, so just make it static. ok miod@
2014-07-10Nuke OPENSSL_NONPIC_relocated since nothing uses it.jsing1-2/+1
ok miod@
2014-07-10Stop including standard headers via cryptlib.h - pull in the headers thatjsing1-1/+4
are needed in the source files that actually require them. ok beck@ miod@
2014-06-20Remove the OPENSSL_*cap getenv's. A program should not be able toderaadt1-11/+3
change the behaviour of the library in such a complicated fashion. ok miod
2014-06-12tags as requested by miod and teduderaadt1-1/+1
2014-05-31annoying whitespacederaadt1-3/+3
2014-05-25remove OPENSSL_isservice. not used internally, no sane posix software willtedu1-6/+0
call it, and windows service software can figure this out on its own. ok beck miod
2014-04-21modernize malloc callderaadt1-1/+1
2014-04-20More KNF.jsing1-50/+62
2014-04-17kill REF_PRINT/REF_CHECK debugging framework noone would usederaadt1-6/+0
ok miod
2014-04-17some KNF cleanup following the scriptderaadt1-25/+21
2014-04-17Change library to use intrinsic memory allocation functions instead ofbeck1-5/+5
OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
2014-04-16Remove non-posix support. Why is OPENSSL_isservice even here?tedu1-229/+0
Is this a crypto library or a generic platform abstraction library? "A hack to make Visual C++ 5.0 work correctly" ... time to upgrade.
2014-04-15First pass at applying KNF to the OpenSSL code, which almost makes itjsing1-396/+424
readable. This pass is whitespace only and can readily be verified using tr and md5.
2014-04-13Remove some stuff that isn't needed.beck1-7/+7
ok miod@ deraadt@
2014-04-13Merge conflicts; remove MacOS, Netware, OS/2, VMS and Windows build machinery.miod1-2/+16
2012-10-13resolve conflictsdjm1-6/+34
2011-11-03openssl-1.0.0e: resolve conflictsdjm1-10/+11
2010-10-01resolve conflicts, fix local changesdjm1-78/+430
2009-01-09resolve conflictsdjm1-282/+69
2008-09-06resolve conflictsdjm1-106/+120
2006-06-27resolve conflictsdjm1-53/+165
2005-04-29resolve conflictsdjm1-6/+124
2003-05-12merge 0.9.7b with local changes; crank majors for libssl/libcryptomarkus1-10/+30
2002-05-15OpenSSL 0.9.7 stable 2002 05 08 mergebeck1-7/+12
2001-08-01merge openssl 0.9.6b-enginebeck1-6/+4
Note that this is a maintenence release, API's appear *not* to have changed. As such, I have only increased the minor number on these libraries
2000-12-15openssl-engine-0.9.6 mergebeck1-6/+195
2000-03-19OpenSSL 0.9.5 mergebeck1-2/+4
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
1999-09-29OpenSSL 0.9.4 mergebeck1-46/+39
1998-10-05Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD buildryker1-0/+307
functionality for shared libs. Note that routines such as sslv2_init and friends that use RSA will not work due to lack of RSA in this library. Needs documentation and help from ports for easy upgrade to full functionality where legally possible.