tb [Fri, 17 Dec 2021 11:28:05 +0000 (11:28 +0000)]
alphabetical order is hard, tb...
tb [Fri, 17 Dec 2021 11:25:22 +0000 (11:25 +0000)]
fix indent
millert [Thu, 16 Dec 2021 19:15:29 +0000 (19:15 +0000)]
Document the failure mode if size is too small and mention that
allocating space when buf is NULL is an extension more prominently.
Clarify that getwd() is deprecated and should not be used.
Mention EFAULT errno value for invalid (non-NULL) buf.
OK deraadt@ jmc@
millert [Thu, 16 Dec 2021 19:12:43 +0000 (19:12 +0000)]
getwd(3): don't malloc space for buf if it is NULL
The 4.3BSD getwd(3) did not malloc space, use __getcwd(2) directly
so the compat function doesn't either. OK deraadt@
tb [Thu, 16 Dec 2021 17:32:51 +0000 (17:32 +0000)]
libradius: convert to HMAC_CTX on the heap
This is another fairly mechanical conversion to prepare the switch
to opaque HMAC_CTX. It adds missing error checking for the HMAC API
and uses HMAC_Init_ex() instead of the deprecated HMAC_Init().
ok jsing
tj [Thu, 16 Dec 2021 17:07:56 +0000 (17:07 +0000)]
arm64 can boot from softraid too; ok patrick
schwarze [Thu, 16 Dec 2021 16:36:16 +0000 (16:36 +0000)]
document obj_cleanup_defer(3) and check_defer(3)
bluhm [Thu, 16 Dec 2021 15:38:03 +0000 (15:38 +0000)]
Fix a tiny race in tdb_delete() between TDBF_DELETED, tdb_unlink()
and tdb_cleanspd(). gettdb...() can return a TDB before tdb_unlink().
Then ipsp_spd_lookup() could add it to tdb_policy_head after
tdb_cleanspd(). There it would stay until it hits the kassert in
tdb_free().
OK tobhe@
schwarze [Thu, 16 Dec 2021 12:26:40 +0000 (12:26 +0000)]
To ease maintenance, structure the lists of intentionally undocumented
symbols according to the reason (internal, obsolete, postponed)
and according to the header file (asn1, objects, x509, ...).
Also, add some minor tweaks needed for <openssl/objects.h>.
claudio [Thu, 16 Dec 2021 09:33:56 +0000 (09:33 +0000)]
When adding the extra 10% of space to a needed sysctl buffer use math
that is less likely to overflow the int type used. A BGP fullfeed is
now so big that this calculation overflowed and then got sign extended.
The result was for example 'route -n show' failures.
Problem identified with deraadt@
OK deraadt@ (more cleanup needed but this fix is a good start)
anton [Thu, 16 Dec 2021 08:03:17 +0000 (08:03 +0000)]
Attach com over acpi on amd64. Some hardware uses a different interrupt
assignment compared to the the legacy one supported by com over isa.
This causes the console to halt once userland takes over as no
interrupts are received. The actual address and irq can be read from
ACPI, kettenis@ already added support for arm64 which paved the way for
amd64.
Some consoles that previously attached over isa are now expected to
attach over acpi.
Thanks to patrick@ for testing on arm64.
ok kettenis@
tb [Thu, 16 Dec 2021 06:32:56 +0000 (06:32 +0000)]
unifdef TLS13_USE_LEGACY_CLIENT_AUTH
Before the TLSv1.3 stack grew client certificate support, it fell back
to the legacy stack. Proper client certificate support was added in a2k20
with a TLS13_USE_LEGACY_CLIENT_AUTH knob to provide an easy fallback in
case the new code should have a problem. This was never needed.
As ifdefed code is wont to do, this bitrotted a few months later when
the client and server methods were merged.
discussed with jsing
sashan [Thu, 16 Dec 2021 02:01:59 +0000 (02:01 +0000)]
fix zero division found by syzkaller. The sanity checks in pf(4) ioctls
are not powerful enough to detect invalid port ranges (or even invalid
rules). syzkaller does not use pfctl(8), it uses ioctl(2) to pass some
random chunk of memory as a rule to pf(4). Fix adds explicit check
for 0 divider to pf_get_transaddr(). It should make syzkaller happy
without disturbing anyone else.
OK gnezdo@
Reported-by: syzbot+d1f00da48fa717e171f3@syzkaller.appspotmail.com
deraadt [Thu, 16 Dec 2021 00:54:42 +0000 (00:54 +0000)]
pool_get w/ PR_ZERO is better than following with a bzero, because pools
hold dirty and clean memory, and can hand out the right time cheaper
ok dlg
deraadt [Thu, 16 Dec 2021 00:44:21 +0000 (00:44 +0000)]
sync
mvs [Wed, 15 Dec 2021 22:29:55 +0000 (22:29 +0000)]
Fix the argument passed to garbage collector enforce thread for
'unsopassgc' test. Also increase it's file descriptor limit.
schwarze [Wed, 15 Dec 2021 22:20:12 +0000 (22:20 +0000)]
document OBJ_new_nid(3), OBJ_add_object(3), and OBJ_create_objects(3);
mark OBJ_create_and_add_object() as intentionally undocumented
bluhm [Wed, 15 Dec 2021 21:25:55 +0000 (21:25 +0000)]
Fix whitespace.
bluhm [Wed, 15 Dec 2021 20:56:56 +0000 (20:56 +0000)]
Increase file descriptor limit for undgram_conclose test.
ok mvs@
tb [Wed, 15 Dec 2021 20:43:31 +0000 (20:43 +0000)]
include unistd.h directly rather than pulling it in via zlib's zconf.h
(needed for getdtablecount).
bluhm [Wed, 15 Dec 2021 20:41:28 +0000 (20:41 +0000)]
Fix compiler warning.
ok mvs@
schwarze [Wed, 15 Dec 2021 20:07:51 +0000 (20:07 +0000)]
Move OBJ_create(3) into its own manual page
because OBJ_nid2obj(3) is already long and
more functions related to OBJ_create(3) have to be documented.
tb [Wed, 15 Dec 2021 19:22:44 +0000 (19:22 +0000)]
grep: Add missing unistd.h and limits.h includes
Both binary.c and file.c currently pull in unistd.h via zlib's zconf.h.
binary.c uses SEEK_SET and file.c a bunch of things like close(), isatty(),
lseek(). In addition file.c needs limits.h for PATH_MAX.
ok deraadt
anton [Wed, 15 Dec 2021 18:42:38 +0000 (18:42 +0000)]
more sys/signal.h before sys/proc.h
jsing [Wed, 15 Dec 2021 18:12:10 +0000 (18:12 +0000)]
Rename asn1_lib.c to asn1_old_lib.c
This will allow us to add a new asn1_lib.c while replacing the code that is
in currently in asn1_old_lib.c.
Discussed with tb@
jsing [Wed, 15 Dec 2021 18:02:39 +0000 (18:02 +0000)]
Sync bytestring with libssl.
jsing [Wed, 15 Dec 2021 18:00:31 +0000 (18:00 +0000)]
Consolidate various ASN.1 code.
Rather than having multiple files per type (with minimal code per file),
use one file per type (a_<type>.c).
No functional change.
Discussed with tb@
jsing [Wed, 15 Dec 2021 17:57:45 +0000 (17:57 +0000)]
Use CBS_get_last_u8() to find the content type in TLSv1.3 records.
ok tb@
jsing [Wed, 15 Dec 2021 17:53:36 +0000 (17:53 +0000)]
unifdef -U CRYPTO_MDEBUG -m tasn_new.c
jsing [Wed, 15 Dec 2021 17:37:42 +0000 (17:37 +0000)]
Add coverage for CBS additions.
jsing [Wed, 15 Dec 2021 17:36:49 +0000 (17:36 +0000)]
Provide various CBS_peek_* functions.
These will be used in libcrypto.
With input from and ok tb@
jsing [Wed, 15 Dec 2021 17:30:20 +0000 (17:30 +0000)]
Provide CBS_get_u64().
This will be used in the libcrypto certificate transparency code.
ok tb@
jsing [Wed, 15 Dec 2021 17:23:34 +0000 (17:23 +0000)]
Provide CBS_get_last_u8().
This will be used in the TLSv1.3 record layer.
From BoringSSL.
ok tb@
deraadt [Wed, 15 Dec 2021 17:21:08 +0000 (17:21 +0000)]
structure pads can leak uninitialized memory to userland via copyout,
therefore the mandatory idiom is completely clearing structs before
building them for copyout -- that means ALMOST ALL STRUCTS, because
we never know when some architecture will pad a struct.. In two more
cases, the clearing wasn't performed.
from Reno Robert ZDI
ok millert bluhm
tb [Wed, 15 Dec 2021 17:06:01 +0000 (17:06 +0000)]
spamd: convert to opaque HMAC_CTX
ok jsing
schwarze [Wed, 15 Dec 2021 16:36:39 +0000 (16:36 +0000)]
Some more ASN.1 struct types that are postponed (because they are
related to templating macros) or intentionally undocumented.
Apart from NETSCAPE, PCTX, and low-level templating stuff,
all ASN.1 functions, types, and macros are now documented.
deraadt [Wed, 15 Dec 2021 16:29:29 +0000 (16:29 +0000)]
The PATH_MAX+1 bites. The PATH_MAX+1 bites. You die...
ok millert mlarkin
bluhm [Wed, 15 Dec 2021 15:58:01 +0000 (15:58 +0000)]
Syzkaller found a dereference in igmp_leavegroup() where inm->inm_rti
is NULL. It should be set in rti_fill(), but is not if malloc(9)
fails. There is no rollback after malloc failure so the field stays
uninitialized. The code is only called from ioctl, setsockopt or
a task. Malloc should wait instead of failing, otherwise syscalls
would be unreliable. While there also put an M_WAIT in the init
code. During init malloc must not fail.
OK mvs@
Reported-by: syzbot+e22326057ccf34908d78@syzkaller.appspotmail.com
visa [Wed, 15 Dec 2021 15:30:47 +0000 (15:30 +0000)]
Adjust pty and tty event filters
* Implement EVFILT_EXCEPT for ttys for HUP condition detection.
This filter is used when pollfd.events has no read/write events.
* Add HUP condition detection to filt_ptcwrite() and filt_ttywrite()
to reflect ptcpoll() and ttpoll(). Only poll(2) and select(2) can
utilize the code; kevent(2) should behave as before with EVFILT_WRITE.
* Clear EV_EOF and __EV_HUP if the EOF/HUP condition ends.
OK mpi@
schwarze [Wed, 15 Dec 2021 15:29:23 +0000 (15:29 +0000)]
Document i2c_ASN1_INTEGER(3).
While it was probably a mistake that steve@ made some i2c_*() and c2i_*()
functions public back in 2000 and while we would like to delete them from
the API, it may not be possible to delete this particular function because
in contrast to the others (which are already marked as intentionally
undocumented), this one is used by various real-world software, so for now,
explain what it does, just in case people find it in existing code.
While here, use the familiar term "byte" that we generally use
throughout all our manual pages, even though the ASN.1 standard
uses the term "octet" instead, which is more precise only in theory.
mpi [Wed, 15 Dec 2021 12:53:53 +0000 (12:53 +0000)]
Use a per-UVM object lock to serialize the lower part of the fault handler.
Like the per-amap lock the `vmobjlock' is principally used to serialized
access to objects in the fault handler to allow faults occurring on
different CPUs and different objects to be processed in parallel.
The fault handler now acquires the `vmobjlock' of a given UVM object as
soon as it finds one. For now a write-lock is always acquired even if
some operations could use a read-lock.
Every pager, corresponding to a different kind of UVM object, now expect
the UVM object to be locked and some operations, like *_get() return it
unlocked. This is enforced by assertions checking for rw_write_held().
The KERNEL_LOCK() is now pushed to the VFS boundary in the vnode pager.
To ensure the correct amap or object lock is held when modifying a page
many uvm_page* operations are now asserting for the "owner" lock.
However, fields of the "struct vm_page" are still being protected by the
global `pageqlock'. To prevent lock ordering issues with the new
`vmobjlock' and to reduce differences with NetBSD this lock is now taken
and released for each page instead of around the whole loop.
This commit does not remove the KERNEL_LOCK/UNLOCK() dance. Unlocking
will follow if there is no fallout.
Ported from NetBSD, tested by many, thanks!
ok kettenis@, kn@
jmatthew [Wed, 15 Dec 2021 11:36:40 +0000 (11:36 +0000)]
ldapd always uses O_CREAT when reopening database files, so the database
directory must be unveiled with "rwc" rather than just "rw".
ok deraadt@ mestre@
mestre [Wed, 15 Dec 2021 11:23:09 +0000 (11:23 +0000)]
restrict filesystem access with unveil(2).
this one opens the default table file "/usr/share/misc/usb_hid_usages" through
hid_start(3) from libusbhid, then `dev' (will be the fd used on the ioctls)
and finally `conf' which is the file with the actions to be monitored. `conf'
needs to be unveil(2)ed with read perms since usbhidaction(1) can run as daemon
and this file will be re-read if a SIGHUP is catched.
looks good deraadt@
mestre [Wed, 15 Dec 2021 11:21:35 +0000 (11:21 +0000)]
restrict all filesystem access with unveil(2).
hid_start(3) opens `table' through libusbhid, then usbhidctl(1) itself opens
`dev', after that it's just performing ioctls on the fd left opened by the
latter so all fs access can be disabled.
ratchov [Wed, 15 Dec 2021 08:30:34 +0000 (08:30 +0000)]
Bump pkg-config version to 1.8.1
deraadt [Wed, 15 Dec 2021 04:01:52 +0000 (04:01 +0000)]
getcwd() operates on buffers of PATH_MAX including the NUL, and the +1
is not unneccesary. Different buffer sizes are actually dangerous, though
major problems are strangely rare.
ok millert
deraadt [Wed, 15 Dec 2021 04:00:15 +0000 (04:00 +0000)]
PATH_MAX+1 rarely makes sense, and abort if this happens in the imsg.
ok jmatthew millert
deraadt [Wed, 15 Dec 2021 00:37:21 +0000 (00:37 +0000)]
typo in previous
dtucker [Tue, 14 Dec 2021 23:47:36 +0000 (23:47 +0000)]
Correct value for IPTOS_DSCP_LE since it needs to allow for the preceeding
two ECN bits. From daisuke.higashi at gmail.com via OpenSSH bz#3373,
ok claudio@, job@, djm@.
deraadt [Tue, 14 Dec 2021 21:25:27 +0000 (21:25 +0000)]
sys/param.h cleanup, mostly using MINIMUM() and <limits.h>
ok dtucker
deraadt [Tue, 14 Dec 2021 20:52:47 +0000 (20:52 +0000)]
sync
tb [Tue, 14 Dec 2021 20:37:24 +0000 (20:37 +0000)]
tweak for the generated source
schwarze [Tue, 14 Dec 2021 20:21:45 +0000 (20:21 +0000)]
more symbols that are postponed or intentionally undocumented and
some regexp tweaks; the relevant parts of asn1.h are nearing completion
schwarze [Tue, 14 Dec 2021 20:14:22 +0000 (20:14 +0000)]
forgotten .Dv macros in -column lists
schwarze [Tue, 14 Dec 2021 19:36:18 +0000 (19:36 +0000)]
add roff(7) comments listing some M_ASN1_* aliases
that are intentionally undocumented
deraadt [Tue, 14 Dec 2021 18:16:14 +0000 (18:16 +0000)]
delete incorrect comment about sys/cdefs.h
bluhm [Tue, 14 Dec 2021 17:50:37 +0000 (17:50 +0000)]
To cache lookups, the policy ipo is linked to its SA tdb. There
is also a list of SAs that belong to a policy. To make it MP safe,
protect these pointers with a mutex.
tested by Hrvoje Popovski; OK mvs@
jsing [Tue, 14 Dec 2021 17:35:21 +0000 (17:35 +0000)]
Consolidate ASN.1 universal tag type data.
There are currently three different tables in three different files that
contain information about ASN.1 universal class tag types. Range checking
is also implemented in three different places (with different
implementations).
Consolidate all of this into a single table, provide a lookup function that
deals with the range checks and wrappers to deal with specific types.
ok inoguchi@ tb@
jsing [Tue, 14 Dec 2021 17:10:02 +0000 (17:10 +0000)]
Add regress coverage for ASN1_get_object()
jsing [Tue, 14 Dec 2021 17:07:57 +0000 (17:07 +0000)]
Add regress for ASN1_tag2bit() and ASN1_tag2str()
mvs [Tue, 14 Dec 2021 16:12:48 +0000 (16:12 +0000)]
Add new 'unsopassgc' test. This test tries to beak unix(4) sockets garbage
collector and make it to clean `so_rcv' buffer of alive socket. Successful
breakage should produce kernel panic.
ok bluhm@ mpi@
mvs [Tue, 14 Dec 2021 15:57:57 +0000 (15:57 +0000)]
Move 'unixsock' test from regress/sys/kern/unixsock/ to
regress/sys/kern/unixsockets/.
ok claudio@
visa [Tue, 14 Dec 2021 15:53:42 +0000 (15:53 +0000)]
Remember to clear __EV_HUP when the other end of the FIFO has re-opened.
schwarze [Tue, 14 Dec 2021 15:46:48 +0000 (15:46 +0000)]
document the very quirky behaviour of the SMIME_OLDMIME flag
visa [Tue, 14 Dec 2021 15:32:20 +0000 (15:32 +0000)]
Cover all state checks and updates with spltty() in filt_ttyread().
schwarze [Tue, 14 Dec 2021 15:22:49 +0000 (15:22 +0000)]
new manual page SMIME_text(3)
schwarze [Tue, 14 Dec 2021 14:30:50 +0000 (14:30 +0000)]
new manual page SMIME_read_ASN1(3)
using parts of the text from SMIME_read_CMS(3) and SMIME_read_PKCS7(3)
tobhe [Tue, 14 Dec 2021 13:44:36 +0000 (13:44 +0000)]
Move raw pubkey bytes to EVP_PKEY conversion to common function.
ok markus@
jsg [Tue, 14 Dec 2021 13:32:09 +0000 (13:32 +0000)]
drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.
From Bas Nieuwenhuizen
2737d0bc21b6db199b4145e12b9f1745577d7944 in linux 5.10.y/5.10.85
b19926d4f3a660a8b76e5d989ffd1168e619a5c4 in mainline linux
jsg [Tue, 14 Dec 2021 13:29:50 +0000 (13:29 +0000)]
drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
From Yifan Zhang
f3d9114ac99f4358809f44b390b304b8b53fb4a4 in linux 5.10.y/5.10.85
afd18180c07026f94a80ff024acef5f4159084a4 in mainline linux
jsg [Tue, 14 Dec 2021 13:28:06 +0000 (13:28 +0000)]
drm/amdgpu: init iommu after amdkfd device init
From Yifan Zhang
7508a9aa65b959bbc6d9e42c9683520bddb7db0d in linux 5.10.y/5.10.85
714d9e4574d54596973ee3b0624ee4a16264d700 in mainline linux
jsg [Tue, 14 Dec 2021 13:25:51 +0000 (13:25 +0000)]
drm/amdgpu: move iommu_resume before ip init/resume
From James Zhu
ac9db04ee32f007e48cb0763784ccfadd5a21342 in linux 5.10.y/5.10.85
f02abeb0779700c308e661a412451b38962b8a0b in mainline linux
jsg [Tue, 14 Dec 2021 13:24:12 +0000 (13:24 +0000)]
drm/amdgpu: add amdgpu_amdkfd_resume_iommu
From James Zhu
fe9dca7dda61f8f3b3000df2abe88c60d1bfab93 in linux 5.10.y/5.10.85
8066008482e533e91934bee49765bf8b4a7c40db in mainline linux
jsg [Tue, 14 Dec 2021 13:22:32 +0000 (13:22 +0000)]
drm/amdkfd: separate kfd_iommu_resume from kfd_resume
From James Zhu
5d191b0976b72af5f79cf217b9b7c2f20b522a2a in linux 5.10.y/5.10.85
fefc01f042f44ede373ee66773b8238dd8fdcb55 in mainline linux
jsg [Tue, 14 Dec 2021 13:20:09 +0000 (13:20 +0000)]
drm/amd/amdkfd: adjust dummy functions' placement
From Lang Yu
46dcf66d6e7a64febe0575c62679287679dcb2b3 in linux 5.10.y/5.10.85
cd63989e0e6aa2eb66b461f2bae769e2550e47ac in mainline linux
jsg [Tue, 14 Dec 2021 12:48:15 +0000 (12:48 +0000)]
use bus_space_read_region_1() when reading bios from pci rom
Avoids 'BIOS signature incorrect 0 0' warning seen on sparc64
(where pci is mapped little endian) reported by Ted Bullock.
bluhm [Tue, 14 Dec 2021 12:37:49 +0000 (12:37 +0000)]
IO::Socket::IP non-blocking connect works a bit differently than
IO::Socket::INET6. Tweak the non-blocking for connect in the
sosplice scapy test.
kettenis [Tue, 14 Dec 2021 11:05:37 +0000 (11:05 +0000)]
Use "rng-seed" and "kaslr-seed" properties from the device tree to mix in
some extra entropy.
ok deraadt@
kettenis [Tue, 14 Dec 2021 11:01:58 +0000 (11:01 +0000)]
Don't overwrite the Raspberry Pi config.txt if it already exists.
ok sthen@, jsg@, deraadt@
patrick [Tue, 14 Dec 2021 10:48:10 +0000 (10:48 +0000)]
Implement support for selecting SGMII or SerDes mode depending on the
plugged-in SFP transceiver and for reading out transceiver information
via ifconfig(8). To read from the SFP, we need to let the card issue
I2C transfers. Additionally we need I2C to read/write to the PHY when
MDIO is not available. Depending on the SFP's supported media types
we can decide which mode to use.
This fixes hardware-initialization and link-up problems with some em(4)
Fiber NIC and SFP combinations.
Tested by dlg@ and been in snaps for quite a while
ok dlg@ jmatthew@
deraadt [Tue, 14 Dec 2021 07:20:16 +0000 (07:20 +0000)]
A better approach is to defined __CONCAT locally
deraadt [Tue, 14 Dec 2021 06:28:13 +0000 (06:28 +0000)]
sys/signal.h before sys/proc.h
deraadt [Tue, 14 Dec 2021 06:27:48 +0000 (06:27 +0000)]
MINIMUM() because of no sys/param.h
anton [Tue, 14 Dec 2021 06:26:15 +0000 (06:26 +0000)]
add missing sys/time.h include
deraadt [Tue, 14 Dec 2021 02:17:39 +0000 (02:17 +0000)]
Sigh. This sys/cdefs.h is hiding use of __CONCAT in a non-C context.
Needs some other repairs first.
chrisz [Mon, 13 Dec 2021 20:59:23 +0000 (20:59 +0000)]
add pclk clock used by dwdog(4) on RK3399
ok kettenis@
tb [Mon, 13 Dec 2021 19:47:40 +0000 (19:47 +0000)]
Fix asprintf() error check. Portable code should check the return
value for -1, not buf == NULL.
ok tobhe
tb [Mon, 13 Dec 2021 19:46:22 +0000 (19:46 +0000)]
Fix a few leaks due to X509_NAME_oneline(name, NULL, 0) dynamically
allocating a buffer.
ok tobhe
schwarze [Mon, 13 Dec 2021 18:55:22 +0000 (18:55 +0000)]
new manual page PEM_write_bio_ASN1_stream(3);
certainly not perfect, but arguably better than the even terser
PEM_write_bio_CMS_stream(3) and PEM_write_bio_PKCS7_stream(3)
deraadt [Mon, 13 Dec 2021 18:55:03 +0000 (18:55 +0000)]
sync
cheloha [Mon, 13 Dec 2021 18:33:23 +0000 (18:33 +0000)]
tee(1): increase I/O buffer size from 8KB to 64KB
64KB strikes a good balance between space and time on today's
machines. Buffers smaller than 64KB waste more time in userspace
traveling to and from the kernel. Buffers larger than 64KB do I/O a
bit faster, but the performance improvements rapidly diminish at a
steep memory cost.
Discussed with millert@ and deraadt@. Positive feedback from Geoff
Steckel.
Thread: https://marc.info/?l=openbsd-tech&m=
163737586414354&w=2
ok millert@ deraadt@
deraadt [Mon, 13 Dec 2021 18:28:39 +0000 (18:28 +0000)]
including sys/cdefs.h manually started as a result of netbsd trying to
macro-build a replacement for sccsid, and was done without any concern
for namespace damage. Unfortunately this practice started infecting
other code as others were unaware they didn't need the file.
ok millert guenther
tb [Mon, 13 Dec 2021 18:06:56 +0000 (18:06 +0000)]
Avoid a potential double free in group_free()
In the unlikely event that EC_KEY_check_key() in ec_init() fails,
the group would be freed twice: once in ec_init(), and later in
group_free().
ok tobhe
deraadt [Mon, 13 Dec 2021 18:04:28 +0000 (18:04 +0000)]
Kill sys/cdefs.h includes, because overly complicated include+macro
for a sccsid replacement scheme which results an namespace damage
is an unfair trade
ok bluhm
tb [Mon, 13 Dec 2021 17:58:41 +0000 (17:58 +0000)]
Remove the last internal use of d2i_ASN1_BOOLEAN.
From Stephen Henson, OpenSSL
564df0dd
ok jsing
jsing [Mon, 13 Dec 2021 17:56:15 +0000 (17:56 +0000)]
Clean up d2i_ASN1_BOOLEAN() and i2d_ASN1_BOOLEAN().
Convert these to templated ASN.1, given we already have ASN1_BOOLEAN_it.
ok inoguchi@ tb@
schwarze [Mon, 13 Dec 2021 17:55:53 +0000 (17:55 +0000)]
this file doesn't use anything from <stdio.h>;
in particular, NULL is also in <stdlib.h> according to the C99 standard;
"free commit" tb@
jsing [Mon, 13 Dec 2021 17:50:24 +0000 (17:50 +0000)]
Convert asn1_d2i_ex_primitive()/asn1_collect() from BUF_MEM to CBB.
With this we get simpler code, overflow checking and more sensible
memory ownership. Also switch the free_cont case to freezero() since this
could contain secrets.
ok inoguchi@ tb@
tobhe [Mon, 13 Dec 2021 17:35:34 +0000 (17:35 +0000)]
Cleanup libcrypto memory management. Remove redundant NULL checks
before calling *_free() functions. Use 'get0' functions where it
makes sense to avoid some frees.
Feedback and ok tb@
schwarze [Mon, 13 Dec 2021 17:24:39 +0000 (17:24 +0000)]
new manual page SMIME_write_ASN1(3);
still vague in various respects, but it's a start