summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_transcript.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-05-12Rewrite and fix X509v3_asid_subset()tb1-12/+30
X509v3_asid_subset() assumes that both asnum and rdi are present while they are both marked OPTIONAL in RFC 3779, 3.2.3. It will crash if either one is missing. In RPKI land RDI is a MUST NOT use (e.g, RFC 6487, 4.8.11), so this API is currently useless (and seemingly unused). Pick apart an ugly logical pipeline and implement this check in a readable fashion. ok jsing
2022-05-12Rename asn1_enc_free() to asn1_enc_cleanup().jsing3-6/+6
This function does not actually free an ASN1_ENCODING, which are embedded in a struct. Name suggested by tb@
2022-05-12Rewrite asn1_item_ex_d2i_choice() using CBS.jsing1-73/+54
Now that combine no longer exists, we can also free and reallocate. ok tb@
2022-05-12Rewrite asn1_enc_save() using CBS.jsing3-46/+69
Rework and clean up other asn1_enc_* related functions while here. ok tb@
2022-05-12Use freezero() with ASN1_ENCODING.jsing1-3/+3
While ASN1_ENCODING is currently only used with types that should only contain public information, we assume that ASN.1 may contain sensitive information, hence use freezero() here instead of free(). ok deraadt@ tb@
2022-05-12Remove ASN1_AFLG_BROKEN.jsing2-19/+3
This workaround was used by ASN1_BROKEN_SEQUENCE, which existed for NETSCAPE_ENCRYPTED_PKEY. Remove the workaround since the only consumer has already been removed. ok tb@
2022-05-12Add a few more testcases for X509v3_asid_subset()tb1-1/+144
2022-05-10Add a BUGS section to describe the problem of potential lies andtb1-2/+17
indicating a workaround. input/ok jsing
2022-05-10X509_check_ca() has 5 return values but still can't failtb1-3/+1
The values 0, 1, 3, 4, 5 all have some meaning, none of which is failure. If caching of X509v3 extensions fails, returning X509_V_ERR_UNSPECIFIED, i.e., 1 is a bad idea since that means the cert is a CA with appropriate basic constraints. Revert to OpenSSL behavior which is to ignore failure to cache extensions at the risk of reporting lies. Since no return value can indicate failure, we can't fix this in X509_check_ca() itself. Application code will have to call (and check) the magic X509_check_purpose(x, -1, -1) to ensure extensions are cached, then X509_check_ca() can't lie. ok jsing
2022-05-10If Ruby 3.1 isn't available, try to fall back to Ruby 3.0 so thattb1-1/+5
regress on bluhm's test machines have a chance to pass on slower architectures while package builds catch up.
2022-05-10Rewrite asn1_item_ex_d2i() using CBS.jsing1-58/+125
This requires a few wrappers to call into some non-CBS functions, however we can now remove the asn1_d2i_ex_primitive() wrapper as there are no longer any non-CBS callers. ok tb@
2022-05-10Remove ASN.1 combining.jsing5-82/+37
This was an option used to combine ASN.1 into a single structure, which was only ever used by DSAPublicKey and X509_ATTRIBUTE. Since they no longer use it we can mop this up and simplify all of the related code. ok tb@
2022-05-09Simplify X509_ATTRIBUTE ASN.1 encoding.jsing6-101/+34
For some unknown historical reason, X509_ATTRIBUTE allows for a single ASN.1 value or an ASN.1 SET OF, rather than requiring an ASN.1 SET OF. Simplify encoding and remove support for single values - this is similar to OpenSSL e20b57270dec. This removes the last use of COMBINE in the ASN.1 decoder. ok tb@
2022-05-08Remove openssl/cterr.h and inline it in openssl/ct.htb4-133/+58
ok jsing
2022-05-08Default Ruby is now 3.1tb1-2/+2
2022-05-07Sort alphabetically so that future omissions will be easier to spot.tb1-35/+35
discussed with jsing
2022-05-07Split asn1_item_ex_d2i() into three.jsing1-223/+287
Factor out the handling of CHOICE and SEQUENCE into their own functions. This reduces complexity, reduces indentation and will allow for further clean up. ok beck@ tb@
2022-05-07zap stray tabtb1-2/+2
2022-05-07KNF nitstb1-7/+7
2022-05-07Rewrite asn1_d2i_ex_primitive() with CBS.jsing1-72/+86
ok tb@
2022-05-07Refactor asn1_ex_c2i()jsing1-39/+59
The asn1_ex_c2i() function currently handles the V_ASN1_ANY case inline, which means there multiple special cases, with pointer fudging and restoring. Instead, split asn1_ex_c2i() into three functions - one that only handles storage into a primitive type (asn1_ex_c2i_primitive()), one that handles the V_ASN1_ANY case (asn1_ex_c2i_any()) and calls asn1_ex_c2i_primitive() with the correct pointer and an asn1_ex_c2i() that handles the custom functions case, before dispatching to asn1_ex_c2i_any() or asn1_ex_c2i_primitive(), as appropriate. This results in cleaner and simpler code. With input from and ok tb@
2022-05-07Avoid strict aliasing violations in BN_nist_mod_*()jsing1-86/+137
The optimised code path switches from processing data via unsigned long to processing data via unsigned int, which requires type punning. This is currently attempted via a union (for one case), however this fails since a pointer to a union member is passed to another function (these unions were added to "fix strict-aliasing compiler warning" - it would seem the warnings stopped but the undefined behaviour remained). The second case does not use a union and simply casts from one type to another. Undefined behaviour is currently triggered when compiling with clang 14 using -03 and -fstrict-aliasing, while disabling assembly (in order to use this C code). The resulting binary produces incorrect results. Avoid strict aliasing violations by copying from an unsigned long array to an unsigned int array, then copying back the result. Any sensible compiler will omit the copies, while avoiding undefined behaviour that would result from unsafe type punning via pointer type casting. Thanks to Guido Vranken for reporting the issue and testing the fix. ok tb@
2022-05-06Add missing ERR_load_{COMP,CT,KDF}_strings()tb1-1/+11
ok beck
2022-05-06Also check EVP_PKEY_CTX_new_id() return in example code. Letting thistb1-2/+4
be caught by the error check of EVP_PKEY_derive_init() is a dubious pattern.
2022-05-06Install EVP_PKEY_CTX_set_hkdf_md.3tb1-1/+2