summaryrefslogtreecommitdiffstats
path: root/crypto/cryptlib.c
AgeCommit message (Collapse)Author
2018-07-25crypto/dllmain.c: remove unused OPENSSL_NONPIC_relocated variable.Andy Polyakov
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/6752)
2018-07-25crypto/cryptlib.c: resolve possible race in OPENSSL_isservice.Andy Polyakov
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/6752)
2018-07-25crypto/cryptlib.c: make OPENSS_cpuid_setup safe to use as constructor.Andy Polyakov
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/6752)
2018-04-03Enabled OneCore Conf for Console Apps (removed nonUniversal API)Pecio
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5625)
2018-02-07Make OPENSSL_rdtsc universally available.Pauli
If such a timer/counter register is not available, the return value is always zero. This matches the assembly implementations' behaviour. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/5231)
2018-01-19Copyright update of more files that have changed this yearRichard Levitte
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/5110)
2018-01-18The Cygwin gcc doesn't define _WIN32, don't pretend it doesRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5060)
2017-11-08OPENSSL_ia32cap: reserve for new extensions.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-09-01crypto/cryptlib.c: mask more capability bits upon FXSR bit flip.Andy Polyakov
OPENSSL_ia32cap.pod discusses possibility to disable operations on XMM register bank. This formally means that this flag has to be checked in combination with other flags. But it customarily isn't. But instead of chasing all the cases we can flip more bits together with FXSR one. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4303)
2017-08-30Move e_os.h to be the very first include.Pauli
cryptilib.h is the second. 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-06-20Modify Sun copyright to follow OpenSSL styleRich Salz
Approved by Oracle. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/3585)
2017-03-19Use memcmp() instead of CRYPTO_memcmp() when fuzzingKurt Roeckx
Reviewed-by: Andy Polyakov <appro@openssl.org> GH: #2633
2017-03-19Make the CRYPTO_memcmp() prototype match memcmp()Kurt Roeckx
Reviewed-by: Andy Polyakov <appro@openssl.org> GH: #2633
2017-03-01Remove some obsolete/obscure internal define switches:Emilia Kasper
- FLAT_INC - PKCS1_CHECK (the SSL_OP_PKCS1_CHECK options have been no-oped) - PKCS_TESTVECT (debugging leftovers) - SSL_AD_MISSING_SRP_USERNAME (unfinished feature) - DTLS_AD_MISSING_HANDSHAKE_MESSAGE (unfinished feature) - USE_OBJ_MAC (note this removes a define from the public header but very unlikely someone would be depending on it) - SSL_FORBID_ENULL Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org>
2017-02-20Revert "Use memcmp() instead of CRYPTO_memcmp() when fuzzing"Kurt Roeckx
This reverts commit 3aad8e18707bccaabee5f111de2db0696b45781c. Reviewed-by: Andy Polyakov <appro@openssl.org> GH: #2686
2017-02-19Use memcmp() instead of CRYPTO_memcmp() when fuzzingKurt Roeckx
Reviewed-by: Andy Polyakov <appro@openssl.org> GH: #2633
2016-06-22crypto/cryptlib.c: omit OPENSSL_ia32cap_loc().Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-19Add assembly CRYPTO_memcmp.Andy Polyakov
GH: #102 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-17Copyright consolidation 07/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-02Remove obsolete defined(__INTEL__) condition.Andy Polyakov
This macro was defined by no-longer-supported __MWERKS__ compiler. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-30Break out DllMain from crypto/cryptlib.c and use it in shared libs onlyRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-08OpenSSLDie --> OPENSSL_dieRich Salz
Also removed a bunch of unused define's from e_os.h Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-14Declare DllMain internallyRichard Levitte
DllMain is a symbol that needs to be global, but no one needs to know. However, some compilers will warn if there isn't a declaration before the function is defined. Just add a declaration before the function definition. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-10Rename INIT funtions, deprecate old ones.Rich Salz
Man, there were a lot of renamings :) Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Provide a thread stop APIMatt Caswell
Add the OPENSSL_INIT_thread_stop() function. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Auto init/deinit libcryptoMatt Caswell
This builds on the previous commit to auto initialise/deinitialise libcrypto. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-01Comment "secure memcmp" implementationDmitry-Me
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-01-30GH102: Extra volatile avoids GCC bugRich Salz
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-01-30GH102: Add volatile to CRYPTO_memcmpRich Salz
Can't hurt and seems to prevent problems from some over-aggressive (LTO?) compilers. 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>
2015-09-29Fix no-stdio buildDavid Woodhouse
Much related/similar work also done by Ivan Nestlerode <ivan.nestlerode@sonos.com> +Replace FILE BIO's with dummy ops that fail. +Include <stdio.h> for sscanf() even with no-stdio (since the declaration is there). We rely on sscanf() to parse the OPENSSL_ia32cap environment variable, since it can be larger than a 'long'. And we don't rely on the availability of strtoull(). +Remove OPENSSL_stderr(); not used. +Make OPENSSL_showfatal() do nothing (currently without stdio there's nothing we can do). +Remove file-based functionality from ssl/. The function prototypes were already gone, but not the functions themselves. +Remove unviable conf functionality via SYS_UEFI +Add fallback definition of BUFSIZ. +Remove functions taking FILE * from header files. +Add missing DECLARE_PEM_write_fp_const +Disable X509_LOOKUP_hash_dir(). X509_LOOKUP_file() was already compiled out, so remove its prototype. +Use OPENSSL_showfatal() in CRYPTO_destroy_dynlockid(). +Eliminate SRP_VBASE_init() and supporting functions. Users will need to build the verifier manually instead. +Eliminate compiler warning for unused do_pk8pkey_fp(). +Disable TEST_ENG_OPENSSL_PKEY. +Disable GOST engine as is uses [f]printf all over the place. +Eliminate compiler warning for unused send_fp_chars(). Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-29Fix pedantic warnings in mingw builds.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-21RT3823: Improve the robustness of event loggingGunnar Kudrjavets
There are a couple of minor fixes here: 1) Handle the case when RegisterEventSource() fails (which it may for various reasons) and do the work of logging the event only if it succeeds. 2) Handle the case when ReportEvent() fails and do our best in debug builds to at least attempt somehow indicate that something has gone wrong. The typical situation would be someone running tools like DbMon, DBWin32, DebugView or just having the debugger attached. The intent is to make sure that at least some data will be captured so that we can save hours and days of debugging time. 3) Minor fix to change the MessageBox() flag to MB_ICONERROR. Though the value of MB_ICONERROR is the same value as MB_ICONSTOP, the intent is better conveyed by using MB_ICONERROR. Testing performed: 1) Clean compilation for debug-VC-WIN32 and VC-WIN32. 2) Good test results (nmake -f ms\ntdll.mak test) for debug-VC-WIN32 and VC-WIN32. 3) Stepped through relevant changes using WinDBG and exercised the impacted code paths. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Matt Caswell <matt@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-14use unit64_t for CPUID and timestamp codeDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-04more OSSL_NELEM casesDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-02RT3820: Don't call GetDesktopWindow()Gilles Khouzam
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-27OPENSSL_NO_XXX cleanup: OPENSSL_NO_BUF_FREELISTSRich Salz
Remove OPENSSL_NO_BUF_FREELISTS. This was turned on by default, so the work here is removing the 'maintain our own freelist' code. Also removed a minor old Windows-multibyte/widechar conversion flag. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22crypto/cryptlib.c: make it indent-friendly.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-12RT3548: Remove unsupported platformsRich Salz
This last one for this ticket. Removes WIN16. So long, MS_CALLBACK and MS_FAR. We won't miss you. Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-12-08Remove OPENSSL_FIPSCANISTER code.Dr. Stephen Henson
OPENSSL_FIPSCANISTER is only set if the fips module is being built (as opposed to being used). Since the fips module wont be built in master this is redundant. Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-02-25Avoid Windows 8 Getversion deprecated errors.Dr. Stephen Henson
Windows 8 SDKs complain that GetVersion() is deprecated. We only use GetVersion like this: (GetVersion() < 0x80000000) which checks if the Windows version is NT based. Use a macro check_winnt() which uses GetVersion() on older SDK versions and true otherwise.
2013-04-04cryptlib.c: fix typo in OPENSSL_showfatal.Andy Polyakov
2013-02-06Add and use a constant-time memcmp.Ben Laurie
This change adds CRYPTO_memcmp, which compares two vectors of bytes in an amount of time that's independent of their contents. It also changes several MAC compares in the code to use this over the standard memcmp, which may leak information about the size of a matching prefix. (cherry picked from commit 2ee798880a246d648ecddadc5b91367bee4a5d98)
2013-01-19Improve WINCE support.Andy Polyakov
Submitted by: Pierre Delaage
2012-12-01cryptlib.c: fix logical error.Andy Polyakov
2012-11-17cryptlib.c: revert typo.Andy Polyakov
2012-11-17Extend OPENSSL_ia32cap_P with extra word to accomodate AVX2 capability.Andy Polyakov