summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_client.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-02-12qsort() compare functions MUST use memcmp() instead of bcmp() to haveguenther1-2/+4
the correct return value. Prefer memcmp() anyway for portability. ok jsing@ tedu@
2015-02-12Change TLS_PROTOCOLS_DEFAULT to be TLSv1.2 only. Add a TLS_PROTOCOLS_ALLjsing1-2/+4
that includes all currently supported protocols (TLSv1.0, TLSv1.1 and TLSv1.2). Change all users of libtls to use TLS_PROTOCOLS_ALL so that they maintain existing behaviour. Discussed with tedu@ and reyk@.
2015-02-12If you do not support POSIX I/O then you're not tall enough to ride...jsing8-46/+8
ok tedu@
2015-02-12unifdef -m -UOPENSSL_NO_NEXTPROTONEG - NPN is being replaced with ALPN,jsing8-48/+8
however it is not likely to be removed any time soon. ok beck@ miod@
2015-02-12swap limits.h for sys/limits.hbcook1-1/+1
ok jsing@
2015-02-11use a width specifier for lists, and Sq rather than Dq for single lettersjmc1-3/+3
to avoid swamping it;
2015-02-11Provide a tls_connect_servername() function that has the same behaviourjsing4-6/+27
as tls_connect(), however allows the name to use for verification to be explicitly provided, rather than being inferred from the host value. Requested by reyk@ ok reyk@ tedu@
2015-02-11Be consistent with naming - only use "host" and "hostname" when referringjsing6-60/+61
to an actual host and use "servername" when referring to the name of the TLS server that we expect to be indentified in the server certificate. Likewise, rename verify_host to verify_name and use the term "name" throughout the verification code (rather than host or hostname). Requested by and ok tedu@
2015-02-11Do not rely upon malloc(0) not returning NULL. Not all malloc implementationsmiod1-6/+10
have this property. Instead, skip the malloc and memcmp if their size is zero. Per bcook@ request in order to run on AIX
2015-02-11Guenther has plans for OPENSSL_NO_CMS, so revert this for the moment.beck18-24/+246
2015-02-11the possible algos for pref should be documented heretedu1-4/+11
2015-02-11Remove initialisers with default values from the ASN1 data structures.jsing34-376/+46
Minor changes in generated assembly due to the compiler swapping from .quad 0/.long 0 to .zero, along with changes due to line numbering.
2015-02-11get rid of OPENSSL_NO_CMS code we do not use.beck18-246/+24
ok miod@
2015-02-11get rid of OPENSSL_NO_COMP code we don't use.beck4-22/+4
jajaja miod@
2015-02-11Expand most of the ASN1_SEQUENCE* and associated macros, making the datajsing34-292/+1900
structures visible and easier to review, without having to wade through layers and layers of asn1t.h macros. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-11Enable building with -DOPENSSL_NO_DEPRECATED.doug61-61/+142
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-11More unifdef OPENSSL_NO_RFC3779 that got missed last time around.jsing4-32/+4
Spotted by beck@
2015-02-10Introduce an openssl(1) certhash command.jsing3-9/+685
This is effectively a reimplementation of the functionality provided by the previously removed c_rehash Perl script. The c_rehash script had a number of known issues, including the fact that it needs to run openssl(1) multiple times and that it starts by removing all symlinks before putting them back, creating atomicity issues/race conditions, even when nothing has changed. certhash is self-contained and is intended to be stable - no changes should be made unless something has actually changed. This means it can be run regularly in a production environment without causing certificate lookup failures. Further testing and improvements will happen in tree. Discussed with tedu@
2015-02-10unifdef OPENSSL_NO_RFC3779 - this is currently disabled and unlikely tojsing13-5410/+9
be enabled, mostly since people use SANs instead. ok beck@ guenther@
2015-02-10Remove old interesting but not useful content.jsing2-556/+0
ok miod@
2015-02-10unifdef OPENSSL_NO_RC5jsing6-58/+6
2015-02-10Remove RC5 code - this is not currently enabled and is not likely to everjsing17-2166/+2
be enabled. Removes one symbol from libcrypto, however there is no ABI change. ok beck@ miod@ tedu@
2015-02-10Remove more IMPLEMENT_STACK_OF noops that have been hiding for the lastjsing26-78/+28
15 years.
2015-02-10Remove crypto/store - part of which is "currently highly experimental".jsing15-7016/+1
This code is not compiled in and OPENSSL_NO_STORE is already defined in opensslfeatures.h. No symbol removal for libcrypto. ok beck@
2015-02-10EVP_BytesToKey(): return through the error path (which cleans things up)miod2-6/+6
if EVP_DigestInit_ex() fails.
2015-02-10Replace assert() and OPENSSL_assert() calls with proper error return paths.miod26-102/+282
Careful review, feedback & ok doug@ jsing@
2015-02-10Remove default value initialisers for ASN1_ITEM. Minor changes to generatedjsing2-186/+22
assembly due to switches between .quad and .zero for structs.
2015-02-10Remove unnecessary include of assert.hmiod10-20/+10
2015-02-10Remove assert() or OPENSSL_assert() of pointers being non-NULL. The policymiod32-170/+34
for libraries in OpenBSD is to deliberately let NULL pointers cause a SIGSEGV. ok doug@ jsing@
2015-02-10Expand IMPLEMENT_ASN1_TYPE macros - no change to generated assembly.jsing2-46/+442
2015-02-10The IMPLEMENT_STACK_OF and IMPLEMENT_ASN1_SET_OF macros were turned intojsing20-94/+20
noops around 15 years ago. Remove multiple occurances of both that still exist in the code today.
2015-02-10Place the IMPLEMENT_ASN1_.*FUNCTION.* macros under an #ifndefjsing2-2/+8
LIBRESSL_INTERNAL - we do not need them any more.
2015-02-10Expand IMPLEMENT_ASN1_NDEF_FUNCTION and IMPLEMENT_ASN1_PRINT_FUNCTIONjsing2-6/+28
macros so that 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-10Expand IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname macros that got missed.jsing4-8/+56
2015-02-10Expand the IMPLEMENT_ASN1_ALLOC_FUNCTIONS macro so that the code is visiblejsing8-22/+176
and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-10Manually expand ASN1_ITEM_rptr macros that should have been expanded withjsing20-58/+58
the IMPLEMENT_ASN1_DUP_FUNCTION macro.
2015-02-10Expand the -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_(const_)?fname macros so thatjsing8-26/+242
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-10Expand the IMPLEMENT_ASN1_DUP_FUNCTION macro so that the code is visiblejsing20-58/+248
and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-10Expand the IMPLEMENT_ASN1_FUNCTIONS_{const,fname,name} macros so that thejsing10-46/+910
code is visible and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-09Expand the IMPLEMENT_ASN1_FUNCTIONS macro so that the code is visible andjsing12-102/+2310
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 andjsing24-86/+1574
functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-09BN_CTX_get() can fail - consistently check its return value.jsing56-546/+716
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@
2015-02-09Expand the IMPLEMENT_ASN1_FUNCTIONS macro so that the code is visible andjsing38-120/+2088
functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-09Jettison SCTP support in BIO dgram.jsing4-2104/+4
OpenBSD does not have SCTP support and it sees little use in the wild. OPENSSL_NO_SCTP is already specified via opensslfeatures.h, hence this is a code removal only and symbols should remain unchanged. ok beck@ miod@ tedu@
2015-02-09Jettison DTLS over SCTP.jsing14-818/+14
OpenBSD does not have SCTP support and it sees little use in the wild. OPENSSL_NO_SCTP is already specified via opensslfeatures.h, hence this is a code removal only and symbols should remain unchanged. ok beck@ miod@ tedu@
2015-02-09When parsing the host in tls_connect(), first check if it is a numericreyk1-29/+49
IPv4 or IPv6 address before trying to resolve the address with the AI_ADDRCONFIG flag set. This makes sure that attempts to connect to numeric IPs or loopback addresses are always possible and not prevented by AI_ADDRCONFIG. OK jsing@ tedu@
2015-02-09Return NULL when there are no shared ciphers.doug2-8/+12
OpenSSL added this change to avoid an out-of-bounds write since they're accessing p[-1]. We initialize buf and use strrchr() so we aren't subject to the same OOB write. However, we should return NULL rather than an empty string when there are no shared ciphers. Also, KNF a particularly bad section above here that miod noticed. Based on OpenSSL commits: 4ee356686f72ff849f6f3d58562224ace732b1a6 308505b838e4e3ce8485bb30f5b26e2766dc7f8b ok miod@
2015-02-09Remember to zero the ciphers configuration.jsing1-2/+4
2015-02-09This is neither code not proper documentation.miod14-314/+0
2015-02-09Rewrite the openssl(1) ciphers command.jsing1-158/+128
This has the same functionality as the previous version, however uses the new option handling code, uses SSL_CIPHER_get_value() since we no longer care about SSlv2 cipher suites and uses standard I/O functions instead of BIO functions. ok beck@ doug@