summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-04-25Clean up derivation of finished/peer finished.Joel Sing
Make this process more readable by having specific client/server functions, calling the correct one based on s->server. This allows to remove various SSL_ST_ACCEPT/SSL_ST_CONNECT checks, along with duplicate code. ok inoguchi@ tb@
2021-04-24Do not leave errors on the error stack on PKCS12_parse() success.Theo Buehler
Fix is the same as OpenSSL commit ffbf304d4832bd51bb0618f8ca5b7c26647ee664 Found by Alex Gaynor with a new pyca cryptography regress test. ok inoguchi
2021-04-24Enable the new verifier again so hopefully the remaining kinks get ironedTheo Buehler
out in this release cycles. discussed with deraadt and jsing
2021-04-23whitespaceTheo Buehler
2021-04-22Only hash known CH extensionsTheo Buehler
RFC 4.1.2 specifies the ways in which the extensions in the first and the second ClientHello may differ. It basically says that extensions not known to a server must not change. This in turn makes it impossible to introduce new extensions that do change. It makes little sense to enforce that extensions we don't know and care about aren't modified, so make the hashing more lenient and restrict it to the extensions we do care about. Arguably, enforcing no change in an unknown extension is incompatible with the requirement that it be ignored. ok bcook jsing
2021-04-22kqueue: Make timer re-addition reset existing timerVisa Hankala
When an existing EVFILT_TIMER filter is re-added, cancel the existing timer and any pending event, and restart the timer using the new timeout period. This makes the new timeout period take effect immediately and matches the behaviour of FreeBSD. Previously, the new setting was applied only after the existing timer expired. The timer rescheduling is done by using an f_modify callback. The reading of timer events is moved from f_event to f_process. f_event of timer_filtops becomes redundant. Unlike most other event sources, timers activate knotes directly without using a klist and knote(9). OK mpi@
2021-04-21Clean up TLSv1.2 certificate request handshake data.Joel Sing
Currently cert_req is used by clients and cert_request is used by servers. Replace this by a single cert_request used by either client or server. Remove the certificate types as they are currently unused. This also fixes a bug whereby if the number of certificate types exceeds SSL3_CT_NUMBER the number of bytes read in is insufficient, which will break decoding. ok inoguchi@ tb@
2021-04-20Fix indent of EC_METHODs as requested by jsing.Theo Buehler
While there zap trailing whitespace from a KNF approximation gone wrong.
2021-04-20Compare pointer against NULL and fix a KNF issue.Theo Buehler
ok jsing
2021-04-20Prepare to provide EC_POINT_set_compressed_coordinatesTheo Buehler
ok jsing
2021-04-20Compare function pointers against NULL, not 0.Theo Buehler
ok jsing
2021-04-20Provide EC_POINT_{g,s}et_Jprojective_coordinates for internal useTheo Buehler
ok jsing
2021-04-20Simplify code after adding EC_POINT_{s,g}et_affine_coordinates()Theo Buehler
ok jsing
2021-04-20Compare function pointers against NULL, not 0.Theo Buehler
ok jsing
2021-04-20Prepare to provide EC_POINT_{g,s}et_affine_coordinatesTheo Buehler
Similar to part of OpenSSL commit 8e3cced75fb5fee5da59ebef9605d403a999391b ok jsing
2021-04-20Simplify after EC_POINT_get_curve() additionTheo Buehler
ok jsing
2021-04-20Compare function pointers against NULL, not 0.Theo Buehler
ok jsing
2021-04-20Prepare to provide EC_GROUP_{get,set}_curve(3)Theo Buehler
There are numerous functions in ec/ that exist with _GF2m and _GFp variants for no good reason. The code of both variants is the same. The EC_METHODs contain a pointer to the appropriate version. This commit hides the _GF2m and _GFp variants from internal use and provides versions that work for both curve types. These will be made public in an upcoming library bump. Similar to part of OpenSSL commit 8e3cced75fb5fee5da59ebef9605d403a999391b ok jsing
2021-04-19Remove new_sym_enc and new_aead.Joel Sing
These can be replaced with accessors that allow this information to be retrieved from the new record layer. ok inoguchi@ tb@
2021-04-19Avoid division by zero in hybrid point encodingTheo Buehler
In hybrid and compressed point encodings, the form octet contains a bit of information allowing to calculate y from x. For a point on a binary curve, this bit is zero if x is zero, otherwise it must match the rightmost bit of of the field element y / x. The existing code only considers the second possibility. It could thus fail with a division by zero error as found by Guido Vranken's cryptofuzz. This commit adds a few explanatory comments to oct2point and fixes some KNF issues. The only actual code change is in the last hunk which adds a BN_is_zero(x) check to avoid the division by zero. ok jsing
2021-04-19Move new_mac_secret_size into the TLSv1.2 handshake struct.Joel Sing
Drop the 'new_' prefix in the process. ok inoguchi@ tb@
2021-04-19Move reuse_message, message_type, message_size and cert_verify into theJoel Sing
TLSv1.2 handshake struct. ok inoguchi@ tb@
2021-04-19Set alpn_selected_len to zero when freeing alpn_selected.Joel Sing
This is not strictly necessary since we proceed to zero the entire struct, however it keeps the code consistent and easily auditable. ok tb@
2021-04-15mention DTLS1_2_VERSIONTheo Buehler
2021-04-15Mention DTLS1_2_VERSION here, tooTheo Buehler
2021-04-15Document SSL_OP_NO_DTLSv1{,_2}Theo Buehler
2021-04-15Document DTLSv1_2_{,client_,server_}method(3)Theo Buehler
2021-04-15Merge documentation for SSL_is_dtls() from OpenSSLTheo Buehler
2021-04-15Switch back to the legacy verifier for the release.Theo Buehler
This is disappointing as a lot of work was put into the new verifier during this cycle. However, there are still too many known bugs and incompatibilities. It is better to be faced with known broken behavior than with new broken behavior and to switch now rather than via errata. This way we have another cycle to iron out the kinks and to fix some of the remaining bugs. ok jsing
2021-04-11Update a stale comment and fix a typo.Theo Buehler
2021-04-09An extra internal consistency check and a missing stats adjustment. ok tb@Otto Moerbeek
2021-04-09Cache implementation has changed, we do not hold on to an exact numberOtto Moerbeek
of pages anymore, but also cache larger regions; ok tb@
2021-04-07Avoid clobbering the error code when sending an alertTheo Buehler
In order to fail gracefully on encountering a self-signed cert, curl looks at the top-most error on the stack and needs specific SSL_R_ error codes. This mechanism was broken when the tls13_alert_sent_cb() was added after people complained about unhelpful unknown errors. Fix this by only setting the error code from a fatal alert if no error has been set previously. Issue reported by Christopher Reid ok jsing
2021-04-06Shared semaphores are not supportedkn
Shared semaphores were reverted with lib/librthread/rthread_sem.c r1.18 in 2013 but corresponding manual bits were not; revert sem_init.3 r1.6 (modulo the unrelated "named semaphores" hunk). Reported by Rubén Llorente, thanks. Prodding OK jmc
2021-04-05Don't leak param->name in x509_verify_param_zero()Theo Buehler
For dynamically allocated verify parameters, param->name is only ever set in X509_VERIFY_set1_name() where the old one is freed and the new one is assigned via strdup(). Setting it to NULL without freeing it beforehand is a leak. looks correct to millert, ok inoguchi
2021-04-02swap rname and mname in debug output, and handle the USE_CD flagEric Faurot
from Boudewijn Dijkstra
2021-04-01For the snprintf range check demo, add a (size_t) cast in the right placeTheo de Raadt
which will satisfy the toughest compiler options
2021-03-31tweak column widths of a .Bl -column tableIngo Schwarze
and avoid an over-long source line while here; OK martijn@ jmc@
2021-03-31Update for DTLSv1.2 support.Theo Buehler
2021-03-31change the barrier so that fd's are always passed and received withEric Faurot
the first byte of the imsg they belong to. idea, tweaks and ok claudio@
2021-03-31Bump minors after symbol additionTheo Buehler
2021-03-31Expose various DTLSv1.2 specific functions and definesTheo Buehler
ok bcook inoguchi jsing
2021-03-31Document SSL_set_hostflags(3) and SSL_get0_peername(3)Theo Buehler
ok bcook inoguchi jsing
2021-03-31Expose SSL_set_hostflags(3) and SSL_get0_peername(3)Theo Buehler
ok bcook inoguchi jsing
2021-03-31Document SSL_use_certificate_chain_file(3)Theo Buehler
ok bcook inoguchi jsing
2021-03-31Expose SSL_use_certificate_chain_file(3)Theo Buehler
ok bcook inoguchi jsing
2021-03-31Provide missing prototype for d2i_DSAPrivateKey_fp(3)Theo Buehler
ok bcook inoguchi jsing
2021-03-31Document EVP_PKEY_new_CMAC_key(3)Theo Buehler
ok bcook inoguchi jsing
2021-03-31Provide EVP_PKEY_new_CMAC_key(3)Theo Buehler
ok bcook inoguchi jsing
2021-03-29whitespace nitsTheo Buehler