aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
Commit message (Collapse)AuthorAgeFilesLines
...
* Add some missing return value checksMatt Caswell2016-06-134-10/+15
| | | | | | Some misc return value checks Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/bn_add.c: favour counted loops over ifs and breaks.Andy Polyakov2016-06-131-72/+38
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* RT3053: Check for NULL before dereferencingPhillip Hellewell2016-06-121-0/+4
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Avoid creating illegal pointersKurt Roeckx2016-06-111-5/+7
| | | | | | | | Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1179
* Specify array sizesKurt Roeckx2016-06-115-6/+6
| | | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1172
* Avoid creating an illegal pointer.Kurt Roeckx2016-06-111-2/+1
| | | | | | | | Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1166
* Avoid creating an illegal pointerKurt Roeckx2016-06-111-2/+2
| | | | | | | | Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1164
* Fix an error path leak in int X509_ATTRIBUTE_set1_data()Matt Caswell2016-06-101-3/+9
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix an error path leak in do_ext_nconf()Matt Caswell2016-06-101-1/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix seg fault in TS_RESP_verify_response()Matt Caswell2016-06-101-8/+15
| | | | | | | | | | | The TS_RESP_verify_response() function is used for verifying the response from a TSA. You can set the provided TS_VERIFY_CTX with different flags depending on what aspects of the response you wish to verify. A seg fault will occur if you supply the TS_VFY_SIGNER or TS_VFY_TSA_NAME flags without also specifying TS_VFY_SIGNATURE. Reviewed-by: Rich Salz <rsalz@openssl.org>
* RT 4242: reject invalid EC point coordinatesEmilia Kasper2016-06-093-14/+26
| | | | | | | | | | | | | | | We already test in EC_POINT_oct2point that points are on the curve. To be on the safe side, move this check to EC_POINT_set_affine_coordinates_* so as to also check point coordinates received through some other method. We do not check projective coordinates, though, as - it's unlikely that applications would be receiving this primarily internal representation from untrusted sources, and - it's possible that the projective setters are used in a setting where performance matters. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make a2i_ipadd an internal functionRich Salz2016-06-092-0/+3
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Clean up "generic" intro pod files.Rich Salz2016-06-092-0/+291
| | | | | | | | | | | | Files like dh.pod, etc., mostly duplicated the API-specific pod files. Removed the duplicated content; that often mean the whole file could be removed. Some of the content about internals got moved into README files in the source tree. Some content (e.g., err.pod) got moved into other pod pages. Annotate generic pages, remove dup NAME Reviewed-by: Richard Levitte <levitte@openssl.org>
* hmac/hmac.c: fix sizeof typo in hmac_ctx_cleanup.Andy Polyakov2016-06-091-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fixes to get -ansi workingJeffrey Walton2016-06-081-1/+1
| | | | | | | | | | | | Various fixes to get the following to compile: ./config no-asm -ansi -D_DEFAULT_SOURCE RT4479 RT4480 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Add some accessor API'sRich Salz2016-06-081-0/+9
| | | | | | | | | GH1098: Add X509_get_pathlen() (and a test) GH1097: Add SSL_is_dtls() function. Documented. Reviewed-by: Matt Caswell <matt@openssl.org>
* crypto/x509/x509_vpm.c: Simplify int_x509_param_set1()Kurt Cancemi2016-06-081-6/+5
| | | | | | | This change also avoids calling strlen twice when srclen is 0 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix BN_mod_word bugMatt Caswell2016-06-071-0/+22
| | | | | | | | | | On systems where we do not have BN_ULLONG (e.g. typically 64 bit systems) then BN_mod_word() can return incorrect results if the supplied modulus is too big. RT#4501 Reviewed-by: Andy Polyakov <appro@openssl.org>
* Fix potential access of null pointer (pp)Rob Percival2016-06-071-2/+2
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1186)
* Fix some GitHub issues.Rich Salz2016-06-071-4/+4
| | | | | | | | | GH1180: Local variable sometimes unused GH1181: Missing close paren. Thanks to <wipedout@yandex.ru> for reporting these. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Set flag BN_FLG_CONSTTIME earlierCesar Pereida2016-06-071-3/+2
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove kq and set BN_FLG_CONSTTIME in k for BN_mod_inverseCesar Pereida2016-06-071-13/+8
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Deprecate the flags that switch off constant timeMatt Caswell2016-06-066-234/+137
| | | | | | | | | The flags RSA_FLAG_NO_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME and DH_FLAG_NO_EXP_CONSTTIME which previously provided the ability to switch off the constant time implementation for RSA, DSA and DH have been made no-ops and deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Simplify dsa_ossl.cMatt Caswell2016-06-061-41/+20
| | | | | | | | | The dsa_ossl.c file defined a couple of multi-line macros, but then only used each one once. The macros just serve to complicate the code and make it more difficult to understand what is really going on. Hence they are removed. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix DSA, preserve BN_FLG_CONSTTIMECesar Pereida2016-06-061-4/+5
| | | | | | | | | | | | | Operations in the DSA signing algorithm should run in constant time in order to avoid side channel attacks. A flaw in the OpenSSL DSA implementation means that a non-constant time codepath is followed for certain operations. This has been demonstrated through a cache-timing attack to be sufficient for an attacker to recover the private DSA key. CVE-2016-2178 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* s390x assembly pack: improve portability.Andy Polyakov2016-06-062-4/+4
| | | | | | | | | | Some of the instructions used in latest additions are extension ones. There is no real reason to limit ourselves to specific processors, so [re-]adhere to base instruction set. RT#4548 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Constify X509V3_EXT_*_conf*FdaSilvaYY2016-06-041-30/+30
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1074)
* Constify ASN1_generate_nconfFdaSilvaYY2016-06-041-1/+1
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1074)
* Constify ASN1_generate_v3FdaSilvaYY2016-06-041-3/+3
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1074)
* Constify s2i_ASN1_IA5STRINGFdaSilvaYY2016-06-041-4/+3
| | | | | | | | Return directly NULL after ASN1_STRING_set, as it already has set an error code. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1074)
* Constify s2i_ASN1_INTEGERFdaSilvaYY2016-06-042-3/+3
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1074)
* Constify X509_OBJECT_get_type & X509_OBJECT_get0_X509FdaSilvaYY2016-06-041-2/+2
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1074)
* Specifiy size of arraysKurt Roeckx2016-06-043-4/+4
| | | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1139
* Check for overflows in EOC.Dr. Stephen Henson2016-06-042-8/+15
| | | | | | RT#4474 (partial) Reviewed-by: Rich Salz <rsalz@openssl.org>
* BIO_printf() can fail to print the last characterMatt Caswell2016-06-031-3/+9
| | | | | | | | | | | If the string to print is exactly 2048 character long (excluding the NULL terminator) then BIO_printf will chop off the last byte. This is because it has filled its static buffer but hasn't yet allocated a dynamic buffer. In cases where we don't have a dynamic buffer we need to truncate but that is not the case for BIO_printf(). We need to check whether we are able to have a dynamic buffer buffer deciding to truncate. Reviewed-by: Rich Salz <rsalz@openssl.org>
* cryptodev_asym, zapparams: use OPENSSL_* allocation routines, handle errorsJonas Maebe2016-06-031-6/+13
| | | | | | | | | zapparams modification based on tip from Matt Caswell RT#3198 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Added define for STATUS_SUCCESSMat2016-06-031-5/+8
| | | | | | | Use STATUS_SUCCESS instead of 0. Renamed USE_BCRYPT to RAND_WINDOWS_USE_BCRYPT to avoid possible collisions with other defines. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1142)
* Adds casts for 64-bitMat2016-06-031-3/+3
| | | | | | | Adds missing casts for 64-bit. Removed zero initialization of hProvider. hProvider is an "out" parameter of CryptAcquireContextW. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1142)
* Define USE_BCRYPTMat2016-06-031-5/+7
| | | | | | | Define USE_BCRYPT Removed _WIN32_WINNT define Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1142)
* Use BCryptGenRandom on Windows 7 or higherMat2016-06-031-7/+19
| | | | | | | | | | | When openssl is compiled with MSVC and _WIN32_WINNT>=0x0601 (Windows 7), BCryptGenRandom is used instead of the legacy CryptoAPI. This change brings the following benefits: - Removes dependency on CryptoAPI (legacy API) respectively advapi32.dll - CryptoAPI Cryptographic Service Providers (rsa full) are not dynamically loaded. - Allows Universal Windows Platform (UWP) apps to use openssl (CryptGenRandom is not available for Windows store apps) Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1142)
* Fix threading issue that at best will leak memoryPauli2016-06-031-0/+3
| | | | | | | | The problem is the checking in policy_cache_set, there is a race condition between the null check and obtaining the lock. The fix is in policy_cache_new to detect if the creation has happened already. Reviewed-by: Richard Levitte <levitte@openssl.org>
* chacha/chacha_enc.c: harmonize counter width with subroutine name.Andy Polyakov2016-06-031-3/+7
| | | | | | | | | | _ctr32 in function name refers to 32-bit counter, but it was implementing 64-bit one. This didn't pose problem to EVP, but 64-bit counter was just misleading. RT#4512 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix test failures when using enable-ubsanMatt Caswell2016-06-021-1/+1
| | | | | | | Numerous test failures were occuring when Configured with enable-ubsan although they could all be traced back to one issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Tidy up OCSP print handling.Dr. Stephen Henson2016-06-021-8/+11
| | | | | | | | Also fixes -Wstrict-oveflow warning on this file. RT#4474 (partial) Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't leak memory on set_reasons() error pathMatt Caswell2016-06-011-3/+3
| | | | | | | The set_reasons() function in v3_crld.c leaks a STACK_OF(CONF_VALUE) object on an error path. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't leak memory on int X509_PURPOSE_add() error pathMatt Caswell2016-06-011-3/+10
| | | | | | | The int X509_PURPOSE_add() function was leaking an X509_PURPOSE object on error. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't leak memory on X509_TRUST_add() error pathMatt Caswell2016-06-011-3/+9
| | | | | | The X509_TRUST_add() function was leaking an X509_TRUST object on error. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't leak memory on ASN1_item_pack() error pathMatt Caswell2016-06-011-7/+14
| | | | | | | The ASN1_item_pack() function was leaking an ASN1_STRING object on error paths. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't leak memory on ASN1_GENERALIZEDTIME_adj() error pathMatt Caswell2016-06-011-14/+21
| | | | | | | The ASN1_GENERALIZEDTIME_adj() function leaks an ASN1_GENERALIZEDTIME object on an error path. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't leak memory in v2i_POLICY_MAPPINGS() on error pathMatt Caswell2016-06-011-9/+12
| | | | | | | The v2i_POLICY_MAPPINGS() function leaked ASN1_OBJECT pointers on error paths. Reviewed-by: Richard Levitte <levitte@openssl.org>