summaryrefslogtreecommitdiff
path: root/src/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* re-align these copies of the a2i_*(3) code with f_string.c rev. 1.19schwarze2021-11-232-28/+12
| | | | | | to fix the same double-counting of the backslash and to make the parsing stricter in the same way; OK tb@
* In DH_set0_pqg() also set dh->length if q is set to match what OpenSSL do.tb2021-11-231-1/+2
| | | | ok inoguchi jsing
* Implement rfc6840 (AD flag processing) if using trusted name serversjca2021-11-221-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | libc can't do DNSSEC validation but it can ask a "security-aware" resolver to do so. Let's send queries with the AD flag set when appropriate, and let applications look at the AD flag in responses in a safe way, ie clear the AD flag if the resolvers aren't trusted. By default we only trust resolvers if resolv.conf(5) only lists name servers on localhost - the obvious candidates being unwind(8) and unbound(8). For non-localhost resolvers, an admin who trusts *all the name servers* listed in resolv.conf(5) *and the network path leading to them* can annotate this with "options trust-ad". AD flag processing gives ssh -o VerifyHostkeyDNS=Yes a chance to fetch SSHFP records in a secure manner, and tightens the situation for other applications, eg those using RES_USE_DNSSEC for DANE. It should be noted that postfix currently assumes trusted name servers by default and forces RES_TRUSTAD if available. RES_TRUSTAD and "options trust-ad" were first introduced in glibc by Florian Weimer. Florian Obser (florian@) contributed various improvements, fixed a bug and added automatic trust for name servers on localhost. ok florian@ phessler@
* Fix typojob2021-11-221-2/+2
| | | | thanks Matthias Schmidt
* new manual page ASN1_NULL_new(3), also documenting ASN1_NULL_free(3)schwarze2021-11-224-5/+70
|
* new manual page a2d_ASN1_OBJECT(3);schwarze2021-11-224-4/+106
| | | | while here, add a few STANDARDS references
* document ASN1_OBJECT_create(3)schwarze2021-11-221-10/+61
|
* In asn1.h rev. 1.55 and asn1/a_time.c rev. 1.28, beck@schwarze2021-11-211-3/+72
| | | | | provided ASN1_TIME_diff(3). Merge the documentation from the OpenSSL 1.1.1 branch, which is still under a free license.
* oops, i forgot the STANDARDS sectionschwarze2021-11-211-1/+7
|
* new manual page d2i_ASN1_BOOLEAN(3) also documenting i2d_ASN1_BOOLEAN(3)schwarze2021-11-215-7/+137
|
* sorttb2021-11-201-4/+4
|
* Provide the bytestring APIs for libcrypto internal use.jsing2021-11-205-3/+1771
| | | | | | | Bring a copy of the bytestring APIs (CBB/CBS) from libssl, for use in libcrypto - these are not exposed publicly. Discussed with beck@ and tb@
* Document ASN1_INTEGER_cmp(3) and ASN1_INTEGER_dup(3).schwarze2021-11-201-5/+93
| | | | | | While here, also improve the description of ASN1_INTEGER_set(3) and add a BUGS section explaining that several of these functions do not provide type safety.
* Improve the description of ASN1_OCTET_STRING_cmp(3),schwarze2021-11-201-12/+37
| | | | | | ASN1_OCTET_STRING_dup(3), and ASN1_OCTET_STRING_set(3). Explicitly say that they do not provide any type safety and explain what that means.
* Make these files compile - not hooked up to build yet.beck2021-11-2013-220/+279
| | | | ok jsing@ tb@
* libssl: don't reach for pkey->save_type.tb2021-11-192-5/+5
| | | | | | | | | | | | For some strange historical reason ECDSA_sign() and ECDSA_verify}() have a type argument that they ignore. For another strange historical reason, the type passed to them from libssl is pkey->save_type, which is used to avoid expensive engine lookups when setting the pkey type... Whatever the aforementioned reasons were, we can't access pkey->save_type with the OpenSSL 1.1 API, and this is thus in the way of making EVP_PKEY opaque. Simply pass in 0 instead. ok jsing
* minor KNF improvement, changing only whitespace, no code change:schwarze2021-11-191-4/+4
| | | | | | say: return_type *function_name(args); not: return_type* function_name (args); OK tb@
* new manual page ASN1_BIT_STRING_num_asc(3)schwarze2021-11-194-5/+154
| | | | documenting the three functions using the BIT_STRING_BITNAME structure
* add two missing .Dv macros;schwarze2021-11-191-4/+4
| | | | markup bug found with regress/lib/libcrypto/man/check_complete.pl
* Make the public API function a2i_ASN1_STRING(3) actually work.schwarze2021-11-191-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | It contained two bugs: 1. If an input line ended in a backslash requesting line continuation, there was duplicate code for removing that backslash, erroneously removing another byte from the input and often causing the function to return failure instead of correctly parsing valid input. 2. According to a comment in the source code, the former big "for" loop was intended to "clear all the crap off the end of the line", but actually, if there were multiple characters on the line that were not hexadecimal digits, only the last of those and everything following it was deleted, while all the earlier ones remained. Besides, code further down clearly intends to error out when there are invalid characters, which makes no sense if earlier code already deletes such characters. Hence the comment did not only contradict the code above it - but contradicted the code below it, too. Resolve these contradiction in favour of stricter parsing: No longer skip invalid characters but always error out when any are found. OK & "Unbelievable" tb@
* As long as X509_OBJECT_free_contents(3) is a public API function,schwarze2021-11-191-1/+3
| | | | | | | | | | | | | | | make sure it fully re-initializes the object rather than leaving behind a stale pointer and a stale type in the object. The old behaviour was dangerous because X509_OBJECT_get_type(3) would then return the stale type to the user and one of X509_OBJECT_get0_X509(3) or X509_OBJECT_get0_X509_CRL(3) would then return the stale pointer to the user, provoking a use-after-free bug in the application program. Having these functions return X509_LU_NONE and NULL is better because those are the documented return values for these functions when the object is empty. OK tb@
* Add semicolon that will become non-optional once BN_GENCB_set() willtb2021-11-181-2/+2
| | | | move from an awful macro to a proper function.
* typo in commenttb2021-11-181-2/+2
|
* Prevent future internal use of ASN1_CTX and ASN1_const_CTX by wrappingtb2021-11-181-1/+3
| | | | | | them inside #ifndef LIBRESSL_INTERNAL. suggested by jsing
* Remove the last pointless use of ASN1_const_CTX. Both ASN1_CTX andtb2021-11-181-14/+14
| | | | | | | ASN1_const_CTX are now unused and will be garbage collected in the next libcrypto bump. ok jsing
* In x509_vfy.h rev. 1.35 and x509_lu.c rev. 1.34, tb@ providedschwarze2021-11-182-13/+51
| | | | | | | | X509_OBJECT_new(3) and X509_OBJECT_free(3); document them. While here, stop talking about storing storing EVP_PKEY objects and plain C strings in X509_OBJECT objects. LibreSSL never fully supported that, and it certainly no longer supports that now.
* In x509_vfy.h rev. 1.37 and x509_vfy.c rev. 1.91, tb@ providedschwarze2021-11-179-46/+209
| | | | | | | | | | | | | | | | | X509_STORE_CTX_set_verify(3) and X509_STORE_CTX_get_verify(3). Document them. In the next bump, tb@ will also provide X509_STORE_CTX_verify_fn(3) and X509_STORE_set_verify(3) and restore X509_STORE_set_verify_func(3) to working order. For efficiency of documentation work, already document those three, too, but keep the text temporariy .if'ed out until they become available. Delete X509_STORE_set_verify_func(3) from X509_STORE_set_verify_cb_func(3) because it was misplaced in that page: it is not related to the verification callback. tb@ agrees with the general direction.
* In x509_vfy.h rev. 1.37 and x509_vfy.c rev. 1.91, tb@ providedschwarze2021-11-161-8/+47
| | | | X509_STORE_CTX_get_verify_cb(3); document it.
* Recently, tb@ provided the following functions:schwarze2021-11-161-4/+71
| | | | | | | | | | X509_STORE_CTX_set_error_depth x509_vfy.h 1.37 x509_vfy.c 1.91 X509_STORE_CTX_set_current_cert x509_vfy.h 1.37 x509_vfy.c 1.91 X509_STORE_CTX_get_num_untrusted x509_vfy.h 1.36 x509_vfy.c 1.90 X509_STORE_CTX_set0_verified_chain x509_vfy.h 1.37 x509_vfy.c 1.91 Merge the documentation from the OpenSSL 1.1.1 branch, which is still under a free license; tweaked by me.
* new manual page ASN1_BIT_STRING_set(3) documenting four BIT STRING accessorsschwarze2021-11-154-3/+184
|
* document ASN1_PRINTABLE_type(3) and ASN1_UNIVERSALSTRING_to_string(3)schwarze2021-11-156-8/+172
|
* document ASN1_item_pack(3) and ASN1_item_unpack(3)schwarze2021-11-155-6/+94
|
* document i2a_ASN1_STRING(3) and a2i_ASN1_STRING(3)schwarze2021-11-153-3/+163
|
* Fix a strange check in the auto DH codepathtb2021-11-141-3/+5
| | | | | | | | | | The code assumes that the server certificate has an RSA key and bases the calculation of the size of the ephemeral DH key on this assumption. So instead of checking whether we have any key by inspecting the dh part of the union, let's check that we actually have an RSA key. While here, make sure that its length is non-negative. ok jsing
* the last argument of BIO_gets(3) is called "size", not "len"schwarze2021-11-141-6/+6
|
* fix a typo; diff from Matthias Schmidt <xosc dot org> on tech@schwarze2021-11-141-3/+3
|
* Put curly brace on the correct line.jsing2021-11-141-2/+3
|
* Fix a nasty quirk in ASN1_STRING_copy(3).schwarze2021-11-131-2/+2
| | | | | | | | | In case of failure, it reported the failure but corrupted the type of the destination string. Instead, let's make sure that in case of failure, existing objects remain in their original state. OK tb@
* Document the interactions of X509_V_FLAG_USE_CHECK_TIME,schwarze2021-11-131-6/+35
| | | | | | | | X509_V_FLAG_NO_CHECK_TIME, X509_VERIFY_PARAM_set_time(3), X509_VERIFY_PARAM_set_flags(3), and X509_VERIFY_PARAM_clear_flags(3) in detail because the API design is both surprising and surprisingly complicated in this respect, and the resulting nasty traps have already caused bugs in the past.
* Mark the public X509_VP_FLAG_* constants as intentionally undocumented.schwarze2021-11-131-2/+11
| | | | | | With LibreSSL, they can only be used internally in the library itself, and even with OpenSSL, no real-world application code uses them. OK tb@
* Fix a bug in check_crl_time() that could result in incompleteschwarze2021-11-131-8/+8
| | | | | | | | | | | | | | | | | | | | | | | verification, accepting CRLs that ought to be rejected, if an unusual combination of verification flags was specified. If time verification was explicitly requested with X509_V_FLAG_USE_CHECK_TIME, it was skipped on CRLs if X509_V_FLAG_NO_CHECK_TIME was also set, even though the former is documented to override the latter both in the OpenSSL and in the LibreSSL X509_VERIFY_PARAM_set_flags(3) manual page. The same bug in x509_check_cert_time() was already fixed by beck@ in rev. 1.57 on 2017/01/20. This syncs the beginning of the function check_crl_time() with the OpenSSL 1.1.1 branch, which is still under a free license. OK beck@ This teaches that having too many flags and options is bad because they breed bugs, and even more so if they are poorly designed to override each other in surprising ways.
* document ASN1_STRING_copy(3)schwarze2021-11-131-4/+43
|
* Document the public constants X509_V_FLAG_POLICY_MASKschwarze2021-11-121-9/+43
| | | | | | | and X509_V_FLAG_USE_CHECK_TIME. While here, fix a typo and improve the wording for X509_V_FLAG_NOTIFY_POLICY.
* mention what X509_cmp_time(3) does with a cmp_time argument of NULLschwarze2021-11-121-3/+7
|
* As pointed out by tb@, LibreSSL no longer supports user-definedschwarze2021-11-124-56/+21
| | | | | | | | | X509_LOOKUP_METHODs because these objects are now opaque. Simplify the documentation accordingly, shortening it by about 35 input lines in total, but continue providing the information which RETURN VALUES functions might return with other implementations of the library. OK tb@
* In x509_vfy.h rev. 1.41, tb@ provided X509_STORE_CTX_get_by_subject(3),schwarze2021-11-123-18/+53
| | | | | | | | | | | | changed the return type of X509_OBJECT_get_type(3) and argument types of X509_LOOKUP_by_subject(3), X509_LOOKUP_by_issuer_serial(3), X509_LOOKUP_by_fingerprint(3), X509_LOOKUP_by_alias(3), X509_OBJECT_idx_by_subject(3), X509_OBJECT_retrieve_by_subject(3), and X509_STORE_get_by_subject(3) from int to X509_LOOKUP_TYPE, and in rev. 1.42, he provided X509_STORE_CTX_get_obj_by_subject(3). Adjust the documentation. Joint work with and OK tb@.
* mention the public constants XN_FLAG_SEP_MASK and XN_FLAG_FN_MASKschwarze2021-11-111-2/+6
|
* Mention the X509v3_KU_* aliases for the KU_* constantsschwarze2021-11-111-2/+16
| | | | | | because some third party application code uses them. List the full names (even though they are long) such that they can be found with "man -k Dv=...".
* Explicitly list all public functions in roff(7) commentsschwarze2021-11-111-6/+33
| | | | | that are related to this page but intentionally undocumented, to better support grepping the source directory for function names.
* new manual page X509_policy_tree_get0_policies(3),schwarze2021-11-114-6/+110
| | | | also documenting X509_policy_tree_get0_user_policies(3)