summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rsa
AgeCommit message (Collapse)Author
2017-01-29Send the function codes from the error functions to the bit bucket,Bob Beck
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
2017-01-25Construct a BN_gcd_nonct, based on BN_mod_inverse_no_branch, as suggestedBob Beck
by Alejandro Cabrera <aldaya@gmail.com> to avoid the possibility of a sidechannel timing attack during RSA private key generation. Modify BN_gcd to become not visible under LIBRESSL_INTERNAL and force the use of the _ct or _nonct versions of the function only within the library. ok jsing@
2017-01-21Add ct and nonct versions of BN_mod_inverse for internal useBob Beck
ok jsing@
2017-01-21Split out BN_div and BN_mod into ct and nonct versions for Internal use.Bob Beck
ok jsing@
2017-01-21Make explicit _ct and _nonct versions of bn_mod_exp funcitons thatBob Beck
matter for constant time, and make the public interface only used external to the library. This moves us to a model where the important things are constant time versions unless you ask for them not to be, rather than the opposite. I'll continue with this method by method. Add regress tests for same. ok jsing@
2016-12-30Expand ASN1_ITEM_rptr macros - no change in generated assembly.Joel Sing
2016-12-21Explicitly export a list of symbols from libcrypto.Joel Sing
Move the "internal" BN functions from bn.h to bn_lcl.h and stop exporting the bn_* symbols. These are documented as only being intended for internal use, so why they were placed in a public header is beyond me... This hides 363 previously exported symbols, most of which exist in headers that are not installed and were never intended to be public. This also removes a few crusty old things that should have died long ago (like _ossl_old_des_read_pw). But don't worry... there are still 3451 symbols exported from the library. With input and testing from inoguchi@. ok beck@ inoguchi@
2016-10-19unifdef OPENSSL_NO_CMSJoel Sing
2016-09-04Expand DECLARE_ASN1_.*FUNCTIONS macros.Joel Sing
No change in preprocessed output, ignoring whitespace and line numbers.
2016-09-02missing space after commaTheo Buehler
ok bcook
2016-07-07call BN_init on temporaries to avoid use-before-set warningsBrent Cook
ok beck@
2016-06-30Remove flags for disabling constant-time operations.Brent Cook
This removes support for DSA_FLAG_NO_EXP_CONSTTIME, DH_FLAG_NO_EXP_CONSTTIME, and RSA_FLAG_NO_CONSTTIME flags, making all of these operations unconditionally constant-time. Based on the original patch by César Pereid. ok beck@
2015-12-03Fix for OpenSSL CVE-2015-3194Bob Beck
ok krw@
2015-09-30Replace M_ASN1_OCTET_STRING_(free|new) with ASN1_OCTET_STRING_(free|new).Joel Sing
2015-09-10Correct spelling of OPENSSL_cleanse.Joel Sing
ok miod@
2015-07-19Drop stupid (int) casts for the arguments of malloc() and friends. This isMiod Vallat
not 16-bit MS-DOS anymore. ok bcook@ tedu@
2015-06-20Replace remaining CRYPTO_memcmp() calls with timingsafe_memcmp().Joel Sing
ok doug@ deraadt@
2015-06-20Remove obsolete MDC-2DES from libcrypto.Doug Hogan
ok deraadt@ jsing@ miod@
2015-06-13Fix bad indenting in LibreSSL.Doug Hogan
jsg@ noticed that some of the lines in libssl and libcrypto are not indented properly. At a quick glance, it looks like it has a different control flow than it really does. I checked the history in our tree and in OpenSSL to make sure these were simple mistakes. ok miod@ jsing@
2015-02-15RegenMiod Vallat
2015-02-14Check for allocation error in RSA_eay_mod_exp(). Coverity CID 25217.Miod Vallat
ok jsing@
2015-02-14Expand ASN1_CHOICE*, ASN1_SEQUENCE* and associated macros, making theJoel Sing
data structures visible and easier to review, without having to wade through layers and layers of asn1t.h macros. Change has been scripted and there is no change to the generated assembly. Discussed with beck@ miod@ tedu@
2015-02-11Guenther has plans for OPENSSL_NO_CMS, so revert this for the moment.Bob Beck
2015-02-11get rid of OPENSSL_NO_CMS code we do not use.Bob Beck
ok miod@
2015-02-11Enable building with -DOPENSSL_NO_DEPRECATED.Doug Hogan
If you didn't enable deprecated code, there were missing err.h and bn.h includes. This commit allows building with or without deprecated code. This was not derived from an OpenSSL commit. However, they recently enabled OPENSSL_NO_DEPRECATED in git and fixed these header problems in a different way. Verified with clang that this only changes line numbers in the generated asm. ok miod@
2015-02-10Expand the -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_(const_)?fname macros so thatJoel Sing
the code is visible and functions can be readily located. Change has been scripted and there is no change to the generated assembly. Discussed with beck@ miod@ tedu@
2015-02-09Expand the IMPLEMENT_ASN1_FUNCTIONS macro so that the code is visible andJoel Sing
functions can be readily located. Change has been scripted and there is no change to the generated assembly. Discussed with beck@ miod@ tedu@
2015-02-09BN_CTX_get() can fail - consistently check its return value.Joel Sing
There are currently cases where the return from each call is checked, the return from only the last call is checked and cases where it is not checked at all (including code in bn, ec and engine). Checking the last return value is valid as once the function fails it will continue to return NULL. However, in order to be consistent check each call with the same idiom. This makes it easy to verify. Note there are still a handful of cases that do not follow the idiom - these will be handled separately. ok beck@ doug@
2014-10-22Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().Joel Sing
arc4random_buf() is guaranteed to always succeed - it is worth noting that a number of the replaced function calls were already missing return value checks. ok deraadt@
2014-10-18None of these need to include <openssl/rand.h>Joel Sing
2014-07-13Make sure all error conditions in RSA_padding_add_PKCS1_PSS_mgf1() causeMiod Vallat
EVP_MD_CTX_cleanup() to be called.
2014-07-12if (x) FOO_free(x) -> FOO_free(x).Miod Vallat
Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
2014-07-11In RSA_eay_private_encrypt(), correctly return the smaller BN; OpenSSLMiod Vallat
PR #3418 via OpenSSL trunk
2014-07-11Remove duplicate 0x for salt len in output; Martin Kaiser via OpenSSL trunk.Miod Vallat
2014-07-11Only import cryptlib.h in the four source files that actually need it.Joel Sing
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 referencesJoel Sing
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-10Stop including standard headers via cryptlib.h - pull in the headers thatJoel Sing
are needed in the source files that actually require them. ok beck@ miod@
2014-07-10RSA_setup_blinding() gets a BN with BN_CTX_get(), returns `out of memory'Miod Vallat
if it fails, then never uses it anymore, and may invoke a function which needs more than one BN from the BN_CTX anyway, so this is pointless - remove the BN_CTX_get() call and the test. ok jsing
2014-07-10Tweak some comments. We do not really need to know that "New!" flags wereJoel Sing
added 10+ years ago (they're kinda somewhat stale by now...)
2014-07-10Stop playing with the RSA_FLAG_BLINDING flag. It does nothing.Joel Sing
ok miod@
2014-07-10delete some casts. ok miodTed Unangst
2014-07-10Remove RSA_FLAG_NO_EXP_CONSTTIME, which was deprecated 12+ years ago.Joel Sing
sthen@ confirmed that no ports are referencing it. ok miod@.
2014-07-10BN_free, BN_clear_free, BN_CTX_free, BN_BLINDING_free and BN_MONT_CTX_freeJoel Sing
all have implicit NULL checks, so we do not need them here. ok miod@
2014-07-10Use a while loop instead of an ifdowhile loop.Joel Sing
ok miod@ tedu@
2014-07-09ASN1_STRING_free can handle NULL, so callers don't need to check. ok miodTed Unangst
2014-07-09Make comments readable.Joel Sing
2014-07-09More KNF.Joel Sing
2014-07-09KNF.Joel Sing
2014-07-09Unifdef -UPKCS_TESTVECT - we don't want the random data used in OAEP paddingMiod Vallat
to get overwritten by a known value, ever.
2014-07-09remove unused, private version strings except SSL_version_strBrent Cook
Also remove unused des_ver.h, which exports some of these strings, but is not installed. ok miod@ tedu@