summaryrefslogtreecommitdiff
path: root/lib/libssl/ssl_rsa.c
AgeCommit message (Collapse)Author
2023-12-30Fix two more unchecked EVP_PKEY_assign() callsTheo Buehler
In SSL{_CTX}_use_RSAPrivateKey() switch from EVP_PKEY_assign_RSA() to EVP_PKEY_set1_RSA() and hold on to the reference of the the pkey for the duration of ssl_set_pkey(). Use single exit and other minor style cleanups. ok joshua jsing
2023-07-08Hide all public symbols in libsslBob Beck
With the guentherizer 9000 ok tb@
2022-11-26Make internal header file names consistentTheo Buehler
Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
2022-08-31Recommit -r1.45 but without error checking EVP_PKEY_copy_parameters()Theo Buehler
EVP_PKEY_copy_parameters() will unconditionally fail if the pkey's ameth has no copy_params(). Obviously this is indistinguishable from actual failure... ok jsing
2022-08-31Revert r1.46. Causes fireworks in regress.Theo Buehler
2022-08-31Avoid potential NULL dereference in ssl_set_pkey()Theo Buehler
Switch from X509_get_pubkey() to X509_get0_pubkey() to avoid an unnecessary EVP_PKEY_free(). Check the return values of X509_get0_pubkey() and EVP_PKEY_copy_parameters(). If the former returns NULL, the latter will dereference NULL. CID 25020 ok jsing
2022-06-30Rename use_* to ssl_use_* for consistency.Theo Buehler
discussed with jsing
2022-06-29Make ssl_cert_add{0,1}_chain_cert() take ssl/ctxTheo Buehler
ok beck jsing
2022-06-29ssl_cert_set{0,1}_chain() take ssl/ctxTheo Buehler
ok beck jsing
2022-06-29Add a security check to ssl_set_cert()Theo Buehler
ok beck jsing
2022-06-29Make ssl_set_{cert,pkey} take an ssl/ctxTheo Buehler
ok beck jsing
2022-06-29Refactor use_certificate_chain_* to take ssl/ctx instead of a certTheo Buehler
ok beck jsing
2022-02-03Cleanup/simplify ssl_cert_type()Joel Sing
Remove the X509 argument as it is unused - this was passed so that ssl_cert_type() can get the public key from the X509 object if the EVP_PKEY argument is NULL, however this is never the case. ok tb@
2022-01-08Rename CERT to SSL_CERT and CERT_PKEY to SSL_CERT_PKEY.Joel Sing
Nearly all structs in libssl start with an SSL_ suffix, rename CERT and CERT_PKEY for consistency. ok inoguchi@ tb@
2021-11-29Stop using BIO_s_file_inernal() in libssl.Theo Buehler
BIO_s_file_internal() should never have leaked out of libcrypto, but it did. As a first step of getting rid of it, stop using it internally. ok jsing
2021-11-26Simplify two weirdly formatted pieces of code in ssl_rsa.c and stopTheo Buehler
reaching into the EVP_PKEY struct. ok inoguchi jsing
2021-10-23Unhandroll X509_up_ref()Theo Buehler
ok beck jsing
2021-06-11Indent all labels with a single space.Joel Sing
This ensures that diff reports the correct function prototype. Prompted by tb@
2021-05-16Make local header inclusion consistent.Joel Sing
Consistently include local headers in the same location, using the same grouping/sorting across all files.
2021-03-19Prepare to provide SSL_use_certificate_chain_file()Theo Buehler
This is the same as SSL_CTX_use_certificate_chain_file() but for an SSL object instead of an SSL_CTX object. remi found this in a recent librelp update, so we need to provide it. The function will be exposed in an upcoming library bump. ok inoguchi on an earlier version, input/ok jsing
2019-03-25Rework ssl_ctx_use_certificate_chain_bio() to use the CERT_PKEY chain.Joel Sing
This means that any additional CA certificates end up on the per certificate chain, rather than the single/shared extra_certs. Also simplify this code and in particular, avoid setting the return value to indicate success until we've actually succeeded. ok beck@ tb@
2018-11-08Stop pretending that a cert member in a SSL and SSL_CTX can be NULL.Joel Sing
ok beck@ tb@
2018-04-25OpenSSL started adding const to functions all over the place. Make allTheo Buehler
our libssl functions match theirs wrt const, except for BIO_f_ssl(3) which will be fixed in a later step. this went through a i386 bulk by sthen ok jsing
2017-02-07Change SSLerror() back to taking two args, with the first one being an SSL *.Bob Beck
Make a table of "function codes" which maps the internal state of the SSL * to something like a useful name so in a typical error in the connection you know in what sort of place in the handshake things happened. (instead of by arcane function name). Add SSLerrorx() for when we don't have an SSL * ok jsing@ after us both being prodded by bluhm@ to make it not terrible
2017-01-26Finish the fallout of the SSLerr->SSLerror cleanup to get rid of the uglyBob Beck
line wraps that resulted
2017-01-26Send the error function codes to rot in the depths of hell where they belongBob Beck
We leave a single funciton code (0xFFF) to say "SSL_internal" so the public API will not break, and we replace all internal use of the two argument SSL_err() with the internal only SSL_error() that only takes a reason code. ok jsing@
2017-01-24sk_pop_free() checks for NULL so do not bother doing it from the callers.Joel Sing
2017-01-23move default_passwd_cb and default_passwd_cb_userdata back intoBob Beck
the ssl_ctx from internal - these are used directly by python and openvpn and a few other things - we have the set accessors but the get accessors were added in 1.1 and these roll their own caveat OPENSSL_VERSION chickenpluckery
2017-01-23Move most of the fields in SSL_CTX to internal - the ones that remain areJoel Sing
known to be in use. ok beck@
2017-01-23Move callback function pointers and argument pointers from SSL_CTX toJoel Sing
internal. ok beck@
2016-03-11X509_free(3) is NULL-safe, so remove NULL checks before its calls.Michael McConville
ok doug@
2015-02-06Rename SSL_CTX_use_certificate_chain() to SSL_CTX_use_certificate_chain_mem().Reyk Floeter
As discussed with beck@ jsing@ and others OK beck@
2014-12-14Remove trailing whitespace.Joel Sing
2014-11-16Sort and group includes.Joel Sing
2014-09-28Add a new API function SSL_CTX_use_certificate_chain() that allows toReyk Floeter
read the PEM-encoded certificate chain from memory instead of a file. This idea is derived from an older implementation in relayd that was needed to use the function with a privep'ed process in a chroot. Now it is time to get it into LibreSSL to make the API more privsep- friendly and to make it available for other programs and the ressl library. ok jsing@ miod@
2014-07-12if (x) FOO_free(x) -> FOO_free(x).Miod Vallat
Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
2014-06-22KNF, particularly wrapped lines of calls to PEM_read_bio_FOO() andPhilip Guenther
multiline comments ok jsing@
2014-06-12tags as requested by miod and teduTheo de Raadt
2014-06-07BIO_free has an implicit NULL check, so do not bother checking for NULLJoel Sing
before calling it.
2014-05-29Any sane platform has stdio. Stop pretending we will ever use a platformBob Beck
that does not. "fire bomb" tedu@
2014-04-17always build in RSA and DSA. ok deraadt miodTed Unangst
2014-04-14First pass at applying KNF to the OpenSSL code, which almost makes itJoel Sing
readable. This pass is whitespace only and can readily be verified using tr and md5.
2014-04-13Merge conflicts; remove MacOS, Netware, OS/2, VMS and Windows build machinery.Miod Vallat
2010-10-01resolve conflicts, fix local changesDamien Miller
2008-09-06resolve conflictsDamien Miller
2005-04-29resolve conflictsDamien Miller
2003-11-11merge 0.9.7c; minor bugsfixes;Markus Friedl
API addition: ERR_release_err_state_table [make includes before you build libssl/libcrypto]
2002-09-10merge openssl-0.9.7-beta3, tested on vax by miod@Markus Friedl
2002-05-15OpenSSL 0.9.7 stable 2002 05 08 mergeBob Beck
1999-09-29OpenSSL 0.9.4 mergeBob Beck