summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2022-01-21In 1999 fd_set overflowing beyond FD_SETSIZE became enough of a problem that ITheo de Raadt
changed the entire tree to use fd_set allocation, and this manpage documented the "calloc(howmany(max+1, NFDBITS), sizeof(fd_mask))" idiom. Since then we completed converting the entire tree to poll(2), for many reasons, even ssh/sshd. Now the use of kernel-only sys/param.h-found howmany() and related macross grate on me, so it is time to recommend use of poll(2) instead. [On a related note, MacOS poll(2) is been dangerously broken for many years; that is their problem to handle as the whole ecosystem joins us in pivoting select -> poll) ok millert
2022-01-21Document EAGAIN error return, as specified by POSIX.Todd C. Miller
Our poll does not use EAGAIN but code needs to handle it for portability. OK deraadt@ visa@
2022-01-21Optimization for tiny x in cos and sinGreg Steuck
Subset of FreeBSD commit 4339c67c485f0b1f7699863fc29f6c06862d1dde: Moved the optimization for tiny x from __kernel_{cos,sin}[f](x) to {cos_sin}[f](x) so that x doesn't need to be reclassified in the "kernel" functions to determine if it is tiny (it still needs to be reclassified in the cosine case for other reasons that will go away). ... Parts of the original change were applied separately before. Suggested by kettenis@ OK mbuhl@, tested by mbuhl@ and phessler@
2022-01-21Unplug assembly implementations of trig functions on x86 platformsGreg Steuck
The same change was done by NetBSD some time back as: Disable x87 implementations of sin, cos, tan. The x87 hardware uses a bad approximation to pi for argument reduction, and consequently yields bad answers for inputs near pi or pi/2. OK mbuhl@, tested by mbuhl@ and phessler@
2022-01-21Copy cos(3) software implementation from FreeBSD-13Greg Steuck
The result passes more tests from msun suite. In particular, testacc(cos, -0.34061437849088045332L, 0.94254960031831729956L, ALL_STD_EXCEPT, FE_INEXACT); matches instead of being 1e-16 off. OK mbuhl@, tested by mbuhl@ and phessler@
2022-01-20Remove the remaining three parens in return statements.Theo Buehler
2022-01-20Use correct spelling of NULL.Theo Buehler
2022-01-20remove unused variable from all copies of _asr_strdname()Christian Weisgerber
... including those inlined into print_dname(). This also fixes -Wunused-but-set-variable warnings warnings in smtpd and smtpctl. The code was imported with asr and then copied around. ok deraadt@ guenther@
2022-01-20Add check for EVP_CIPHER_CTX_ctrlKinichiro Inoguchi
suggestion from tb@
2022-01-20Add check for EVP_CIPHER_CTX_set_key_length return valueKinichiro Inoguchi
CID 21653 ok jsing@ millert@ tb@
2022-01-20Add check for OBJ_nid2obj return valueKinichiro Inoguchi
input from tb@
2022-01-20Add check for ASN1_INTEGER_setKinichiro Inoguchi
CID 24893 ok jsing@ millert@ tb@
2022-01-20Fix check for BN_mod_inverse_ct return valueKinichiro Inoguchi
ok jsing@ millert@ tb@
2022-01-20Add check for BN_sub return valueKinichiro Inoguchi
CID 24839 ok jsing@ millert@ tb@
2022-01-20Fix check for BN_mod_inverse_ct return valueKinichiro Inoguchi
ok jsing@ millert@ tb@
2022-01-20Add check for BIO_indent return valueKinichiro Inoguchi
CID 24778 ok jsing@ millert@ tb@
2022-01-20Fix check for BN_mod_inverse_ct return valueKinichiro Inoguchi
ok jsing@ millert@ tb@
2022-01-20Fix check for BN_mod_inverse_ct return valueKinichiro Inoguchi
ok jsing@ millert@ tb@
2022-01-20Add check for BIO_indent return valueKinichiro Inoguchi
CID 24812 ok jsing@ millert@ tb@
2022-01-20Add check for EVP_CIPHER_CTX_set_key_length return valueKinichiro Inoguchi
It returns 1 on success and 0 for failure, never negative value. ok jsing@ millert@ tb@
2022-01-20Add and fix check for BN functions return valueKinichiro Inoguchi
ok jsing@ millert@ tb@
2022-01-20Add check for BN functions return valueKinichiro Inoguchi
CID 21665 24835 comment from jsing@ and tb@ ok jsing@ millert@ tb@
2022-01-20Add check for BIO_indent return valueKinichiro Inoguchi
CID 24869 ok jsing@ millert@ tb@
2021-08-18Import initial code for the SM2 cipherTheo Buehler
This adds the SM2 algorithm defined in the Chinese standards GB/T 32918.1-2016, GB/T 32918.2-2016, GB/T 32918.3-2016, GB/T 32918.4-2016 and GB/T 32918.5-2017. This is an ISC licensed implementation contributed by Ribose.inc, based on the same code that was contributed to OpenSSL by Jack Lloyd. The port to LibreSSL was done by Ronald Tse and Nickolay Olshevsky. Github PR #105 I made quite a few cleanup passes on this, but more is needed, some of which will happen in-tree before this is linked to the build. ok deraadt inoguchi (a long time ago), jsing
2022-01-19Document the bizarre fact that {CMS,PCKS7}_get0_signers() needs someTheo Buehler
freeing of what they return despite being get0 functions: the stack of X509s that they return must be freed with sk_X509_free(). The get0 thus probably refers to the individual certs, but not to the stack itself. The libcrypto and libssl APIs never cease to amaze with new traps. ok inoguchi
2022-01-19Check return value from EVP_CIPHER_CTX_new in cms_pwri.cKinichiro Inoguchi
CID 345137 ok jsing@ tb@
2022-01-19Check function return value in libtlsKinichiro Inoguchi
EVP_EncryptInit_ex, EVP_DecryptInit_ex and HMAC_Init_ex are possible to fail and return error. Error from these functions will be fatal for the callback, and I choose to return -1. SSL_CTX_set_tlsext_ticket_key_cb.3 explains the return value of callback. This also could fix Coverity CID 345319. ok jsing@ tb@
2022-01-17Update libexpat to 2.4.3. This fixes CVE-2021-45960, CVE-2021-46143,Alexander Bluhm
and CVE-2022-22822 to CVE-2022-22827. Relevant for OpenBSD are security fixes #531 #534 #532 #538 #539 and other changes #527 #513 #514 #502 #503. No library bump necessary. OK millert@
2022-01-16libfuse: fix -Wunused-but-set-variable warningChristian Weisgerber
ok tb@
2022-01-15spellingJonathan Gray
ok tb@
2022-01-15Add back an accidentally dropped .PpTheo Buehler
2022-01-15Update for HMAC_CTX_{init,cleanup} hand HMAC_cleanup removalTheo Buehler
2022-01-15Stop documenting clone digests.Theo Buehler
2022-01-15Minor cleanup and simplification in dsa_pub_encode()Theo Buehler
This function has a weird dance of allocating an ASN1_STRING in an inner scope and assigning it to a void pointer in an outer scope for passing it to X509_PUBKEY_set0_param() and ASN1_STRING_free() on error. This can be simplified and streamlined. ok inoguchi
2022-01-14Avoid buffer overflow in asn1_parse2Kinichiro Inoguchi
asn1_par.c r1.29 changed to access p[0] directly, and this pointer could be overrun since ASN1_get_object advances pointer to the first content octet. In case invalid ASN1 Boolean data, it has length but no content, I thought this could be happen. Adding check p with tot (diff below) will avoid this failure. Reported by oss-fuzz 43633 and 43648(later) ok tb@
2022-01-14bump libcrypto, libssl, libtls majors after struct visibility changesTheo Buehler
and Symbol addition and removal in libcrypto.
2022-01-14Use the correct type for ssl_callback_ctrl()Theo Buehler
2022-01-14Convert the new record layers to opaque EVP_AEAD_CTXTheo Buehler
ok jsing
2022-01-14Convert ssl_kex.c to opaque DHTheo Buehler
Stop reaching into DH internals and use the new API functions instead. ok inoguchi jsing
2022-01-14Use BIO_next/BIO_set_next in ssl_lib.cTheo Buehler
Trivial conversion to cope with opaque BIO.
2022-01-14bio_ssl.c needs to peek into bio_local.hTheo Buehler
2022-01-14libkeynote: fix build with opaque RSA and DSATheo Buehler
This is a completely mechanical conversion to use accessors instead of reaching inside the structs by hand. ok millert
2022-01-14Update Symbols.listTheo Buehler
ok inoguchi
2022-01-14Unconditionally comment out OPENSSL_NO_RFC3779Theo Buehler
ok inoguchi jsing
2022-01-14Remove header guard around RFC 3779 declarationsTheo Buehler
ok inoguchi jsing
2022-01-14Expose Certificate Transparency symbols in headersTheo Buehler
ok inoguchi jsing
2022-01-14Hide OBJ_bsearch_ from public visibility,Theo Buehler
This removes OBJ_bsearch_ex_() from the exported symbols and makes OBJ_bsearch_() semi-private. It is still used in libssl. While here, remove some hideous unused macros ok inoguchi jsing
2022-01-14Move ASN1_BOOLEAN to internal only.Theo Buehler
This moves {d2i,i2d}_ASN1_BOOLEAN() to internal only. They are unused, but help us testing the encoding. ok jsing
2022-01-14Remove check_defer and obj_cleanup_defer from public visibilityTheo Buehler
ok inoguchi jsing
2022-01-14Remove name_cmp from public visibilityTheo Buehler
ok inoguchi jsing