Age | Commit message (Collapse) | Author |
|
|
|
is pure comedy gold, and now documented as such, sadly this bit of pure
Muppet genius can't really in good consience stay in the tree as is.
Change BIO_dump to always return the number of bytes printed on success
and to stop printing and return -1 on failure if a writing function
fails.
ok tb@, jsing@
|
|
|
|
|
|
which by implication also affects X509_print(3).
The ASN1_STRING_get0_data(3) manual explitely cautions the reader
that the data is not necessarily NUL-terminated, and the function
X509_alias_set1(3) does not sanitize the data passed into it in
any way either, so we must assume the alias->data field is merely
a byte array and not necessarily a string in the sense of the C
language.
I found this bug while writing manual pages for these functions.
OK tb@
As an aside, note that the function still produces incomplete and
misleading results when the data contains a NUL byte in the middle
and that error handling is consistently absent throughout, even
though the function provides an "int" return value obviously intended
to be 1 for success and 0 for failure, and even though this function
is called by another function that also wants to return 1 for success
and 0 for failure and even does so in many of its code paths, though
not in others. But let's stay focussed. Many things would be nice
to have in the wide wild world, but a buffer overflow must not be
allowed to remain in our backyard.
|
|
|
|
the saving of the first error case so that the "autochain" craziness from
openssl will work with the new verifier. This should allow the new verification
code to work with a bunch of the autochain using cases in some software.
(and should allow us to stop using the legacy verifier with autochain)
ok tb@
|
|
"please commit" schwarze
|
|
|
|
X509_alias_set1(3), X509_alias_get0(3)
|
|
|
|
|
|
OK kn@, millert@
|
|
|
|
If the user set nmflags == X509_FLAG_COMPAT and X509_NAME_print_ex(3)
failed, the error return value of 0 was misinterpreted as an indicator
of success, causing X509_print_ex(3) to ignore the error, continue
printing, and potentially return successfully even though not all
the content of the certificate was printed.
The X509_NAME_print_ex(3) manual page explains that this function
indicates failure by returning 0 if nmflags == X509_FLAG_COMPAT
and by returning -1 if nmflags != X509_FLAG_COMPAT.
That's definitely atrocious API design (witnessed by the
complexity of the code needed for correct error checking),
but changing the API contract and becoming incompatible
with OpenSSL would make matters even worse.
Note that just checking for <= 0 in all cases would not be correct
either because X509_NAME_print_ex(3) returns 0 to indicate that it
successfully printed zero bytes in some cases, for example when all
three of the following conditions hold:
1. nmflags != X509_FLAG_COMPAT
2. indent == 0 (which X509_print_ex(3) does use in some cases)
3. the name object is NULL or empty
I found the bug by code inspection and proposed an incomplete patch,
then jsing@ proposed this improved version of the patch.
OK jsing@.
|
|
- update references version number
- Z_NULL -> NULL; from millert
- terminate function synopses in main body with ";"; from tb
- NULL -> NUL; from tb
- update NAME and SYNOPSIS for added functions
- updated copyright, to match zlib.h
- simplify \-1 -> -1
ok tb
|
|
|
|
|
|
|
|
made sense.
Tested in snaps for a few days. deraadt helped with fitting things on
floppies and jmatthew found a bug I introduced.
ok deraadt
|
|
|
|
even though it did not actually set the name.
Instead, indicate failure in this case.
This commit sneaks in a small, unrelated change in behaviour.
If the first argument of X509_NAME_set(3) was NULL, the function
used to return failure. Now it crashes the program by accessing
the NULL pointer, for compatibility with the same change in OpenSSL.
This merges the following two commits from the OpenSSL-1.1.1 branch,
which is still available under a free license:
1. 180794c5 Rich Salz Sep 3 11:33:34 2017 -0400
2. c1c1783d Richard Levitte May 17 09:53:14 2018 +0200
OK tb@
|
|
It is not particularly well-designed and sets a number of traps for the
unwary, but it is a public API function in both OpenSSL and LibreSSL
and used at various places.
|
|
The num_ciphers, get_cipher_by_char and put_cipher_by_char function
pointers use the same function for all methods - call ssl3_num_ciphers()
directly, absorb ssl3_get_cipher_by_char() into SSL_CIPHER_find() and
remove the unused ssl3_put_cipher_by_char() code.
ok inoguchi@ tb@
|
|
usleep(3) is a wrapper around nanosleep(2). We should always call
nanosleep(), even if the input is zero. This makes behavior easier
to reason about and ensures we get a nanosleep() ktrace hit if a
program calls usleep().
ok millert@
|
|
While here, stress that X509_NAME objects cannot share X509_NAME_ENTRY
objects, and polish a few misleading wordings.
|
|
undocumented. It is archaic and practically unused and unusable.
tb@ and jsing@ agree with marking it as undocumented.
Put the comment here because EVP_PKEY_base_id(3) is a viable alternative.
|
|
undocumented macro alias X509_name_cmp(3);
no change to the assembler code generated by the compiler;
OK tb@
|
|
undocumented because it is almost unused in real-world code.
OK tb@
|
|
Now that SSL_METHOD is opaque and in internal headers, we can remove
SSL_METHOD_INTERNAL by merging it back into SSL_METHOD.
ok tb@
|
|
|
|
|
|
This adds functionality for SSL_get_signature_nid(),
SSL_get_peer_signature_nid(), SSL_get_signature_type_nid() and
SSL_get_peer_signature_type_nid().
This is not currently publicly visible and will be exposed at a later
date.
ok inoguchi@ tb@
|
|
Move struct ssl_cipher_st, struct ssl_method_st, struct ssl_session_st and
struct ssl3_state_st from public to private headers. These are already
under #ifdef LIBRESSL_INTERNAL and are no longer publicly visible.
ok inoguchi@ tb@
|
|
and X509_REQ_extract_key(3), using feedback from tb@ and jsing@
|
|
This was inadvertently broken during sigalgs refactoring.
|
|
This means that we do sigalg selection for all cases, including those
where are are not sending sigalgs. This is needed in order to track our
signature type in legacy cases.
ok tb@
|
|
This is needed for upcoming API additions.
|
|
Suggested by tb@
|
|
Wording provided by tb@
|
|
Only use the minimum TLS version to when building a signature algorithms
extension for a ClientHello - in all other cases we should be using the
negotiated TLS version.
ok inoguchi@ tb@
|
|
This simplifies callers, as only the negotiated TLS version needs to be
used here.
Requested by tb@
|
|
|
|
ok inoguchi@ tb@
|
|
ok inoguchi@ tb@
|
|
Provide an ssl_sigalg_for_peer() function that knows how to figure out
which signature algorithm should be used for a peer provided signature,
performing appropriate validation to ensure that the peer provided value
is suitable for the protocol version and key in use.
In the TLSv1.3 code, this replaces the need for separate calls to lookup
the sigalg from the peer provided value, then perform validation.
ok inoguchi@ tb@
|
|
Also, rather than passing in a check_curve flag, pass in the SSL * and
handle version checks internally to ssl_sigalg_pkey_ok(), simplifying
the callers.
ok inoguchi@ tb@
|
|
In the case of TLSv1.0 and TLSv1.1 there is no signature algorithms
extension and default signature algorithms are used - similar applies to
TLSv1.2 when the signature algorithms extension has been omitted.
ok inoguchi@ tb@
|
|
|
|
RFC 8446 section 4.1.4 requires that the client ensure the cipher suite
in the TLSv1.3 HelloRetryRequest and subsequent ServerHello is the same.
Reported via GitHub issue #675.
ok inoguchi@ tb@
|