summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2024-05-09sync the SSL text; ok tbJason McIntyre
2024-05-09Tiny style tweaks in X509_REQ_add_extension_nid()Theo Buehler
Test & assign and use ret instead of rv. ok jsing
2024-05-09Streamline X509_REQ_check_private_key() a bitTheo Buehler
Use better variable names, split the success from the error path and return directly rather than using an ok variable. ok jsing
2024-05-09Zap some extra parentheses in X509_REQ_get_pubkey()Theo Buehler
ok jsing
2024-05-09Clean up X509_to_X509_REQ()Theo Buehler
Use better variable names. X509_REQ_new() sets the version to the only specified version, so there is no point to set it. Extract the subject name, then assign to make it more obvious that we error happens if the cert has a missing subject. Switch to X509_get0_pubkey() to avoid some strange dance with a strangely named variable to adjust the refcount. ok jsing
2024-05-09Further simplify X509_REQ_get_extensions()Theo Buehler
Instead of inlining a poor version of ASN1_TYPE_unpack_sequence() with missing error checks, just call the real thing. It's safer and simpler. ok jsing
2024-05-09ssl_ciph.c: unwrap a lineTheo Buehler
2024-05-09Remove leftover logic of SSL2 supportTheo Buehler
SSL2_CF_8_BYTE_ENC was set by things such as RC4_64_WITH_MD5, which fell victim to tedu's axe a decade ago. Zap that. ok jsing
2024-05-09Plug a "leak" in ssl_security_group()Theo Buehler
The way the CBB API is used, CBB_add_u16() and CBB_finish() can't actually fail here, but if they could, cbb->base would leak. Rewrite this code with the proper idioms to make it look right. ok jsing
2024-05-08fix line wrapping in function definitionTheo Buehler
2024-05-08Avoid OpenSSL SSL repetitionsTheo Buehler
with the help of jmc
2024-05-08Simplify X509_REQ_get_extensions()Theo Buehler
Now that we know the two OIDs we need to look for when checking for the extension list attribute in a certification request, we can simplify this quite a bit. There is one change of behavior. Attribute value sets are not supposed to be empty and it makes no sense to return an empty stack of extensions in that case, return NULL instead, matching BoringSSL. This removes last use of ext_nids and ext_nid_list[], so these two bits of unprotected global mutable state can now join the party in the attic. ok jsing
2024-05-08Simplify X509_REQ_extension_nid()Theo Buehler
Now that the global ext_nids[] array can no longer be modified by the application, we can simplify this by returning the two possible NIDs that we accept in the extension list attribute in PKCS#10 certification requests. The year is 2024. This API is entirely unused by the ecosystem. Well not entirely! One small village of indomitable rare API use still holds out against the cleansers. You may have guessed it: security/xca. ok jsing
2024-05-08Defang X509_REQ_{s,g}et_extension_nids()Theo Buehler
These fiddle with unprotected global state, so aren't thread safe and of course there was no good reason to have this API in the first place. Nothing uses it, so it becomes a noop and will be removed in the next major bump. ok jsing
2024-05-07avoid memcpy(malloc(0), ..., 0), which is not portable.Damien Miller
ok florian@
2024-05-07PEM_read_bio_PrivateKey: fix grammarTheo Buehler
This old [...] routines use [...] -> These old [...] routines [...]
2024-05-07Reorder functions and drop static function prototypes.Joel Sing
No functional change.
2024-05-06Fix function wrapping.Joel Sing
2024-05-06Guard call to contract() from doall_util_fn().Joel Sing
It is not safe to unconditionally call contract() - when called repeatedly it will shrink the bucket array to zero and then attempt to access that allocation on the next call. Use the same guard that is used in lh_delete(). Issue found when investigating haproxy crashes reported by wizard-it on GitHub. ok tb@
2024-05-03Remove disgusting NULL checks in tm_to_{gentime,utctime}()Theo Buehler
The only caller that could potentially call these with NULL has been fixed. This way an ugly hack that was needed to plug a memory leak can go away and the functions again behave as intended without OpenSSL-style workarounds. ok beck
2024-05-03Intercept a NULL s early in ASN1_TIME_set_string_internal()Theo Buehler
If s is NULL, the only thing the tm_to_*() functions do is a check that a GeneralizedTime has a four digit year (between 0000 and 9999) and a UTCTime has a year between 1950 and 2050. These checks are already done in ASN1_TIME_parse() itself: the century is 100 times a two-digit value (or 19 in the UTCTime case) plus another two-digit value. ok beck
2024-05-03Simplify type handling in ASN1_TIME_set_string_internal()Theo Buehler
ASN1_time_parse() takes a mode argument. If mode != 0, there is a check that mode is the same as the time type returned by asn1_time_parse_cbs() otherwise ASN1_time_parse() fails. Therefore the type == mode checks in ASN1_set_string_internal() are redundant and can be removed. ok beck
2024-05-03Simplify tm handling in ASN1_time_parse()Theo Buehler
The CBS version asn1_time_parse_cbs() handles a NULL tm gracefully, so there is no need to avoid it by passing a pointer to a tm on the stack. ok beck
2024-05-03Align CRL and CSR version printing with certsTheo Buehler
Only print specified 0-based versions and print them with the 1-based human interpretation. Use a colon and error check the BIO_printf() calls. (There's a lot more to clean up in here, but that's for another day). Notably, X509_CRL_print_ex() is missing... I guess that's better than having one with signature and semantics differing from X509_print_ex() und X509_REQ_print_ex(). ok beck
2024-05-02Remove a useless OBJ_obj2nid() call from X509_CRL_print()Theo Buehler
ok beck (as part of a larger diff)
2024-05-01add return statements missed when adapting from FreeBSDJonathan Gray
Avoids segfaults with an argument of 0, NaN, or Inf. Problem reported by Colin Ian King. ok miod@ kettenis@
2024-04-30add typedefs for msgqnum_t and msglen_t, required by POSIX.Omar Polo
improvements from kettenis and jca ok millert, jca, guenther
2024-04-29strftime.3: clarify %G and %g descriptionChristian Weisgerber
Clarify that %G and %g produce the rarely needed ISO week-numbering year rather than the Gregorian calendar year. With millert@ and Evan Silberman. Some of the wording is from the upstream version. ok tb@
2024-04-28__sfvwrite: allow writing buffers larger than BUFSIZ or st_blksize.Todd C. Miller
This can vastly improve write performance. For unbuffered writes, we now write up to INT_MAX instead of BUFSIZE. For buffered writes, write the largest multiple of the buffer size (which may be st_blksize). From Apple via enh at google. OK tb@
2024-04-27Tweak start of DESCRIPTION of EC_GROUP_new()Theo Buehler
Complete precision will lead to complete confusion, however outright lies are also bad.
2024-04-26Document EC_curve_{nid2nist,nist2nid}()Theo Buehler
2024-04-25Take pem2.h behind the barnTheo Buehler
/* * This header only exists to break a circular dependency between pem and err * Ben 30 Jan 1999. */ 25 years of uselessness is about a quarter century more than enough. discussed with jsing
2024-04-23One empty line is enoughTheo Buehler
2024-04-22remove space at eolJonathan Gray
2024-04-21unwrap lineTheo Buehler
2024-04-20Remove more unnecessary GOST codeTheo Buehler
ok jsing
2024-04-19bss_conn: zap trailing whitespaceTheo Buehler
2024-04-18Remove a couple of lies about GOST in CMSTheo Buehler
2024-04-18More GOST removal adjustmentsTheo Buehler
2024-04-18EVP_PKEY_set1_RSA.3 some adjustments after GOST removalTheo Buehler
2024-04-18Add some more comments explaining shortcomings of the APITheo Buehler
The case in point is the incompatibility of the very ergonomic X509_ALGOR API with the RC2-derived API massacre that is EVP_CIPHER_asn1_to_param() and its "inverse". ok jsing
2024-04-18Use X509_ALGOR_get0() in ecdh_cms_set_shared_info()Theo Buehler
This makes things slightly less gross since it involves less reaching into nested ASN.1 structures. But don't get the idea that this means the code is now clean. ok jsing
2024-04-18Test and assign in ecdh_cms_set_shared_info()Theo Buehler
ok jsing
2024-04-18Turn ecdh_cms_set_shared_info() into single exitTheo Buehler
ok jsing
2024-04-17Remove comments from captain obvious and drop useless prototypesTheo Buehler
2024-04-17tidy includesTheo Buehler
2024-04-17bn_convert: zap extra blank lineTheo Buehler
2024-04-17Rewrite BN_mpi2bn() using CBS and bn_bin2bn_cbs().Joel Sing
ok tb@
2024-04-17Rewrite BN_lebin2bn() using CBS.Joel Sing
We get an implementation of this for free by having bn_bin2bn_cbs() use CBS_get_u8() instead of CBS_get_last_u8(). ok tb@
2024-04-17Provide constant time operations for uint8_t.Joel Sing
These will be used in upcoming changes. ok tb@