1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

20934 Commits

Author SHA1 Message Date
tb
71d39bbee0 Pull the NULL check for cmsbio into the switch
ok jsing
2023-08-22 08:59:44 +00:00
tb
6590b22d96 Plug a leak of cont in CMS_dataInit()
This and ts/ts_rsp_sign.c r1.32 were part of OpenSSL 309e73df.

ok jsing
2023-08-22 08:44:15 +00:00
tb
f78746b6b5 Plug a leak of ASN1_INTEGR in def_serial_cb()
ok jsing
2023-08-22 08:09:36 +00:00
tb
2b293404fc ec_ameth: clean up eckey_{pub,priv}_encode()
Factor eckey_param_free() out of eckey_pub_encode(). ASN1_OBJECT_free()
is not actually needed. This will be addressed later.

i2o_ECPublicKey() allocates internally if *out == NULL, so no need to do
the two-call dance. Its return value is documented to be <= 0 on error,
which is wrong in the sense that only 0 is returned. Keep using the same
check for <= 0 as everywhere else.

Set of EC_PKEY_NO_PARAMETERS after the poorly named eckey_param2type() to
avoid potential underhanded side effects.

In eckey_priv_encode(), error exits would leak pval was leaked a few times.
Avoid this and simplify using i2d's internal allocation. Reinstate the
flags in a single error path.

ok jsing
2023-08-21 09:52:30 +00:00
jsg
2880ad1582 spelling 2023-08-21 03:26:42 +00:00
jmc
00d87da49e remove "flag" from the Dv line; 2023-08-20 19:52:40 +00:00
tb
f0c5c122c1 Bump zlib version to 1.3
We have been pulling in all actual changes over the past months, so this
is only a version number bump. The relevant entries of the ChangeLog are:

  * Building using K&R (pre-ANSI) function definitions is no longer supported.
  * Fixed a bug in deflateBound() for level 0 and memLevel 9.
  * Fixed a bug when gzungetc() is used immediately after gzopen().
  * Fixed a bug when using gzflush() with a very small buffer.
  * Fixed a crash when gzsetparams() is attempted for a transparent write.

ok deraadt miod millert
2023-08-20 16:25:09 +00:00
visa
29a332bce6 Add syscall stub for kqueue1(2)
This rides previous libc minor bump.

Feedback and OK guenther@
2023-08-20 15:17:53 +00:00
schwarze
46c354aa2b Provide C11 <uchar.h>.
OK millert@.
Tested by naddy@ in a bulk and by matthieu@ in the new foot(1) port.
I originally wrote the code in 2022 at the prodding of espie@.
Using one improvement to a manual page from jmc@.
2023-08-20 15:02:50 +00:00
tb
5f814157b8 Check X509_digest() return in x509v3_cache_extensions()
On failure invalidate the cert with EXFLAG_INVALID. It's unlikely that
a cert would make it through to the end of this function without setting
the flag, but it's bad style anyway.

ok jsing
2023-08-18 08:42:41 +00:00
tb
f457475cfe sync with zlib.h
"that's fine" jmc
2023-08-18 06:08:19 +00:00
tb
0f55603f92 Sync doc comment with upstream 2023-08-18 06:08:03 +00:00
tb
6071e9ebca Garbage collect two commented abort() 2023-08-17 09:28:43 +00:00
tb
812e19bfdb Make the local ASN1_OBJECTs const
ok jsing
2023-08-17 09:27:43 +00:00
tb
b0b039deee Remove some unnecessary else branches 2023-08-17 09:26:09 +00:00
tb
a55266cc93 Remove some parents from return statements 2023-08-17 09:24:50 +00:00
tb
acdf279ede Use cmp instead of i for the result of a comparison
ok jsing
2023-08-17 09:22:56 +00:00
tb
8128758ff7 Use OBJ_cmp() instead of inlining two variants
This also avoids more undefined behavior with memcmp().

ok jsing

PS: Unsolicited advice for no one in particular: there is this awesome tool
called grep. If someone reports an issue, you might want to use it to find
more instances.
2023-08-17 09:18:21 +00:00
tb
fdad50ce2d Avoid memcmp(NULL, x, 0) in OBJ_cmp()
If a->length is 0, either a->data or b->data could be NULL and memcmp()
will rely on undefined behavior to compare them as equal. So avoid this
comparison in the first place.

ok jsing
2023-08-17 09:13:01 +00:00
jmc
0496c2bd46 add space needed in punctuation;
from josiah frentsos
2023-08-17 05:45:51 +00:00
schwarze
fb09b7fc34 add the missing entry for EVP_CIPHER_CTX_ctrl(3) to the RETURN VALUES section 2023-08-16 13:50:05 +00:00
schwarze
e0edf61682 Describe more precisely how these functions are supposed to be used,
document the control operations supported by EVP_chacha20_poly1305(3),
and add the missing STANDARDS and HISTORY sections.

This replaces all text written by Matt Caswell and all text Copyrighted
by OpenSSL in the year 2019.
2023-08-16 13:47:18 +00:00
tb
2e0be48d5a Zap extra parens 2023-08-15 18:05:15 +00:00
tb
c489c5d00c Fix typo in previous 2023-08-15 17:40:06 +00:00
tb
2c8a0eaeb0 Avoid undefined behavior with memcmp(NULL, x, 0) in ASN1_STRING_cmp()
ok jsing miod
2023-08-15 17:38:00 +00:00
tb
cb4f93b0b3 Fix bug when using gzflush() with a very small buffer.
from upstream
2023-08-15 12:18:46 +00:00
schwarze
df03c47c2b SHA-3 is not a symmetric cipher.
Fix a copy and paste mistake that Ronald Tse introduced in 2017 even
though Richard Levitte and Bernd Edlinger reviewed his commit - and that
i unwittingly copied.  Even in the OpenSSL 3 main trunk, it wasn't fixed
until 2022, and in OpenSSL-1.1.1, it is still wrong.
Unfortunately, we need to be really careful before believing anything
the OpenSSL documentation says...
2023-08-15 11:54:38 +00:00
schwarze
5918e05ca5 Import the EVP_chacha20(3) manual page from the OpenSSL 1.1 branch,
which is still under a free license, to work on it in the tree.
The required content changes have not been done yet,
i only tweaked the markup and wording so far.
2023-08-15 11:26:49 +00:00
jsing
f4c5b171ca Clean up alignment handling.
Instead of using HOST_{c2l,l2c} macros, provide and use
crypto_load_le32toh() and crypto_store_htole32(). In some cases just
use htole32() directly.

ok tb@
2023-08-15 08:39:27 +00:00
jsing
d697bab7f7 Use MD5_LONG instead of unsigned int for consistency.
ok tb@
2023-08-15 08:35:33 +00:00
jsing
5d2458649f Condition only on #ifdef MD5_ASM.
There are a bunch of unnecessary preprocessor directives - just condition
on MD5_ASM, the same as we do elsewhere.

ok tb@
2023-08-15 08:30:49 +00:00
jsing
647e24460e Inline INIT_DATA_* defines.
ok tb@
2023-08-14 15:48:16 +00:00
jsing
30c27baa19 style(9) 2023-08-14 15:26:01 +00:00
schwarze
c1b1444933 Below SEE ALSO, point to all pages documenting the evp.h sub-library, and
also point to a selection of functions from other sub-libraries that rely
on evp.h objects, in particular on EVP_CIPHER, EVP_MD, and EVP_PKEY.

While here, merge a few trivial improvements to orthography and
punctuation from the OpenSSL 1.1 branch.
2023-08-14 14:46:40 +00:00
schwarze
bed12096d7 import EVP_sha3_224(3) from the OpenSSL 1.1 branch, which is still under
a free license, tweaked by me
2023-08-14 14:22:32 +00:00
tb
b91cf01fdc Conditionally disable MSAN
from upstream
2023-08-13 12:25:12 +00:00
tb
ce5197b5c0 fix whitespace 2023-08-13 12:09:14 +00:00
jmc
65043abd8b simplify previous; 2023-08-13 10:23:26 +00:00
visa
471dbed655 kevent: Add precision and abstimer flags for EVFILT_TIMER
Add timer precision flags NOTE_SECONDS, NOTE_MSECONDS, NOTE_USECONDS
and NOTE_NSECONDS for EVFILT_TIMER. Also, add an initial implementation
of NOTE_ABSTIME timers.

Similar kevent(2) flags exist on FreeBSD, NetBSD and XNU.

Initial diff by and OK aisha@
OK mpi@
2023-08-13 08:29:28 +00:00
miod
21122c7b65 Make sure modff() returns correct values for infinities.
Reported by Willemijn Coene.
2023-08-13 06:56:10 +00:00
miod
f78f1c7c95 Make sure modf() returns correct values for infinities. While there, drop
the few assembler versions as has been done on other *BSD systems; this
function (modf) turns out to be non-trivial enough, having only one
known-to-work version is preferrable.

Reported by Willemijn Coene.
2023-08-13 06:55:37 +00:00
schwarze
7d234dcc17 document return values of the control function in EVP_MD_meth_set_ctrl(3) 2023-08-12 16:48:23 +00:00
schwarze
4d855df4d5 1. Tweak the descriptions of EVP_MD_CTX_ctrl(3), EVP_MD_CTX_set_flags(3),
EVP_MD_CTX_clear_flags(3), EVP_MD_CTX_test_flags(3), and the atrocious
EVP_MD_CTX_set_pkey_ctx(3) for precision.
2. Tweak the description of EVP_MD_type(3) and EVP_MD_CTX_type(3)
for conciseness.
3. Add a few missing HISTORY bits.
2023-08-12 16:12:19 +00:00
tb
caf6bd1d57 Fix bug when gzungetc() is used immediately after gzopen().
from upstream
2023-08-12 13:49:29 +00:00
tb
eef95d0bf4 fix typo
from upstream
2023-08-12 13:48:37 +00:00
tb
79ea67855b Remove a blatant lie about DSA_dup_DH
q is copied across since OpenSSL 31360957 which hit our tree with
OpenSSL 1.0.1c in October 2012.
2023-08-12 08:26:38 +00:00
tb
6eda6f294b The int_ prefix also leaves the ec_ameth mess
The prefixes in here are all over the place... This removes one variety.
2023-08-12 08:07:35 +00:00
tb
c5ca9a16f3 RSA's _free and _size also lose their int_ prefix 2023-08-12 08:02:43 +00:00
tb
7244e84418 Drop silly int_ prefix from _free() and _size() 2023-08-12 07:59:48 +00:00
tb
52d22fd75a Free {priv,pub}_key before assigning to it
While it isn't the case for the default implementations, custom DH and DSA
methods could conceivably populate private and public keys, which in turn
would result in leaks in the pub/priv decode methods.

ok jsing
2023-08-12 07:50:47 +00:00