summaryrefslogtreecommitdiffstats
path: root/ssl
AgeCommit message (Collapse)Author
2015-04-30free NULL cleanup 7Rich Salz
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-30Add sanity check to ssl_get_prev_sessionMatt Caswell
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>
2015-04-30Sanity check the return from final_finish_macMatt Caswell
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>
2015-04-30Add sanity check in ssl3_cbc_digest_recordMatt Caswell
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>
2015-04-30Sanity check EVP_CTRL_AEAD_TLS_AADMatt Caswell
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>
2015-04-30make updateMatt Caswell
Run make update following previous header file changes. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-30free cleanup almost the finaleRich Salz
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-04-30free NULL cleanup 5aRich Salz
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>
2015-04-30Remove redundant includes from dtls1.hMatt Caswell
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>
2015-04-28remove malloc castsRich Salz
Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-24Big apps cleanup (option-parsing, etc)Rich Salz
This is merges the old "rsalz-monolith" branch over to master. The biggest change is that option parsing switch from cascasding 'else if strcmp("-foo")' to a utility routine and somethin akin to getopt. Also, an error in the command line no longer prints the full summary; use -help (or --help :) for that. There have been many other changes and code-cleanup, see bullet list below. Special thanks to Matt for the long and detailed code review. TEMPORARY: For now, comment out CRYPTO_mem_leaks() at end of main Tickets closed: RT3515: Use 3DES in pkcs12 if built with no-rc2 RT1766: s_client -reconnect and -starttls broke RT2932: Catch write errors RT2604: port should be 'unsigned short' RT2983: total_bytes undeclared #ifdef RENEG RT1523: Add -nocert to fix output in x509 app RT3508: Remove unused variable introduced by b09eb24 RT3511: doc fix; req default serial is random RT1325,2973: Add more extensions to c_rehash RT2119,3407: Updated to dgst.pod RT2379: Additional typo fix RT2693: Extra include of string.h RT2880: HFS is case-insensitive filenames RT3246: req command prints version number wrong Other changes; incompatibilities marked with *: Add SCSV support Add -misalign to speed command Make dhparam, dsaparam, ecparam, x509 output C in proper style Make some internal ocsp.c functions void Only display cert usages with -help in verify Use global bio_err, remove "BIO*err" parameter from functions For filenames, - always means stdin (or stdout as appropriate) Add aliases for -des/aes "wrap" ciphers. *Remove support for IISSGC (server gated crypto) *The undocumented OCSP -header flag is now "-header name=value" *Documented the OCSP -header flag Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-22SSL_CIPHER lookup functions.Dr. Stephen Henson
Add tables to convert between SSL_CIPHER fields and indices for ciphers and MACs. Reorganise ssl_ciph.c to use tables to lookup values and load them. New functions SSL_CIPHER_get_cipher_nid and SSL_CIPHER_get_digest_nid. Add documentation. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-21Repair EAP-FAST session resumptionEmilia Kasper
EAP-FAST session resumption relies on handshake message lookahead to determine server intentions. Commits 980bc1ec6114f5511b20c2e6ca741e61a39b99d6 and 7b3ba508af5c86afe43e28174aa3c53a0a24f4d9 removed the lookahead so broke session resumption. This change partially reverts the commits and brings the lookahead back in reduced capacity for TLS + EAP-FAST only. Since EAP-FAST does not support regular session tickets, the lookahead now only checks for a Finished message. Regular handshakes are unaffected by this change. Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-17Error out immediately on empty ciphers list.Emilia Kasper
A 0-length ciphers list is never permitted. The old code only used to reject an empty ciphers list for connections with a session ID. It would later error out on a NULL structure, so this change just moves the alert closer to the problem source. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-16Code style: space after 'if'Viktor Dukhovni
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-14Fix ssl_get_prev_session overrunMatt Caswell
If OpenSSL is configured with no-tlsext then ssl_get_prev_session can read past the end of the ClientHello message if the session_id length in the ClientHello is invalid. This should not cause any security issues since the underlying buffer is 16k in size. It should never be possible to overrun by that many bytes. This is probably made redundant by the previous commit - but you can never be too careful. With thanks to Qinghao Tang for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-14Check for ClientHello message overrunsMatt Caswell
The ClientHello processing is insufficiently rigorous in its checks to make sure that we don't read past the end of the message. This does not have security implications due to the size of the underlying buffer - but still needs to be fixed. With thanks to Qinghao Tang for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-11free NULL cleanup 9Rich Salz
Ongoing work to skip NULL check before calling free routine. This gets: ecp_nistz256_pre_comp_free nistp224_pre_comp_free nistp256_pre_comp_free nistp521_pre_comp_free PKCS7_free PKCS7_RECIP_INFO_free PKCS7_SIGNER_INFO_free sk_PKCS7_pop_free PKCS8_PRIV_KEY_INFO_free PKCS12_free PKCS12_SAFEBAG_free PKCS12_free sk_PKCS12_SAFEBAG_pop_free SSL_CONF_CTX_free SSL_CTX_free SSL_SESSION_free SSL_free ssl_cert_free ssl_sess_cert_free Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-04-11free NULL cleanup 10Rich Salz
Avoid checking for NULL before calling free functions. This gets ssl.*free: ssl_sess_cert_free ssl_free ssl_excert_free ssl_cert_free SSL_free SSL_SRP_CTX_free SSL_SESSION_free SSL_CTX_free SSL_CTX_SRP_CTX_free SSL_CONF_CTX_free Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-04-10The wrong ifdef is used to guard usage of PSK codeKurt Cancemi
PR#3790 Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-10Fix read_ahead issueMatt Caswell
Fix a "&" that should have been "!" when processing read_ahead. RT#3793 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-03make dependDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-03Rewrite ssl_asn1.c using new ASN.1 code.Dr. Stephen Henson
Complete reimplementation of d2i_SSL_SESSION and i2d_SSL_SESSION using new ASN.1 code and eliminating use of old ASN.1 macros. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-01make updateEmilia Kasper
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-31Remove SSL_TASK, the DECnet Based SSL Engine - addendumRichard Levitte
A bit of cleanup was forgotten. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-03-31Remove SSL_TASK, the DECnet Based SSL EngineRichard Levitte
This engine is for VMS only, and isn't really part of the core OpenSSL but rather a side project of its own that just happens to have tagged along for a long time. The reasons why it has remained within the OpenSSL source are long lost in history, and there not being any real reason for it to remain here, it's time for it to move out. This side project will appear as a project in its own right, the location of which will be announced later on. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-03-31Remove EXHEADER, TEST, APPS, links:, install: and uninstall: where relevantRichard Levitte
With no more symlinks, there's no need for those variables, or the links target. This also goes for all install: and uninstall: targets that do nothing but copy $(EXHEADER) files, since that's now taken care of by the top Makefile. Also, removed METHTEST from test/Makefile. It looks like an old test that's forgotten... Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-03-31Stop symlinking, move files to intended directoryRichard Levitte
Rather than making include/openssl/foo.h a symlink to crypto/foo/foo.h, this change moves the file to include/openssl/foo.h once and for all. Likewise, move crypto/foo/footest.c to test/footest.c, instead of symlinking it there. Originally-by: Geoff Thorpe <geoff@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-03-31Clean up record layerMatt Caswell
Fix up various things that were missed during the record layer work. All instances where we are breaking the encapsulation rules. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-31Fix record layer "make clean"Matt Caswell
The "clean" target in libssl has been updated to handle the new record layer sub-directory. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-28free NULL cleanupRich Salz
EVP_.*free; this gets: EVP_CIPHER_CTX_free EVP_PKEY_CTX_free EVP_PKEY_asn1_free EVP_PKEY_asn1_set_free EVP_PKEY_free EVP_PKEY_free_it EVP_PKEY_meth_free; and also EVP_CIPHER_CTX_cleanup Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-03-26Add Record Layer documentationMatt Caswell
Add some design documentation on how the record layer works to aid future maintenance. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Fix formatting odditiesMatt Caswell
Fix some formatting oddities in rec_layer_d1.c. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Fix record.h formattingMatt Caswell
Fix some strange formatting in record.h. This was probably originally introduced as part of the reformat work. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Define SEQ_NUM_SIZEMatt Caswell
Replace the hard coded value 8 (the size of the sequence number) with a constant defined in a macro. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Fix compilation on windows for record layerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Rename record layer source filesMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Remove some unneccessary macrosMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Renamed record layer header filesMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Reorganise header filesMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Remove last trace of non-record layer code reading and writing sequenceMatt Caswell
numbers directly Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move last_write_sequence from s->d1 to s->rlayer.d.Matt Caswell
Also push some usage of last_write_sequence out of dtls1_retransmit_message and into the record layer. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move ssl3_record_sequence_update into record layerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move buffered_app_data from s->d1 to s->rlayer.dMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move handshake_fragment, handshake_fragment_len, alert_fragment andMatt Caswell
alert_fragment_len from s->d1 to s->rlayer.d Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Fix seg fault in dtls1_newMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Moved processed_rcds and unprocessed_rcds from s->d1 to s->rlayer.dMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move bitmap and next_bitmap from s->d1 to s->rlayer.d.Matt Caswell
Create dtls_bitmap.h and dtls_bitmap.c Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move r_epoch and w_epoch from s->d1 to s->rlayer.dMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Introduce a DTLS_RECORD_LAYER type for DTLS record layer stateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>