summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_transcript.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-11-05Streamline and shorten x509_object_cmp() a bit.tb1-11/+6
ok jsing
2021-11-05Drop a bunch of unnecesary parentheses and unify the order in whichtb1-17/+13
callbacks are called. ok jsing
2021-11-05Cleanup X509_LOOKUP_new()tb1-12/+11
Switch from malloc() to calloc() and drop a bunch of initializations to 0. Call the returned object lu instead of the generic ret. ok jsing
2021-11-05Garbage collect xobj->data.{ptr,pkey}tb2-8/+6
Both these are essentially unused. Remove the last use of data.ptr by initializing and copying the X509_OBJECT using memset() and struct assignment in X509_STORE_CTX_get_subject_by_name() and add a missing error check for X509_OBJECT_up_ref_count() while there. ok beck
2021-11-04Cache sha512 hash and parsed not_before and not_after with X509 cert.beck9-135/+149
Replace sha1 hash use with sha512 for certificate comparisons internal to the library. use the cached sha512 for the validator's verification cache. Reduces our recomputation of hashes, and heavy use of time1 time conversion functions noticed bu claudio@ in rpki client. ok jsing@ tb@
2021-11-03document d2i_X509_ALGORS(3) and i2d_X509_ALGORS(3)schwarze1-5/+36
2021-11-03Fix five bugs in X509_REQ_to_X509(3):schwarze1-11/+12
* memory leak in X509_set_subject_name(ret, X509_NAME_dup(xn)); * memory leak in X509_set_issuer_name(ret, X509_NAME_dup(xn)); * memory leak in X509_set_pubkey(ret, X509_REQ_get_pubkey(r)); * missing return value check of X509_REQ_get_pubkey(r); * missing return value check of X509_set_pubkey(...); Some of these bugs have survived for twenty-five years. I noticed the first two bugs while documenting the function, then found that a commit in the OpenSSL 1.1.1 branch, which is still under a free license, fixed all of them in 2016. In the function X509_REQ_to_X509(3), merge everything worth merging from OpenSSL 1.1.1, in particular the relevant parts of: * 222561fe Apr 30 17:33:59 2015 -0400 (err: label cleanup) * 0517538d Mar 17 00:15:48 2016 +0100 (the bugfix) * c5137473 Apr 3 23:37:32 2016 +0200 (code simplification) While here, delete some commented out code that is wrong in multiple ways and untouched since the SSLeay era. One code tweak for readability by tb@, and OK tb@.
2021-11-03Fix ASN1_TIME_diff() with NULL timestb1-3/+18
The ASN1_TIME_diff() API accepts NULL ASN1_TIMEs and interprets them as "now". This is used in sysutils/monit, as found by semarie with a crash after update. Implement this behavior by porting a version of ASN1_TIME_to_tm() to LibreSSL and using it in ASN1_TIME_diff(). Tested by semarie ok beck jsing semarie
2021-11-03Some cleanup in X509_REQ_get_extensions(3), no functional change.schwarze1-10/+6
In this function, merge everything that is worth merging from the OpenSSL 1.1.1 branch, which is still under a free license, mostly the relevant part of commit 9b0a4531 Mar 14 23:48:47 2015 +0000 to use X509_ATTRIBUTE_get0_type(3) rather than re-implementing it. While here, * use d2i_X509_EXTENSIONS(3) rather than ASN1_item_d2i(3); * test pointers explicitly against NULL, not with '!', as suggested by tb@; * drop some useless parentheses as suggested by tb@. OK tb@
2021-11-03Test adding extensions to certification requests.schwarze2-2/+167
Related to the bugfixes in x509_req.c rev. 1.25. OK tb@.
2021-11-03Fix two bugs in X509_REQ_add_extensions_nid(3)schwarze1-32/+13
that i noticed while documneting the function: * missing return value check for ASN1_item_i2d(3) and * missing return value check for OBJ_nid2obj(3). In the function X509_REQ_add_extensions_nid(3), merge everything that is worth merging from the OpenSSL 1.1.1 branch, which is still under a free license; that's mostly parts of the commit 9b0a4531 Mar 14 23:48:47 2015 +0000 (containing the bugfix, even though the OpenSSL commit message did not mention the bugs) and some minor stylistic changes from 0f113f3e and 26a7d938. While here, use i2d_X509_EXTENSIONS(3) instead of the layer-violating call to ASN1_item_i2d(3), and include a few stylistic tweaks from tb@. OK tb@, and jsing@ agreed on the general direction.
2021-11-02Add regress that calls SSL_set_tlsext_host_name() with a NULL host name.jsing1-1/+15
2021-11-02Do not take the strlen() of a NULL name. Defer the CBS_init() to later.tb1-3/+3
Found the hard way by sthen. ok sthen
2021-11-01Move the now internal X.509-related structs into x509_lcl.h.tb72-451/+521
Garbage collect the now unused LIBRESSL_CRYPTO_INTERNAL and LIBRESSL_OPAQUE_X509. Include "x509_lcl.h" where needed and fix a couple of unnecessary reacharounds. ok jsing
2021-11-01In X509_STORE_CTX_get_obj_from_subject() rename X509_OBJECT fromtb1-6/+6
the generic 'ret' to obj' in X509. Requested by jsing
2021-11-01Ensure SSL_set_tlsext_host_name() is given a valid hostname.jsing1-3/+8
ok inoguchi@ tb@
2021-11-01Rework SNI hostname regress to be table driven.jsing1-62/+147
Also adjust for the changes to tlsext_sni_is_valid_hostname() and include tests for IPv4 and IPv6 literals. ok beck@
2021-11-01Improve SNI hostname validation.jsing2-9/+54
For some time now we've validated the hostname provided to the server in the SNI extension. Per RFC 6066, an IP literal is invalid as a hostname - the current code rejects IPv6 literals, but allows IPv4 literals through. Improve this check to explicitly detect both IPv4 and IPv6 literals. Some software has been historically known to include IP literals in SNI, so rather than rejecting this outright (and failing with a decode error), pretend that the SNI extension does not exist (such that we do not break some older clients). ok inoguchi@ tb@
2021-11-01Rework x509attribute regress test in such a way that it doesn't needtb1-11/+7
to reach into opaque structs.
2021-11-01Unifdef LIBRESSL_NEW_API. Now that the library is bumped, this istb11-60/+10
no longer needed. ok jsing
2021-10-31Enable RFC 3779 code.tb1-1/+1
From job. Discussed at length with beck, claudio, job during h2k21
2021-10-31Make this test compile again after the damage done in libcryptotb1-19/+20
2021-10-31Hide struct internals under LIBRESSL_CRYPTO_INTERNAL so that othertb3-19/+19
parts of LibreSSL can no longer reach into them. discussed with beck, jsing
2021-10-31Various minor adjustments to make openssl(1) compile with opaquetb3-12/+23
structs in X509.
2021-10-31Bump majors after struct visibility changes, symbol removal and symboltb3-3/+3
addition.
2021-10-31Simplify some code by using X509_STORE_CTX_get_obj_by_subject()tb1-8/+8
ok beck jsing
2021-10-31Update Symbols.list to include API additionstb1-0/+10
2021-10-31libssl: stop reaching into the X509 struct and simplify some code bytb2-24/+6
using X509_get_key_usage(). ok beck jsing
2021-10-31Update Symbols.list for new API and API removal/renamingtb1-10/+33
2021-10-31Expose new API in headers and make X509 structs opaque.tb1-0/+3
2021-10-31Remove the unused X509_OBJECTS struct.tb1-8/+1
ok beck jsing
2021-10-31Remove the unused X509_CERT_PAIR struct and the assicated API.tb4-99/+4
ok beck jsing
2021-10-31Remove the unused X509_CERT_FILE_CTX struct.tb1-9/+1
ok beck jsing
2021-10-31Prepare to provide X509_STORE_CTX_get_obj_by_subject(), a wrappertb2-2/+22
around X509_STORE_get_by_subject() that eliminates the need of allocating an object on the heap by hand. ok beck inoguchi jsing
2021-10-31Switch various X509 API to use the new X509_LOOKUP_TYPE to matchtb2-29/+32
OpenSSL's signatures. ok beck inoguchi jsing
2021-10-31Provide the X509_LOOKUP_TYPE enum.tb1-6/+6
Remove the now unused X509_LU_{RETRY,FAIL,PKEY}. ok beck inoguchi jsing
2021-10-31Prepare definitions X509_STORE_set_verify{,_cb}_func() that work withtb1-3/+8
opaque structs. ok beck inoguchi jsing
2021-10-31Prepare to make various structs in x509_vfy.h opaque.tb1-26/+37
ok beck inoguchi jsing
2021-10-31Prepare regress for opaque structs in x509*.htb4-25/+18
2021-10-31Add explicit CBS_contains_zero_byte() check in CBS_strdup().jsing1-1/+6
If the CBS data contains a zero byte, then CBS_strdup() is only going to return part of the data - add an explicit CBS_contains_zero_byte() and treat such data as an error case. ok tb@
2021-10-30new manual page X509_CRL_METHOD_new(3)schwarze6-14/+245
documenting five functions to customize CRL handling
2021-10-29In x509/x509_purp.c rev. 1.11, tb@ fixed X509_check_purpose(3)schwarze1-8/+18
to fail if parsing of a certificate extension failed. Adjust the documentation accordingly. OK tb@
2021-10-29Actually error in X509_check_purpose() if x509v3_cache_extensions()tb1-2/+2
indicates failure. The previous "error return" X509_V_ERR_UNSPECIFIED translates to 1, i.e., success. This changes to the intended behavior of x509_purp.c r1.3 and matches OpenSSL. This will need various adjustments in the documentation. ok jsing
2021-10-29document the horrifying function X509_TRUST_set_default(3)schwarze1-3/+43
2021-10-29add missing .h file includederaadt1-2/+3
from Emil Engler
2021-10-29document X509_EXTENSION_dup(3);schwarze1-8/+20
while here, add the missing const qualifier to the obj argument of X509_EXTENSION_create_by_OBJ(3) and correct a typo in the argument name of X509_EXTENSION_get_data(3)
2021-10-29new manual page X509_REQ_print_ex(3),schwarze4-6/+184
also documenting X509_REQ_print(3) and X509_REQ_print_fp(3)
2021-10-28document X509_REQ_to_X509(3)schwarze1-7/+38
2021-10-28unwrap a linetb1-3/+2
2021-10-28document X509_to_X509_REQ(3)schwarze1-4/+26