summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Avoid memcmp() with NULL pointer and 0 lengthtb2023-08-151-3/+3
|
* Clean up alignment handling.jsing2023-08-152-57/+67
| | | | | | | | Instead of using HOST_{c2l,l2c} macros, provide and use crypto_load_le32toh() and crypto_store_htole32(). In some cases just use htole32() directly. ok tb@
* Use MD5_LONG instead of unsigned int for consistency.jsing2023-08-151-3/+3
| | | | ok tb@
* Condition only on #ifdef MD5_ASM.jsing2023-08-151-15/+5
| | | | | | | There are a bunch of unnecessary preprocessor directives - just condition on MD5_ASM, the same as we do elsewhere. ok tb@
* Prepare tlsfuzzer.py for ports updatetb2023-08-141-3/+13
|
* Inline INIT_DATA_* defines.jsing2023-08-141-10/+7
| | | | ok tb@
* style(9)jsing2023-08-141-6/+6
|
* Below SEE ALSO, point to all pages documenting the evp.h sub-library, andschwarze2023-08-141-11/+56
| | | | | | | | also point to a selection of functions from other sub-libraries that rely on evp.h objects, in particular on EVP_CIPHER, EVP_MD, and EVP_PKEY. While here, merge a few trivial improvements to orthography and punctuation from the OpenSSL 1.1 branch.
* import EVP_sha3_224(3) from the OpenSSL 1.1 branch, which is still underschwarze2023-08-143-3/+97
| | | | a free license, tweaked by me
* netcat: avoid issuing syscalls on fd -1tb2023-08-141-3/+9
| | | | | | | | | | | In case a socket error condition occurs, readwrite() invalidates the corresponding fd. Later on, readwrite() may still issue a syscall on it. Avoid that by adding a couple of checks for fd == -1. Reported and fix suggested by Leah Neukirchen. Fixes https://github.com/libressl/openbsd/issues/143 "looks right" deraadt
* fix whitespacetb2023-08-131-14/+13
|
* Extent the modf() tests; from Willemijn Coene.miod2023-08-131-18/+50
|
* document return values of the control function in EVP_MD_meth_set_ctrl(3)schwarze2023-08-121-5/+15
|
* first batch of intentionally undocumented EVP constants:schwarze2023-08-121-1/+10
| | | | some EVP_MD_CTRL_*, some EVP_MD_CTX_FLAG_*, and all of EVP_F_* and EVP_R_*
* 1. Tweak the descriptions of EVP_MD_CTX_ctrl(3), EVP_MD_CTX_set_flags(3),schwarze2023-08-121-52/+107
| | | | | | | | EVP_MD_CTX_clear_flags(3), EVP_MD_CTX_test_flags(3), and the atrocious EVP_MD_CTX_set_pkey_ctx(3) for precision. 2. Tweak the description of EVP_MD_type(3) and EVP_MD_CTX_type(3) for conciseness. 3. Add a few missing HISTORY bits.
* Remove a blatant lie about DSA_dup_DHtb2023-08-121-6/+2
| | | | | q is copied across since OpenSSL 31360957 which hit our tree with OpenSSL 1.0.1c in October 2012.
* The int_ prefix also leaves the ec_ameth messtb2023-08-121-5/+5
| | | | The prefixes in here are all over the place... This removes one variety.
* RSA's _free and _size also lose their int_ prefixtb2023-08-121-7/+7
|
* Drop silly int_ prefix from _free() and _size()tb2023-08-122-10/+10
|
* Free {priv,pub}_key before assigning to ittb2023-08-122-2/+7
| | | | | | | | While it isn't the case for the default implementations, custom DH and DSA methods could conceivably populate private and public keys, which in turn would result in leaks in the pub/priv decode methods. ok jsing
* Readability tweak for key parameters in DSAtb2023-08-121-2/+2
| | | | ok jsing
* Simplify and unify missing_parameters() for DH and DSAtb2023-08-122-11/+8
| | | | ok jsing
* Now that the DH is sensibly called dh instead of a, we can also renametb2023-08-121-10/+10
| | | | | abuf, alen and aout to names that make sense, such as buf, buf_len and secret_len.
* a is a silly name for a DHtb2023-08-121-14/+14
|
* Use printf for consistencytb2023-08-121-5/+5
|
* Check that {DH,DSA}_get0_engine() returns NULL if OPENSSL_NO_ENGINE istb2023-08-122-2/+16
| | | | defined.
* Convert {DH,DSA}_new_method() to using calloc()tb2023-08-122-83/+54
| | | | | | | | | | | | | | | Due to OPENSSL_NO_ENGINE the engine member of dh and dsa is currently uninitialized. As a consequence, {DH,DSA}_get0_engine() will return a garbage pointer, which is particularly bad because the only reason we kept them in the first place is that they are used by some software... A side effect of freeing with {DH,DSA}_free() instead of a hand-rolled version is that we may call ->meth->finish() before ->meth->init() was called. We need a NULL check for ->meth to be on the safe side in case we should need to bring ENGINE back. with nits from djm ok deraadt djm
* Add regress coverage for DH and for DSA parameterstb2023-08-111-2/+267
|
* Merge various improvements from the OpenSSL 1.1 branch,schwarze2023-08-111-13/+148
| | | | | | | | | | | | | | which is still under a free license. * document EVP_MD_CTX_set_flags, EVP_MD_CTX_clear_flags, EVP_MD_CTX_test_flags * document EVP_MD_flags, EVP_MD_CTX_md_data * document EVP_MD_CTX_pkey_ctx, EVP_MD_CTX_set_pkey_ctx * correct arg type of EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type * more information about EVP_MD_CTX_ctrl * add missing <string.h> and correct one variable type below EXAMPLES * two orthographic improvements with a few wording tweaks by me
* Stop including md32_common.h.jsing2023-08-111-15/+1
| | | | | Now that we're no longer dependent on md32_common.h, stop including it. Remove various defines that only existed for md32_common.h usage.
* Demacro sha256.jsing2023-08-111-49/+114
| | | | | | | | | | | | | | Replace macros with static inline functions, as well as writing out the variable rotations instead of trying to outsmart the compiler. Also pull the message schedule update up and complete it prior to commencement of the round. Also use rotate right, rather than transposed rotate left. Overall this is more readable and more closely follows the specification. On some platforms (e.g. aarch64) there is no noteable change in performance, while on others there is a significant improvement (more than 25% on arm). ok miod@ tb@
* Improve variable names in {dh,dsa}_{pub,priv}_{de,en}code()tb2023-08-112-114/+114
| | | | | | | | Use aint for the ASN1_INTEGER holding the key and astr for the ASN1_STRING holding the parameters. This frees up key and params for their DER encoded versions, matching the naming we use elsewhere much more closely. ok jsing
* Use params{,_len} in {dh,dsa}_params_{en,de}code()tb2023-08-112-10/+10
|
* Use key/key_len in old_dsa_priv_{en,de}code()tb2023-08-111-5/+5
| | | | ok jsing
* Add back an empty line that I didn't really want to removetb2023-08-111-1/+2
|
* Align dh and dsa decoding functions with encodingtb2023-08-112-142/+173
| | | | | | | | | This adds some missing error checks and fixes and unifies error codes which were (as usual) all over the place or just plain nonsense. Use an auxiliary variable for d2i invocations even though it is not really needed here. ok jsing
* Rename env_md{,_ctx}_st to evp_md{,_ctx}_sttb2023-08-112-6/+6
| | | | | | | | | | | | | | As everyone knows (and who doesn't know will immediately guess), EVP is short for envelope. Most structs backing the public EVP_* types are called evp_*. For the EVP_MD and EVP_MD_CTX types, someone used env_md_st and env_md_ctx_st, which, as jsing pointed out, may or may not be related to a much less obvious abbreviation of envelope. It could also simply have been for reasons of inconsistency. Be all that as it may: rename these structs to use the evp_* namespace to match all the other EVP types, as well as upstream. ok jsing
* Use EVP_MD in HKDF() and HKDF_extract() prototypestb2023-08-111-5/+5
| | | | | | | | Switch these prototypes to be like all other code and use the EVP_MD type rather than the internal name of the struct. This also makes the function definitions match the prototypes. ok jsing
* Move EC_KEY and EC_KEY_METHOD typedefs to ossl_typ.htb2023-08-112-5/+5
| | | | ok jsing
* Convert {dh,dsa}_{pub,priv}_encode() to single exittb2023-08-102-84/+94
| | | | | | | Use the same variable names throughout these functions and unify them some more. ok jsing
* Add the missing ".Nm X509_STORE_CTX_check_issued_fn" to the NAME sectionschwarze2023-08-101-2/+4
| | | | | | | such that `man X509_STORE_CTX_check_issued_fn` works. While here, add a Copyright notice for Job Snijders because he added a significant amount of text to this file in March 2023. OK job@
* Clean up {dh,dsa}_pub_encode()tb2023-08-102-46/+54
| | | | | | | This brings these two messy functions into more usual shape. There is a lot more that can be done in here. It is a step in the right direction. ok jsing
* Fix a leak in rsa_pub_encode()tb2023-08-101-12/+19
| | | | | | | | rsa_param_encode() allocates the PSS parameters in an ASN1_STRING which is leaked if any error occurs later in rsa_pub_encode(). Convert the rest of the code to follow our ordinary idioms more closely. ok jsing
* In x509_vfy.h rev. 1.60 and rev. 1.62 (April 2023), tb@ providedschwarze2023-08-101-26/+51
| | | | | X509_STORE_CTX_get1_certs(3) and X509_STORE_CTX_get1_crls(3). Document them and mark their aliases as deprecated.
* Remove now unnecessary 'do {} while (0);' and move variable declaration.jsing2023-08-101-5/+2
| | | | No functional change.
* Expand HASH_MAKE_STRING.jsing2023-08-101-13/+13
| | | | No change to generated assembly.
* Remove MD32_XARRAY remnants.jsing2023-08-101-4/+1
|
* Reorder functions.jsing2023-08-101-119/+119
| | | | No functional change.
* Implement MD5_{Update,Transform,Final}() directly in md5.c.jsing2023-08-101-1/+103
| | | | | | | | Copy the update, transform and final functions from md32_common.h, manually expanding the macros for MD5. This will allow for further clean up to occur. No change in generated assembly.
* Tidy includes.jsing2023-08-102-8/+3
|