IABSD.fr/src/lib

Branch :


Log

Author Commit Date CI Message
a37af58c 2020-07-16 20:08:12 Remove obsolete LOCALE_HOME code we have never used (and never will). Upstream removed it in 2004. From Jan Stary.
22966de3 2020-07-16 17:47:09 allow setenv LIBC_NOUSERTC to disable userland timekeeping, for ktrace. ok deraadt pirofti
c4e156dd 2020-07-15 22:58:33 Userland timecounter implementation for arm64. ok naddy@
30342cdf 2020-07-14 18:55:59 Dedup the use legacy stack code. ok inoguchi@ tb@
a759cde3 2020-07-14 18:47:50 Revert the TLSv1.3 version switching fix/hack. This is no longer necessary since the TLS_method() now supports TLSv1.3. Reverts r1.211 of ssl_lib.c. ok beck@ inoguchi@ tb@
874055c7 2020-07-14 16:48:13 Fix TIB/TCB on powerpc64. Some bright sould decided that the TCB should be 8 bytes in the 64-bit ABI just like in the 32-bit ABI. But that means there is no "spare" word in the TCB that we can use to store a pointer to our struct pthread. So we have to treat powerpc64 special. Also recognize that the thread pointer points 0x7000 bytes after the TCB. Since the TCB is 8 bytes this means that TCB_OFFSET should be 0x7008. Pointed out by guenther@; ok deraadt@
2f959527 2020-07-11 16:24:37 Add usertc.c.
42ac4c7b 2020-07-11 16:21:29 Add missing usertc.c file.
fc72f1bd 2020-07-10 17:04:18 adjust %n description to vaguely say "pointer", becuase the following list of "[size]n" includes "n" on it's own, thereby the "int" case is described correctly. ok schwarze
84fb3e49 2020-07-10 14:43:18 As suggested by deraadt@, rewrite most of the printf(3) manual page to properly show the (differing) syntaxes of all the conversion specifications, and reduce the amount of forward references from the list of modifiers to the list of specifiers. While here, properly explain %lc and %ls. Also correct RETURN VALUES, which incorrectly talked about counting characters while actually bytes are counted. Using feedback from millert@, deraadt@, tb@, and Martin Vahlensieck. OK deraadt@, millert@, and tb@ on intermediate versions of this diff and no objections from jmc@.
2a049e6c 2020-07-09 22:13:29 The fegetexceptflag() function should not have a DEF_STD. Brings arm64 in line with all the other architectures. ok millert@
69657d9a 2020-07-09 02:17:07 adjfreq(2): limit adjustment to [-500000, +500000] ppm When we recompute the scaling factor during tc_windup() there is an opportunity for arithmetic overflow if the active timecounter's adjfreq(2) adjustment is too large. If we limit the adjustment to [-500000, +500000] ppm the statement in question cannot overflow. In particular, we are concerned with the following bit of code: scale = (u_int64_t)1 << 63; scale += \ ((th->th_adjustment + th->th_counter->tc_freq_adj) / 1024) * 2199; scale /= th->th_counter->tc_frequency; th->th_scale = scale * 2; where scale is an int64_t. Overflow when we do: scale += (...) / 1024 * 2199; as th->th_counter->tc_freq_adj is currently unbounded. th->th_adjustment is limited to [-5000ppm, 5000ppm]. To see that overflow is prevented with the new bounds, consider the new edge case where th->th_counter->tc_freq_adj is 500000ppm and th->th_adjustment is 5000ppm. Both are of type int64_t. We have: int64_t th_adjustment = (5000 * 1000) << 32; /* 21474836480000000 */ int64_t tc_freq_adj = 500000000LL << 32; /* 2147483648000000000 */ scale = (u_int64_t)1 << 63; /* 9223372036854775808 */ scale += (th_adjustment + tc_freq_adj) / 1024 * 2199; /* scale += 2168958484480000000 / 1024 * 2199; */ /* scale += 4657753620480000000; */ 9223372036854775808 + 4657753620480000000 = 13881125657334775808, which less than 18446744073709551616, so we don't have overflow. On the opposite end, if th->th_counter->tc_freq_adj is -500000ppm and th->th_adjustment is -5000ppm we would have -4657753620480000000. 9223372036854775808 - 4657753620480000000 = 4565618416374775808. Again, no overflow. 500000ppm and -500000ppm are extreme adjustments. otto@ says ntpd(8) would never arrive at them naturally, so we are not at risk of breaking a working setup by imposing these restrictions. Documentation input from kettenis@. No complaints from otto@.
de43b1a9 2020-07-08 09:20:28 Userland timecounter implementation for sparc64. ok deraadt@, pirofti@
c8437fb9 2020-07-08 09:17:48 Clean up the amd64 userland timecounter implementation a bit: * We don't need TC_LAST * Make internal functions static to avoid namespace pollution in libc.a * Use a switch statement to harmonize with architectures providing multiple timecounters ok deraadt@, pirofti@
25aa477e 2020-07-07 19:31:11 Remove some unnecessary function pointers from SSL_METHOD_INTERNAL. ssl_version is completely unused and get_timeout is the same everywhere. ok beck@ inoguchi@ tb@
94149d15 2020-07-07 19:24:23 Enable TLSv1.3 for the generic TLS_method(). This can be done now that we have both TLSv1.3 client and server. ok beck@ inoguchi@ tb@
e571446a 2020-07-06 17:24:59 Minor tweaks in the description of %g: 1. Clarify that %G uses %F, not %f; noticed by millert@. 2. Mention that %g originally meant "general notation", see: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc/stdio/doprnt.s Triggered by a somewhat different patch from Ian <ropers at gmail dot com>. Feedback and OK millert@ and jmc@.
d82e6535 2020-07-06 13:33:05 Add support for timeconting in userland. This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
accddc9b 2020-07-03 07:17:26 zap trailing whitespace on one line
c54b8396 2020-07-03 04:51:59 Make the message type available to the extension functions Some TLS extensions need to be treated differently depending on the handshake message they appear in. Over time, various workarounds and hacks were used to deal with the unavailability of the message type in these functions, but this is getting fragile and unwieldy. Having the message type available will enable us to clean this code up and will allow simple fixes for a number of bugs in our handling of the status_request extension reported by Michael Forney. This approach was suggested a while ago by jsing. ok beck jsing
9b8a142f 2020-07-03 04:12:50 Improve argument order for the internal tlsext API Move is_server and msg_type right after the SSL object so that CBS and CBB and alert come last. This brings these functions more in line with other internal functions and separates state from data. requested by jsing
b1b45171 2020-07-02 08:59:45 Use a relative branch to jump from setjmp(3) into _setjmp(4). Use correct register to reference the location where we store CR.
f0038c0c 2020-06-30 11:12:07 Add missing comparison instruction. Load %r12 with the indirect branch address to load the correct TOC address.
29ce189c 2020-06-29 15:32:44 Disable assembly code for powerpc64; more work is needed to make it work.
50857149 2020-06-29 15:30:58 Use C versions of bcopy(3) and memmove(3) for now as the assembly version of bcopy(9) doesn't work in its current state. ok deraadt@
d37bd831 2020-06-28 11:53:20 Use std instead of stw to store CR since we use std in sigsetjmp(3) and we use ld to load it again in longjmp(3).
558cf89c 2020-06-28 09:46:58 Add stub implementation; derived from kvm_sh.c which has our preferred copyright license.
fd50b86c 2020-06-28 09:45:12 Fix grammar in comment.
f1bf7a74 2020-06-28 08:22:57 Add powerpc64 support.
c931458e 2020-06-28 08:19:34 Add powerpc64 fenv bits; copied from powerpc. From drahn@
23ce8031 2020-06-28 07:50:57 Switch back to bn_mul_mont_int since the bn_mul_mont_fpu64 code isn't hooked up and the lack of a bn_mul_mont_int implementation results in undefined references.
2b1283e1 2020-06-28 07:31:05 Add dummy getWCookie() implementation for powerpc64. From drahn@
0d572986 2020-06-28 07:15:30 The 2nd and 3rd argument are pointers, so use the appropriate doubleword instructions. ok drahn@
803610b3 2020-06-28 05:39:30 Use .Dv for SIOCTL_SEL, as we do for all other macros
4f3fcc39 2020-06-28 05:21:38 Allow switching between alternate devices (-F option) with sndioctl(1)
49f67e12 2020-06-28 05:17:25 Add a new SIOCTL_SEL control type to select one of a predefined set of mutually exclusive values. It's the same as SIOCTL_LIST except that exactly one list element may be selected.
7bccb200 2020-06-27 18:35:07 Prevent the use of jump tables on powerpc64 as well. ok patrick@, drahn@
8e16d6cc 2020-06-27 14:18:42 Add missing label.
08b16776 2020-06-26 20:16:21 Provide an optimized implementation of ffs(3) in libc on aarch64/powerpc/powerpc64, making use of the count leading zeros instruction. Also add a brief regression test. ok deraadt@ kettenis@
6becf282 2020-06-26 19:57:02 Fix powerpc64 pie binraries, in register renumbering one line was missed.
bfccc37d 2020-06-26 17:58:45 Fix TCB_OFFSET_ERRNO. Adjust comments to reflect that powerpc64 uses %r13 as the per-thread register. ok patrick@, drahn@
43b3e2c9 2020-06-26 10:31:44 Avoid "bare" register numbers.
5fe86291 2020-06-26 00:39:59 Accidentally doubled these files on first commit. Correcting.
602083f5 2020-06-25 12:20:17 Add missing kvm_dump(3) and kvm_getfiles(3) under SEE ALSO for completeness
2c901073 2020-06-25 07:35:05 Switch the order of the two tests in tls13_client_hello_required_extensions to match the order they are listed in the RFC. No functional change.
f809d9d9 2020-06-25 04:29:08 Intial attempt at powerpc64 libcrypto pieces. just commit this kettenis@
8bf96a7f 2020-06-25 04:11:59 disable altivec and vsx as it causes issues in qemu testing. This probably should be backed out after fully debugged, vector instructions caused problems with debug configuration.
530257c2 2020-06-25 04:09:39 PowerPC64 startup code. Determine location of toc based on PC relative location and load into %r2
9674f442 2020-06-25 02:38:28 PowerPC64 libc powerpc sys files Initial attempt to port powerpc code to powerpc64 Expects TOC loading in ENTRY(), ok kettenis@ (some cleanup required)
c020cf82 2020-06-25 02:34:22 PowerPC64 libc string/net files Initial attempt to port powerpc code to powerpc64 Expects TOC loading in ENTRY(), memmove.S is the powerpc 32 bit, optimization is possible for 64 bit and handle len of > 32 bits.
fff88b56 2020-06-25 02:30:49 *** empty log message ***
de9a41e9 2020-06-25 02:28:33 PowerPC64 libc/arch/powerpc/gdtoa files This is a almost a direct copy from powerpc with 64 bit mods, with two additions present in 64 arch. NOTE: long double 128 is not supported currently.
ff8a0eac 2020-06-25 02:22:31 Committed wrong version of file, atomic_lock is 32 bit.
e11d2af5 2020-06-25 02:03:55 PowerPC64 libc gen files Initial attempt to port powerpc code to powerpc64 Expects TOC loading in ENTRY(), ok kettenis@
b074422e 2020-06-25 01:59:27 PowerPC64 libc (libc powerpc top) Expects ELFv2 TOC loading in ENTRY(), build with -gdwarf-4 Split SYS.h into SYS.h and DEFS.h fix tabs after #define
cac24cfe 2020-06-24 19:55:54 Properly document the return values of EVP_PKEY_base_id(3) and EVP_PKEY_id(3), then describe the "type" parameters of various functions more precisely referencing that information. In particular, document X509_get_signature_type(3) which was so far missing. OK tb@
16cb9001 2020-06-24 18:15:00 use n-bit <noun> consistently; ok schwarze for the principal of the idea, and for flagging which pages to check;
3b4c6944 2020-06-24 18:04:33 Make tls13_legacy_shutdown() match ssl3_shutdown() semantics. When first called, queue and send a close notify, before returning 0 or 1 to indicate if a close notify has already been received from the peer. If called again only attempt to read a close notify if there is no pending application data and only read one record from the wire. In particular, this avoids continuing to read application data where the peer continues to send application data. Issue noted by naddy@ with ftp(1). ok jca@ tb@
91e08411 2020-06-24 17:00:38 new manual page ChaCha(3); OK tb@
3ae3305b 2020-06-24 16:06:26 new manual page CMAC_Init(3); OK tb@
7126dfd8 2020-06-24 14:59:41 Document eight additional pre-OpenSSL-1.1 accessor functions that are still widely used according to code searches on the web, so people reading existing code will occasionally want to look them up. While here, correct the return type of X509_CRL_get0_lastUpdate(3) and X509_CRL_get0_nextUpdate(3), which return const pointers. Also, add some precision regarding RETURN VALUES.
56fdfbb6 2020-06-24 07:28:38 Enforce restrictions for ClientHello extensions RFC 8446 section 9.2 imposes some requirements on the extensions sent in the ClientHello: key_share and supported_groups must either both be present or both be absent. If no pre_shared_key was sent, the CH must contain both signature_algorithms and supported_groups. If either of these conditions is violated, servers must abort the handshake with a missing_extensions alert. Add a function that enforces this. If we are going to enforce that clients send an SNI, we can also do this in this function. Fixes failing test case in tlsfuzzer's test-tls13-keyshare-omitted.py ok beck inoguchi jsing
bc0ee81f 2020-06-22 13:42:06 spelling fix;
7ab02df9 2020-06-22 13:14:32 Extend kqueue interface with EVFILT_EXCEPT filter. This filter, already implemented in macOS and Dragonfly BSD, returns exceptional conditions like the reception of out-of-band data. The functionnality is similar to poll(2)'s POLLPRI & POLLRDBAND and it can be used by the kqfilter-based poll & select implementation. ok millert@ on a previous version, ok visa@
c4b445c6 2020-06-20 09:26:54 basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields, avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises
64aa3d5e 2020-06-20 08:41:37 add missing ENVIRONMENT. HISTORY, and AUTHORS sections, and a few other wording and markup improvements while here; OK jmc@ ratchov@
47f04e97 2020-06-19 21:26:40 We inherited the constant time CBC padding removal from BoringSSL, but missed a subsequent fix for an off-by-one in that code. If the first byte of a CBC padding of length 255 is mangled, we don't detect that. Adam Langley's BoringSSL commit 80842bdb44855dd7f1dde64a3fa9f4e782310fc7 Fixes the failing tlsfuzzer lucky 13 test case. ok beck inoguchi
0ff6b527 2020-06-19 17:17:13 mark the functions documented in des_read_pw(3) as deprecated and point to UI_UTIL_read_pw(3) instead; tb@ agrees with the general direction
ee8bd990 2020-06-19 14:31:29 document X509_get0_pubkey_bitstr(3), correct the description of X509_get_X509_PUBKEY(3), document error handling of the read accessors, and mention the relevant STANDARDS
bdc03493 2020-06-19 14:04:25 document error handling of X509_PUBKEY_get0(3) and X509_PUBKEY_get(3)
a560d792 2020-06-19 12:01:20 Merge documentation of X509_get0_serialNumber(3) from OpenSSL-1.1.1 which is still under a free license. Wording tweaked by me.
e04d4d7c 2020-06-18 16:21:28 uint8_t is a discrete, not a continuous type, and some other wording improvements with respect to types; OK ratchov@
d03c2a24 2020-06-18 14:49:46 Many of these functions have several arguments, and some arguments are very long (function pointers), such that a number of input lines in the SYNOPSIS do not fit into 80 columns. Consequently, consistently use .Fo/.Fa/.Fc rather than .Fn for better readability of the source code. Mechanical diff, no output change.
8fe8d172 2020-06-18 14:38:21 basic macro cleanup, and reword two phrases about closed intervals of integers for clarity and to read better; one of the issues (abuse of .Sm) was originally reported by jmc@; ok jmc@ ratchov@
99f201b8 2020-06-18 04:45:03 Document sioctl_desc structure maxval attribute
6f9afa35 2020-06-15 15:25:46 Document EVP_read_pw_string_min(3) Add detailed information on the return values of all the functions in this page and remove the previous incorrect information. tweaks & ok schwarze
eb87f619 2020-06-15 14:13:14 Document PEM_def_callback(3). Move pem_password_cb(3) to the file PEM_read(3) and rewrite its description from scratch for precision and conciseness. Plus some minor improvements in the vicinity. Tweaks and OK tb@.
a926fd0d 2020-06-12 18:16:13 add my Copyright and license, which i forgot when adding a significant amount of text, the ERRORS section, in the previous commit
ffc9b523 2020-06-12 12:15:59 add a comment saying that name_cmp() is intentionally undocumented; tb@ agrees that it should not be part of the public API
60f0d397 2020-06-12 11:37:42 document PEM_ASN1_read(3) and PEM_ASN1_read_bio(3); tweaks and OK tb@
bbd7d2d5 2020-06-11 18:03:19 wording tweaks from ross l richardson and tb; ok tb
aa24f0a9 2020-06-10 11:43:07 document PKCS7_get_signer_info(3)
e79ef3ff 2020-06-10 11:39:12 describe six more PKCS7 attribute functions
4d97159a 2020-06-09 16:53:52 The check_includes step is incorrect dependency management model for how our tree gets built. If this was done in all the libraries (imagine sys/dev), it would disrupt the development process hugely. So it should not be done here either. use 'make includes' by hand instead.
30d3f3d9 2020-06-07 16:16:01 In the libc resolver function asr_run(), clear the result buffer everytime, because there are callers who were inspecting unrelated fields. discussion with eric, otto, solution from semarie this is errata 6.6/031_asr and 6.7/009_asr
095832a3 2020-06-06 01:40:08 Implement a rolling hash of the ClientHello message, Enforce RFC 8446 section 4.1.2 to ensure subsequent ClientHello messages after a HelloRetryRequest messages must be unchanged from the initial ClientHello. ok tb@ jsing@
1185c690 2020-06-05 19:50:59 Remove redundant code Reported by Prof. Dr. Steffen Wendzel <wendzel @ hs-worms . de>, thanks! OK martijn@ sthen@
f72711c6 2020-06-05 18:44:42 Add a custom copy handler for AES key wrap This is necessary because ctx->cipher_data is an EVP_AES_WRAP_CTX containing a pointer to ctx->iv. EVP_CIPHER_CTX_copy() uses memcpy to copy cipher_data to the target struct. The result is that the copy contains a pointer to the wrong struct, which then leads to a use-after-free. The custom copy handler fixes things up to avoid that. Issue reported by Guido Vranken ok beck inoguchi jsing
22c2c18e 2020-06-05 18:14:05 Use IANA allocated GOST ClientCertificateTypes. IANA has allocated numbers for GOST ClientCertificateType. Use them in addition to private values (left in place for compatibility). Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux ok inoguchi@ tb@
a431b810 2020-06-05 17:58:32 Stop sending GOST R 34.10-94 as a CertificateType. GOST R 34.10-94 is an obsolete certificate type, unsupported by LibreSSL and by the rest of current software, so there is no point in sending in the CertificateTypes. Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux ok inoguchi@ tb@
c18d223a 2020-06-05 17:55:24 Handle GOST in ssl_cert_dup(). Add missing case entry for SSL_PKEY_GOST01. Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux ok inoguchi@ tb@
c2a7ee20 2020-06-05 17:53:26 Enable GOST_SIG_FORMAT_RS_LE when verifying certificate signatures. GOST cipher suites requires that CertVerify signatures be generated in a special way (see ssl3_send_client_kex_gost(), ssl3_get_cert_verify()). However, the GOST_SIG_FORMAT_RS_LE flag was not passed in case of TLS 1.2 connections (because they use different code path). Set this flag on GOST PKEYs. Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux ok inoguchi@ tb@
0dc17585 2020-06-05 17:30:41 Allow GOST R 34.11-2012 in PBE/PBKDF2/PKCS#5. Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux ok inoguchi@ tb@
76029c8d 2020-06-05 17:28:56 Add OIDs for HMAC using Streebog (GOST R 34.11-2012) hash function. Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux ok inoguchi@ tb@
fc5da517 2020-06-05 17:17:22 Add a few more errors to help debugging. Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux. ok inoguchi@ tb@
5a4e9db7 2020-06-05 17:12:09 Add support for additional GOST curves. These GOST curves are defined in RFC 7836 and draft-deremin-rfc4491-bis. Add aliases for 256-bit GOST curves (see draft-smyshlyaev-tls12-gost-suites) and rename the 512-bit curve ids to follow names defined in tc26 OID registry. Diff from Dmitry Baryshkov <dbaryshkov@gmail.com> Sponsored by ROSA Linux. ok inoguchi@
7de7a297 2020-06-05 16:51:12 Remove remaining error *_str_functs[] A number of years ago we dropped the concept of having function names in errors, since it is not that useful and very quickly gets out of sync when refactoring. It would seem that some new ones got imported and some missed the last clean up. ok tb@ beck@ "kill it with fire"
ef38f05c 2020-06-05 15:51:49 Apply some style(9).
d0995e10 2020-06-05 15:28:33 One error file per directory is plenty.
63aecb60 2020-06-05 00:51:56 HID parser could overflow if a malicious device (potentially USB) provided too many PUSH. report from Andy Nguyen @ google. fix by jcs from kernel hid.c rev 1.3