aboutsummaryrefslogtreecommitdiff
path: root/crypto/bn/bn_blind.c
AgeCommit message (Collapse)AuthorFilesLines
2019-09-28Reorganize local header filesDr. Matthias St. Pierre1-1/+1
Apart from public and internal header files, there is a third type called local header files, which are located next to source files in the source directory. Currently, they have different suffixes like '*_lcl.h', '*_local.h', or '*_int.h' This commit changes the different suffixes to '*_local.h' uniformly. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
2019-07-15Make sure all BIGNUM operations work within the FIPS providerMatt Caswell1-1/+1
The FIPS provider does not have a default OPENSSL_CTX so, where necessary, we need to ensure we can always access an explicit OPENSSL_CTX. We remove functions from the FIPS provider that use the default OPENSSL_CTX, and fixup some places which were using those removed functions. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9310)
2018-12-06Following the license change, modify the boilerplates in crypto/bn/Richard Levitte1-1/+1
[skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7777)
2018-08-23bn/bn_blind.c: use Montgomery multiplication when possible.Andy Polyakov1-32/+56
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/6915)
2018-04-03Update copyright yearMatt Caswell1-1/+1
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5851)
2018-04-02Use the private RNG for data that is not publicKurt Roeckx1-1/+1
Reviewed-by: Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Fixes: #4641 GH: #4665
2018-03-27Allow NULL for some _free routines.Rich Salz1-0/+2
Based on the description in https://github.com/openssl/openssl/pull/5757, this re-implements the "allow NULL to be passed" behavior of a number of xxx_free routines. I also fixed up some egregious formatting errors that were nearby. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5761)
2018-03-27Remove some code for a contributor that we cannot findMatt Caswell1-3/+0
This removes some code because we cannot trace the original contributor to get their agreement for the licence change (original commit e03ddfae). After this change there will be numerous failures in the test cases until someone rewrites the missing code. All *_free functions should accept a NULL parameter. After this change the following *_free functions will fail if a NULL parameter is passed: BIO_ACCEPT_free() BIO_CONNECT_free() BN_BLINDING_free() BN_CTX_free() BN_MONT_CTX_free() BN_RECP_CTX_free() BUF_MEM_free() COMP_CTX_free() ERR_STATE_free() TXT_DB_free() X509_STORE_free() ssl3_free() ssl_cert_free() SSL_SESSION_free() SSL_free() [skip ci] Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/5757)
2017-10-18Remove parentheses of return.KaoruToda1-5/+5
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)
2016-05-17Copyright consolidation 06/10Rich Salz1-107/+6
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-16Fold threads.h into crypto.h making API publicViktor Dukhovni1-1/+0
Document thread-safe lock creation Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-08Convert RSA blinding to new multi-threading APIAlessandro Ghedini1-17/+32
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz1-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>
2016-01-07Backwards-compatibility subject to OPENSSL_API_COMPATViktor Dukhovni1-2/+3
Provide backwards-compatiblity for functions, macros and include files if OPENSSL_API_COMPAT is either not defined or defined less than the version number of the release in which the feature was deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-02Add and use OPENSSL_zallocRich Salz1-2/+1
There are many places (nearly 50) where we malloc and then memset. Add an OPENSSL_zalloc routine to encapsulate that. (Missed one conversion; thanks Richard) Also fixes GH328 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte1-1/+1
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-05memset, memcpy, sizeof consistency fixesRich Salz1-1/+1
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-04Use safer sizeof variant in mallocRich Salz1-1/+1
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 7Rich Salz1-13/+7
This gets BN_.*free: BN_BLINDING_free BN_CTX_free BN_FLG_FREE BN_GENCB_free BN_MONT_CTX_free BN_RECP_CTX_free BN_clear_free BN_free BUF_MEM_free Also fix a call to DSA_SIG_free to ccgost engine and remove some #ifdef'd dead code in engines/e_ubsec. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-28remove malloc castsRich Salz1-1/+1
Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell1-242/+240
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-08remove OPENSSL_FIPSAPIDr. Stephen Henson1-1/+1
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-08-18RT2163: Remove some unneeded #include'sDoug Goldstein1-1/+0
Several files #include stdio.h and don't need it. Also, per tjh, remove BN_COUNT Reviewed-by: Emilia Kasper <emilia@openssl.org>
2011-10-19BN_BLINDING multi-threading fix.Bodo Möller1-14/+23
Submitted by: Emilia Kasper (Google)
2011-01-27Move all FIPSAPI renames into fips.h header file, include early inDr. Stephen Henson1-6/+2
crypto.h if needed. Modify source tree to handle change.
2011-01-27Redirect FIPS memory allocation to FIPS_malloc() routine, removeDr. Stephen Henson1-0/+6
OpenSSL malloc dependencies.
2011-01-26Internal version of BN_mod_inverse allowing checking of no-inverse withoutDr. Stephen Henson1-4/+3
need to inspect error queue.
2008-08-06Remove the dual-callback scheme for numeric and pointer thread IDs,Geoff Thorpe1-9/+8
deprecate the original (numeric-only) scheme, and replace with the CRYPTO_THREADID object. This hides the platform-specifics and should reduce the possibility for programming errors (where failing to explicitly check both thread ID forms could create subtle, platform-specific bugs). Thanks to Bodo, for invaluable review and feedback.
2008-07-03Revert my earlier CRYPTO_THREADID commit, I will commit a reworkedGeoff Thorpe1-11/+6
version some time soon.
2008-03-28There was a need to support thread ID types that couldn't be reliably castGeoff Thorpe1-6/+11
to 'unsigned long' (ie. odd platforms/compilers), so a pointer-typed version was added but it required portable code to check *both* modes to determine equality. This commit maintains the availability of both thread ID types, but deprecates the type-specific accessor APIs that invoke the callbacks - instead a single type-independent API is used. This simplifies software that calls into this interface, and should also make it less error-prone - as forgetting to call and compare *both* thread ID accessors could have led to hard-to-debug/infrequent bugs (that might only affect certain platforms or thread implementations). As the CHANGES note says, there were corresponding deprecations and replacements in the thread-related functions for BN_BLINDING and ERR too.
2007-03-28Change to mitigate branch prediction attacksBodo Möller1-1/+7
Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
2006-06-23New functions CRYPTO_set_idptr_callback(),Bodo Möller1-1/+13
CRYPTO_get_idptr_callback(), CRYPTO_thread_idptr() for a 'void *' type thread ID, since the 'unsigned long' type of the existing thread ID does not always work well.
2005-05-26check BN_copy() return valueBodo Möller1-3/+8
2005-05-11Fix more error codes.Bodo Möller1-2/+2
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
2005-04-26Stop unused variable warning.Dr. Stephen Henson1-1/+0
2005-04-26some updates for the blinding code; summary:Nils Larsch1-12/+222
- possibility of re-creation of the blinding parameters after a fixed number of uses (suggested by Bodo) - calculatition of the rsa::e in case it's absent and p and q are present (see bug report #785) - improve the performance when if one rsa structure is shared by more than a thread (see bug report #555) - fix the problem described in bug report #827 - hide the definition ot the BN_BLINDING structure in bn_blind.c
2003-11-04Put the first stage of my bignum debugging adventures into CVS. This codeGeoff Thorpe1-0/+1
is itself experimental, and in addition may cause execution to break on existing openssl "bugs" that previously were harmless or at least invisible.
2000-06-01There have been a number of complaints from a number of sources that namesRichard Levitte1-2/+2
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
1999-04-19Change functions to ANSI C.Ulf Möller1-17/+5
1999-04-19Fix typos in error codes.Ulf Möller1-3/+3
1999-01-07Accept NULL in *_free.Ben Laurie1-0/+3
1998-12-21Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeayRalf S. Engelschall1-1/+11
1998-12-21Import of old SSLeay release: SSLeay 0.9.0bRalf S. Engelschall1-0/+143