aboutsummaryrefslogtreecommitdiff
path: root/crypto/rsa/rsa_eay.c
AgeCommit message (Collapse)AuthorFilesLines
2015-11-17Rename RSA_eay_xxx to rsa_ossl_xxxRich Salz1-922/+0
Final part of flushing out SSLEay API's. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-09Continue standardising malloc style for libcryptoMatt Caswell1-10/+11
Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-10-30Replace "SSLeay" in API with OpenSSLRich Salz1-1/+1
All instances of SSLeay (any combination of case) were replaced with the case-equivalent OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-07Move BN_CTX_start() call so the error case can always call BN_CTX_end().Pascal Cuoq1-1/+2
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> MR #1231
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-04-30free NULL cleanup 7Rich Salz1-50/+27
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-30free cleanup almost the finaleRich Salz1-16/+4
Add OPENSSL_clear_free which merges cleanse and free. (Names was picked to be similar to BN_clear_free, etc.) Removed OPENSSL_freeFunc macro. Fixed the small simple ones that are left: CRYPTO_free CRYPTO_free_locked OPENSSL_free_locked Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-27OPENSSL_NO_xxx cleanup: SHARich Salz1-4/+0
Remove support for SHA0 and DSS0 (they were broken), and remove the ability to attempt to build without SHA (it didn't work). For simplicity, remove the option of not building various SHA algorithms; you could argue that SHA_224/256/384/512 should be kept, since they're like crypto algorithms, but I decided to go the other way. So these options are gone: GENUINE_DSA OPENSSL_NO_SHA0 OPENSSL_NO_SHA OPENSSL_NO_SHA1 OPENSSL_NO_SHA224 OPENSSL_NO_SHA256 OPENSSL_NO_SHA384 OPENSSL_NO_SHA512 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Rerun util/openssl-format-source -v -c .master-post-auto-reformatMatt Caswell1-3/+2
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell1-819/+813
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22indent has problems with comments that are on the right hand side of a line.Matt Caswell1-5/+6
Sometimes it fails to format them very well, and sometimes it corrupts them! This commit moves some particularly problematic ones. Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-08Implement internally opaque bn access from rsaMatt Caswell1-28/+77
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-08remove OPENSSL_FIPSAPIDr. Stephen Henson1-1/+1
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-08remove FIPS module code from crypto/rsaDr. Stephen Henson1-70/+0
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>
2014-07-05Return smaller of ret and f.Alan Hryngle1-1/+1
PR#3418.
2011-10-19BN_BLINDING multi-threading fix.Bodo Möller1-29/+51
Submitted by: Emilia Kasper (Google)
2011-05-11Rename FIPS_mode_set and FIPS_mode. Theses symbols will be defined inDr. Stephen Henson1-4/+4
the FIPS capable OpenSSL.
2011-04-23Make sure overrides work for RSA/DSA.Dr. Stephen Henson1-4/+8
2011-04-22Return errors instead of aborting when selftest fails.Dr. Stephen Henson1-1/+5
2011-02-03Fix error codes.Bodo Möller1-11/+11
2011-01-27Change OPENSSL_FIPSEVP to OPENSSL_FIPSAPI as it doesn't just referDr. Stephen Henson1-1/+1
to EVP any more. Move locking #define into fips.h. Set FIPS locking callbacks at same time as OpenSSL locking callbacks.
2011-01-27use FIPSEVP in some bn and rsa filesDr. Stephen Henson1-0/+2
2011-01-26FIPS mode RSA changes:Dr. Stephen Henson1-1/+63
Check for selftest failures. Pairwise consistency test for RSA key generation. Use some EVP macros instead of EVP functions. Use minimal FIPS EVP where needed.
2010-10-11PR: 2295Dr. Stephen Henson1-1/+1
Submitted by: Alexei Khlebnikov <alexei.khlebnikov@opera.com> Reviewed by: steve OOM checking. Leak in OOM fix. Fall-through comment. Duplicate code elimination.
2008-09-14Really get rid of unsafe double-checked locking.Bodo Möller1-17/+22
Also, "CHANGES" clean-ups.
2008-08-06Remove the dual-callback scheme for numeric and pointer thread IDs,Geoff Thorpe1-1/+3
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-3/+1
version some time soon.
2008-03-28There was a need to support thread ID types that couldn't be reliably castGeoff Thorpe1-1/+3
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.
2008-02-27fix BIGNUM flag handlingBodo Möller1-35/+37
2007-03-28Change to mitigate branch prediction attacksBodo Möller1-15/+72
Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
2006-09-28Introduce limits to prevent malicious keys being able toBodo Möller1-0/+44
cause a denial of service. (CVE-2006-2940) [Steve Henson, Bodo Moeller]
2006-09-06Remove non-functional part of recent patch, after discussion withBodo Möller1-9/+0
Colin Percival (this would have caused more problems than solved, and isn't really necessary anyway)
2006-09-05Avoid PKCS #1 v1.5 signature attack discovered by Daniel BleichenbacherMark J. Cox1-0/+9
(CVE-2006-4339) Submitted by: Ben Laurie, Google Security Team Reviewed by: bmoeller, mjc, shenson
2006-06-23New functions CRYPTO_set_idptr_callback(),Bodo Möller1-1/+1
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.
2006-06-14Thread-safety fixesBodo Möller1-17/+40
2005-09-22protect BN_BLINDING_invert with a write lock and BN_BLINDING_convertNils Larsch1-4/+4
with a read lock Submitted by: Leandro Santi <lesanti@fiuba7504.com.ar>
2005-05-28Update from 0.9.7-stable. Also repatch and rebuild error codes.Dr. Stephen Henson1-3/+23
2005-05-27Use BN_with_flags() in a cleaner way.Bodo Möller1-0/+1
2005-05-16Implement fixed-window exponentiation to mitigate hyper-threadingBodo Möller1-9/+118
timing attacks. BN_FLG_EXP_CONSTTIME requests this algorithm, and this done by default for RSA/DSA/DH private key computations unless RSA_FLAG_NO_EXP_CONSTTIME/DSA_FLAG_NO_EXP_CONSTTIME/ DH_FLAG_NO_EXP_CONSTTIME is set. Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
2005-05-11Fix more error codes.Bodo Möller1-1/+1
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
2005-04-26Port BN_MONT_CTX_set_locked() from stable branch.Dr. Stephen Henson1-29/+2
The function rsa_eay_mont_helper() has been removed because it is no longer needed after this change.
2005-04-26some updates for the blinding code; summary:Nils Larsch1-102/+76
- 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
2005-04-22- use BN_set_negative and BN_is_negative instead of BN_set_signNils Larsch1-3/+3
and BN_get_sign - implement BN_set_negative as a function - always use "#define BN_is_zero(a) ((a)->top == 0)"
2004-03-25By adding a BN_CTX parameter to the 'rsa_mod_exp' callback, private keyGeoff Thorpe1-88/+93
operations no longer require two distinct BN_CTX structures. This may put more "strain" on the current BN_CTX implementation (which has a fixed limit to the number of variables it will hold), but so far this limit is not triggered by any of the tests pass and I will be changing BN_CTX in the near future to avoid this problem anyway. This also changes the default RSA implementation code to use the BN_CTX in favour of initialising some of its variables locally in each function.
2004-03-15Make sure that the last argument to RAND_add() is a float, or someRichard Levitte1-1/+1
compilers may complain.
2003-04-15Memory leak fix: local blinding structure not freed in rsa_eay_private_decrypt()Richard Levitte1-0/+2
2003-04-08We seem to carry some rests of the 0.9.6 [engine] ENGINE framework in formRichard Levitte1-3/+0
of unneeded includes of openssl/engine.h.
2003-04-02make RSA blinding thread-safeBodo Möller1-8/+106
2003-03-20make sure RSA blinding works when the PRNG is not properly seeded;Bodo Möller1-8/+27
enable it automatically for the built-in engine