aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove outdated RC4 filesRich Salz2015-05-023-530/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanup -- codaRich Salz2015-05-0182-511/+244
| | | | | | | | After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Remove goto inside an if(0) blockRich Salz2015-05-0114-105/+82
| | | | | | | There were a dozen-plus instances of this construct: if (0) { label: ..... } Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix build on MacOS.Ben Laurie2015-05-013-12/+24
| | | | Reviewed-by: Andy Polyakov
* Use BN_ULONG format.Ben Laurie2015-05-011-2/+2
| | | | Reviewed-by: Andy Polyakov
* u_len may be unused.Ben Laurie2015-05-011-1/+1
| | | | Reviewed-by: Andy Polyakov
* free NULL cleanup 11Rich Salz2015-05-0132-121/+67
| | | | | | | | | | | | | | | | | | | Don't check for NULL before calling free functions. This gets: ERR_STATE_free ENGINE_free DSO_free CMAC_CTX_free COMP_CTX_free CONF_free NCONF_free NCONF_free_data _CONF_free_data A sk_free use within OBJ_sigid_free TS_TST_INFO_free (rest of TS_ API was okay) Doc update for UI_free (all uses were fine) X509V3_conf_free X509V3_section_free X509V3_string_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* free null cleanup finaleRich Salz2015-05-01173-1012/+509
| | | | | | Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix some typo's, silence warnings.Rich Salz2015-05-011-1/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rewrite CA.pl.inRich Salz2015-04-301-178/+169
| | | | | | | | | Reformat CA.pl.in to follow coding style. Also add "use strict" and "use warnings" Also modify it to exit properly and report only when succeeded. And some perl tweaks via Richard. Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanup 7Rich Salz2015-04-3080-734/+385
| | | | | | | | | | | 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>
* Fix buffer overrun in RSA signingMatt Caswell2015-04-301-1/+7
| | | | | | | | | | | | | | | | | | The problem occurs in EVP_PKEY_sign() when using RSA with X931 padding. It is only triggered if the RSA key size is smaller than the digest length. So with SHA512 you can trigger the overflow with anything less than an RSA 512 bit key. I managed to trigger a 62 byte overflow when using a 16 bit RSA key. This wasn't sufficient to cause a crash, although your mileage may vary. In practice RSA keys of this length are never used and X931 padding is very rare. Even if someone did use an excessively short RSA key, the chances of them combining that with a longer digest and X931 padding is very small. For these reasons I do not believe there is a security implication to this. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add sanity check to print_bin functionMatt Caswell2015-04-301-1/+3
| | | | | | | | Add a sanity check to the print_bin function to ensure that the |off| argument is positive. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add sanity check to ssl_get_prev_sessionMatt Caswell2015-04-301-1/+1
| | | | | | | | Sanity check the |len| parameter to ensure it is positive. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Sanity check the return from final_finish_macMatt Caswell2015-04-302-2/+1
| | | | | | | | | The return value is checked for 0. This is currently safe but we should really check for <= 0 since -1 is frequently used for error conditions. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add sanity check in ssl3_cbc_digest_recordMatt Caswell2015-04-301-2/+12
| | | | | | | | | | | | For SSLv3 the code assumes that |header_length| > |md_block_size|. Whilst this is true for all SSLv3 ciphersuites, this fact is far from obvious by looking at the code. If this were not the case then an integer overflow would occur, leading to a subsequent buffer overflow. Therefore I have added an explicit sanity check to ensure header_length is always valid. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Clarify logic in BIO_*printf functionsMatt Caswell2015-04-301-24/+21
| | | | | | | | | | | | | | The static function dynamically allocates an output buffer if the output grows larger than the static buffer that is normally used. The original logic implied that |currlen| could be greater than |maxlen| which is incorrect (and if so would cause a buffer overrun). Also the original logic would call OPENSSL_malloc to create a dynamic buffer equal to the size of the static buffer, and then immediately call OPENSSL_realloc to make it bigger, rather than just creating a buffer than was big enough in the first place. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Sanity check EVP_EncodeUpdate buffer lenMatt Caswell2015-04-301-1/+1
| | | | | | | | | There was already a sanity check to ensure the passed buffer length is not zero. Extend this to ensure that it also not negative. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Sanity check EVP_CTRL_AEAD_TLS_AADMatt Caswell2015-04-307-11/+29
| | | | | | | | | | The various implementations of EVP_CTRL_AEAD_TLS_AAD expect a buffer of at least 13 bytes long. Add sanity checks to ensure that the length is at least that. Also add a new constant (EVP_AEAD_TLS1_AAD_LEN) to evp.h to represent this length. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Sanity check DES_enc_write buffer lengthMatt Caswell2015-04-301-0/+3
| | | | | | | | Add a sanity check to DES_enc_write to ensure the buffer length provided is not negative. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
* free cleanup 12Rich Salz2015-04-309-23/+24
| | | | | | | | | Don't check for NULL before calling free function. This gets: NAME_CONSTRAINTS_free GENERAL_SUBTREE_free ECDSA_METHOD_free JPAKE_CTX_free OCSP_REQ_CTX_free SCT_free SRP_VBASE_free SRP_gN_free SRP_user_pwd_free TXT_DB_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* make updateMatt Caswell2015-04-302-127/+122
| | | | | | Run make update following previous header file changes. Reviewed-by: Rich Salz <rsalz@openssl.org>
* free cleanup almost the finaleRich Salz2015-04-3056-311/+121
| | | | | | | | | | 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>
* In apps, malloc or dieRich Salz2015-04-3024-310/+126
| | | | | | | | No point in proceeding if you're out of memory. So change *all* OPENSSL_malloc calls in apps to use the new routine which prints a message and exits. Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanup 5aRich Salz2015-04-3065-355/+189
| | | | | | | | | Don't check for NULL before calling a free routine. This gets X509_.*free: x509_name_ex_free X509_policy_tree_free X509_VERIFY_PARAM_free X509_STORE_free X509_STORE_CTX_free X509_PKEY_free X509_OBJECT_free_contents X509_LOOKUP_free X509_INFO_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanup 8Rich Salz2015-04-3024-100/+58
| | | | | | | | | | Do not check for NULL before calling a free routine. This addresses: ASN1_BIT_STRING_free ASN1_GENERALIZEDTIME_free ASN1_INTEGER_free ASN1_OBJECT_free ASN1_OCTET_STRING_free ASN1_PCTX_free ASN1_SCTX_free ASN1_STRING_clear_free ASN1_STRING_free ASN1_TYPE_free ASN1_UTCTIME_free M_ASN1_free_of Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix bug, "what mode" test was wrong.Rich Salz2015-04-301-1/+2
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix windows buildMatt Caswell2015-04-302-7/+7
| | | | | | | The big apps cleanup broke the windows build. This commit fixes some miscellaneous issues so that it builds again. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove redundant includes from dtls1.hMatt Caswell2015-04-303-19/+8
| | | | | | | | | There were a set of includes in dtls1.h which are now redundant due to the libssl opaque work. This commit removes those includes, which also has the effect of resolving one issue preventing building on windows (i.e. the include of winsock.h) Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add HTTP GET support to OCSP serverRich Salz2015-04-292-3/+51
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Rewrite parse_nameRich Salz2015-04-292-109/+59
| | | | | | | Remove need for multiple arrays, parse the X509 name one RDN at a time. Thanks to Andy for careful review. Reviewed-by: Andy Polyakov <appro@openssl.org>
* use isxdigit and apps_tohexRich Salz2015-04-294-14/+46
| | | | | | Replace ad-hoc ascii->hex with isxdigit and new app_tohex. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove needless bio_err argumentRich Salz2015-04-2913-137/+136
| | | | | | | Many functions had a BIO* parameter, and it was always called with bio_err. Remove the param and just use bio_err. Reviewed-by: Matt Caswell <matt@openssl.org>
* Make "make rehash" quietRich Salz2015-04-281-2/+2
| | | | | | | Don't complain about missing config file. (Got the right env var name this time) Reviewed-by: Richard Levitte <levitte@openssl.org>
* realloc of NULL is like mallocRich Salz2015-04-288-36/+11
| | | | | | ANSI C, and OpenSSL's malloc wrapper do this, also. Reviewed-by: Richard Levitte <levitte@openssl.org>
* remove malloc castsRich Salz2015-04-28114-226/+191
| | | | | | | Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
* ERR_ cleanupRich Salz2015-04-287-245/+89
| | | | | | | | | | | | Remove ERR_[gs]et_implementation as they were not undocumented and useless (the data structure was opaque). Halve the number of lock/unlock calls in almost all ERR_ functions by letting the caller of get_hash or int_thread_set able to lock. Very useful when looping, such as adding errors, or when getting the hash and immediately doing a lookup on it. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Allow for types with leading underscore when checking error macros.Richard Levitte2015-04-281-1/+1
| | | | | | | | We have an increasing number of function declarations starting with '__owur'. Unfortunately, util/ck_errf.pl fails to detect them. A simple change fixes that issue. Reviewed-by: Emilia Käsper <emilia@openssl.org>
* NISTZ256: owur'ize.Emilia Kasper2015-04-281-20/+20
| | | | | | __owur'ize static methods to catch calling errors within the module. Reviewed-by: Rich Salz <rsalz@openssl.org>
* NISTZ256: use EC_POINT API and check errors.Emilia Kasper2015-04-271-7/+15
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* CRYPTO_mem_leaks should ignore it's BIO argument.Rich Salz2015-04-272-3/+12
| | | | | | | CRYPTO_mem_leaks takes a BIO* argument. It's not a leak if that argument hasn't been free'd. Reviewed-by: Richard Levitte <levitte@openssl.org>
* NISTZ256: don't swallow malloc errorsEmilia Kasper2015-04-271-12/+12
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* NISTZ256: set Z_is_one to boolean 0/1 as is customary.Emilia Kasper2015-04-271-1/+1
| | | | | | Cosmetic, no real effect. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Error checking and memory leak fixes in NISTZ256.Emilia Kasper2015-04-275-31/+52
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix Wmaybe-uninitialized: initialize variableEmilia Kasper2015-04-271-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix the check of test apps in util/mk1mf.plRichard Levitte2015-04-271-2/+9
| | | | | | | | The previous check assumed that the variables for each test app, ending with TEST would be indication enough. Experience showed that this isn't the best way. Instead, simply look for the EXE variable in test/Makefile. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Small fixes after the Big apps cleanupRichard Levitte2015-04-271-1/+1
| | | | | | | This fixes util/mk1mf.pl, which was looking for old variable names from apps/Makefile. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add readline (etc) supportRich Salz2015-04-261-2/+30
| | | | | | Compile with -DREADLINE and the appropriate library. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Simplify parse_yesno; remove local variableRich Salz2015-04-261-9/+3
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix typo in help & comment formattingRich Salz2015-04-261-4/+4
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>