summaryrefslogtreecommitdiff
path: root/src/lib/libc (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-01-06Free memory if error occurredinoguchi1-2/+4
2022-01-06Remove NULL check before freeinoguchi1-3/+2
2022-01-06Fix a copy-paste error that led to an out-of-bounds access.tb1-2/+2
Found via a crash on bluhm's i386 regress test box
2022-01-06Add test coverage for SCT validation.jsing4-7/+116
Of note, the public APIs for this mean that the only way you can add a CTLOG is by reading a configuration file from disk - there is no programmatic way to do this.
2022-01-06t_syscall was a test for the gcc 1.x off_t syscall padding,guenther2-125/+2
which was an implementation detail and has been deleted, so delete the test
2022-01-05Prepare to provide DSA_bits()tb2-2/+11
Used by Qt5 and Qt6 and slightly reduces the patching in there. ok inoguchi jsing
2022-01-05Prepare to provide BIO_set_retry_reason()tb2-2/+11
Needed by freerdp. ok inoguchi jsing
2022-01-05Prepare to provide a number of RSA accessorstb2-2/+67
This adds RSA_get0_{n,e,d,p,q,dmp1,dmq1,iqmp,pss_params}() which will be exposed in the upcoming bump. ok inoguchi jsing
2022-01-05Prepare to provide ECDSA_SIG_get0_{r,s}()tb2-2/+19
ok inoguchi jsing
2022-01-05Prepare to provide DH_get_length()tb2-2/+11
Will be needed by openssl(1) dhparam. ok inoguchi jsing
2022-01-05Prepare to provide DSA_get0_{p,q,g,{priv,pub}_key}()tb2-2/+39
ok inoguchi jsing
2022-01-05Prepare to provide DH_get0_{p,q,g,{priv,pub}_key}()tb2-2/+39
These are accessors that allow getting one specific DH member. They are less error prone than the current getters DH_get0_{pqg,key}(). They are used by many ports and will also be used in base for this reason. Who can remember whether the pub_key or the priv_key goes first in DH_get0_key()? ok inoguchi jsing
2022-01-05Prepare to provide BIO_set_next().tb2-2/+11
This will be needed in libssl and freerdp after the next bump. ok inoguchi jsing
2022-01-05Prepare to provide X509_{set,get}_verify() and X509_STORE_get_verify_cb()tb2-7/+37
as well as the X509_STORE_CTX_verify_cb and X509_STORE_CTX_verify_fn types This will fix the X509_STORE_set_verify_func macro which is currently broken, as pointed out by schwarze. ok inoguchi jsing
2022-01-05Unindent a few lines of code and avoid shadowed variables.tb1-12/+7
2022-01-05Rename {c,p}_{min,max} into {child,parent}_{min,max}tb1-7/+8
2022-01-05Two minor KNF tweakstb1-5/+5
2022-01-05Use child_aor and parent_aor instead of aorc and aorptb1-15/+15
suggested by jsing
2022-01-05Rename fp and fc into parent_af and child_af for readability.tb1-24/+29
suggested by jsing
2022-01-05Globally rename all IPAddressFamily *f into af since this is slightlytb1-64/+65
more readable. Repeated complaints by jsing
2022-01-05Add a helper function to turn unchecked (but sound) use oftb1-13/+18
sk_find + sk_value into something easier to follow and swallow. ok inoguchi jsing
2022-01-05Hoist IPAddressFamily_cmp() to the other IPAddressFamily functions.tb1-29/+29
ok inoguchi jsing
2022-01-05Call x a cert for readability.tb1-13/+13
2022-01-05Now that i is free, rename j to i for use as loop variable intb1-10/+10
various loops in addr_validate_path_internal().
2022-01-05In addr_validate_path_internal() rename i to depth because that'stb1-17/+15
what it is.
2022-01-05Turn the validation_err() macro into a functiontb1-31/+44
validation_err() is an ugly macro with side effects and a goto in it. At the cost of a few lines of code we can turn this into a function where the side effects are explicit and ret is now explicitly set in the main body of addr_validate_path_internal(). We get to a point where it is halfway possible to reason about the convoluted control flow in this function. ok inoguchi jsing
2022-01-05Move variable declarations in X509v3_addr_canonize() to the top oftb1-17/+19
the function and unindent some code. ok inoguchi jsing
2022-01-05Revise for tls13_key_share rename.jsing1-11/+11
2022-01-05Rename tls13_key_share to tls_key_share.jsing9-91/+97
In preparation to use the key share code in both the TLSv1.3 and legacy stacks, rename tls13_key_share to tls_key_share, moving it into the shared handshake struct. Further changes will then allow the legacy stack to make use of the same code for ephemeral key exchange. ok inoguchi@ tb@
2022-01-05Wrap long lines and add some bracesinoguchi1-74/+129
2022-01-05Check function return valueinoguchi1-8/+18
2022-01-05Checking pointer variable with NULLinoguchi1-74/+75
2022-01-05Use calloc instead of mallocinoguchi1-2/+2
suggested by tb@
2022-01-05Check NULL first and unindent the rest of the codeinoguchi1-41/+45
suggested by tb@
2022-01-05Convert openssl(1) cms option handlinginoguchi1-620/+1240
Just applying new option handling and no functional changes. Referred to verify.c and using 'verify_shared_options'. ok and comments from jsing@ and tb@
2022-01-05Provide regress for SSL public APIs.jsing3-1/+387
This will largely test curly and inconsistent APIs that are not covered by other regress tests. Currently, this tests the wonder that is SSL_get_peer_cert_chain().
2022-01-05Remove bandaid to work around expected range_should_be_prefix() problem.tb1-6/+2
2022-01-05Remove a bogus memcmp in range_should_be_prefix()tb1-3/+6
range_should_be_prefix() currently always fails. The reason for this is that OpenSSL commit 42d7d7dd incorrectly moved a memcmp() out of an assertion. As a consequence, the library emits and accepts incorrectly encoded ipAddrBlock extensions since it will never detect ranges that MUST be encoded as a prefix according to RFC 3779, 2.2.3.7. The return -1 from this memcmp() indicates to the callers that the range should be expressed as a range, so callers must check beforehand that min <= max to be able to fail. Thus, remove this memcmp() and add a check to make_addressRange(), the only caller that didn't already ensure that min <= max. This fixes the noisy output in regress/lib/libcrypto/x509/rfc3779. ok inoguchi jsing
2022-01-05Polish X509v3_addr_subset() a bittb1-15/+28
Use child and parent instead of a and b. Split unrelated checks. Use accessors and assign to local variables to avoid ugly line wrapping. Declare vriables up front instead of mixing declarations with assignments from function returns. ok inoguchi jsing
2022-01-05Readability tweaks in addr_contains()tb1-5/+13
Assign to local variables to avoid ugly line wrapping. ok inoguchi jsing
2022-01-05Fix a bug in addr_contains() introduced in OpenSSL commit be71c372tb1-2/+2
by returning 0 instead of -1 on extract_min_max() failure. Callers would interpret -1 as success of addr_contains(). ok inoguchi jsing
2022-01-04Readability tweaks in the print helper i2r_IPAddressOrRanges.tb1-9/+17
Assign repeated nested expressions to local variables and avoid some awkward line wrapping.
2022-01-04Consistently name variables with a _len suffix instead of mixingtb1-35/+35
things like prefixlen, afi_length, etc. suggested by jsing
2022-01-04Only check the parent to be canonical once we know it is non-NULL.tb1-6/+5
suggested by jsing during review
2022-01-04Refactor extract_min_max()tb1-11/+28
extract_min_max() crammed all the work in two return statements inside a switch. Make this more readable by splitting out the extraction of the min and max as BIT STRINGs from an addressPrefix or an addressRange and once that's done expanding them to raw addresses. ok inoguchi jsing
2022-01-04Remove checks that are duplicated in extract_min_max()tb1-8/+1
The NULL checks and the checks that aor->type is reasonable are already performed in extract_min_max(), so it is unnecessary to repeat them in X509v3_addr_get_range() ok inoguchi jsing
2022-01-04Make X509v3_addr_get_range() readable.tb1-7/+17
Instead of checking everything in a single if statement, group the checks according to their purposes. ok inoguchi jsing
2022-01-04Add a length check to make_addressPrefix()tb1-12/+25
Make the callers pass in the afi so that make_addressPrefix() can check prefixlen to be reasonable. If the afi is anything else than IPv4 or IPv6, cap its length at the length needed for IPv6. This way we avoid arbitrary out-of-bounds reads if the caller decides to pass in something stupid. ok inoguchi jsing
2022-01-04Remove some dead codetb1-7/+1
IPAddressRange_new() populates both its min and max members, so they won't ever be NULL and will never need to be allocated. ok inoguchi jsing
2022-01-04Drop a pointless NULL checktb1-3/+2
IPAddressOrRange_new() instantiates a choice type, so we need to allocate one member of the union ourselves, so aor->u.addressPrefix will always be NULL. ok inoguchi jsing