summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Rework EVP_PKEY_free()tb2023-12-251-11/+7
| | | | | | | | Use pkey instead of x, remove the pointless variable i, no need to check for NULL before sk_X509_ATTRIBUTE_pop_free(), switch to freezero() to leave fewer invalid pointers around. ok jsing
* Move EVP_PKEY_free() up next to evp_pkey_free_pkey_ptr()tb2023-12-251-19/+19
| | | | ok jsing
* Fix EVP_PKEY_up_ref() - must have hit ^X somehowtb2023-12-251-2/+2
|
* Rework evp_pkey_free_pkey_ptr()tb2023-12-251-6/+7
| | | | | | Rename the variable from x into pkey, make it NULL safe and unindent. ok jsing
* Rename EVP_PKEY_free_it() into evp_pkey_free_pkey_ptr()tb2023-12-251-4/+4
| | | | ok jsing
* Move the confusingly named EVP_PKEY_free_it() a bit uptb2023-12-251-12/+10
| | | | ok jsing
* Simplify EVP_PKEY_up_ref()tb2023-12-251-3/+2
| | | | | | There is no need for a local variable and a ternary operator here. ok jsing
* Switch EVP_PKEY_new() from malloc() to calloc()tb2023-12-251-8/+6
| | | | ok jsing
* Clarify that the ENGINE argument is ignored; OK tb@.schwarze2023-12-251-11/+10
| | | | | While here, also switch the argument placeholder from *impl to *engine as suggested by tb@.
* Move EVP_Digest() next to the functions it wrapstb2023-12-241-18/+18
| | | | | | It really makes no sense to have the mess that is EVP_MD_CTX_copy{,_ex}() live between EVP_Digest{Init{,_ex},Update,Final{,_ex}}() and EVP_Digest(), the latter being a relatively simple wrapper of Init_ex/Update/Final_ex.
* Use more consistent order for Init/Update/Finaltb2023-12-231-17/+17
| | | | | | | Consistently implement the _ex() version after the non-extended versions, First Cipher Init/Update/Final, then Encrypt, then Decrypt. This only switches the order of CipherFinal{,_ex} and move the DecryptInit* down, so they are no longer somewhere in the middle of the Encrypt* functions.
* Prefix get_trusted_issuer() with x509_vfy_tb2023-12-231-4/+3
|
* Remove two no longer necessary reminderstb2023-12-221-3/+1
| | | | | I guess I'm getting old. Next time I'll have to add a reminder not to forget to remove the reminder.
* Remove extra whitespace on two linestb2023-12-221-3/+3
|
* Add length checks for partial_lentb2023-12-221-6/+7
| | | | | | | These remove a few more potential out-of-bounds accesses and ensure in particular that the padding is between 1 and block_size (inclusive). ok joshua jsing
* Rename check_hosts()tb2023-12-221-3/+3
|
* Replace check_trust() with its x509_vfy_ prefixed wrappertb2023-12-221-11/+4
|
* Replace check_chain_extensions() with its x509_vfy_ wrappertb2023-12-221-8/+2
|
* Replace check_id() with its x509_vfy_check_id() wrappertb2023-12-221-9/+4
|
* Remove a bunch of function pointers from X509_STORE_CTXtb2023-12-222-42/+18
| | | | | | | | | These are only ever set to one particular function which is either local to this file or part of the public API and we never added the public API to set them to something else. Prefix the local functions touched in this commit with x509_vfy_. More cleanup to follow. ok joshua jsing
* Simplify some logic in EVP_EncryptInit_ex()tb2023-12-221-24/+28
| | | | | | | | | | Pull up the EVP_R_NO_CIPHER_SET check that was hidden somewhere down in the middle of the function. Handle the reuse case outside of the big non-NULL cipher case for now. This looks a bit odd but relies on the invariant that cipher_data is only set if the cipher is set. It will be reworked in a subsequent commit. ok jsing
* Clean up includes in cms_smime.ctb2023-12-221-7/+14
|
* evp_enc: make some flag checks explicittb2023-12-221-4/+4
| | | | ok joshua jsing
* Remove cleanup() and get_crl() from X509_STORE_CTXtb2023-12-222-15/+3
| | | | ok jsing
* Remove unused function pointers from X509_STOREtb2023-12-222-55/+11
| | | | | | | | | The struct underlying the X509_STORE type is opaque ars and nothing uses the accessors that OpenSSL added blindly for these. Therefore we didn't add them in the first place. So this rips out several dozens of lines of dead code. ok beck joshua jsing
* Remove EVP_PKEY_asn1_add{0,_alias}() documentationtb2023-12-214-78/+14
| | | | | | This API was recently neutered and will be removed in the next major bump. Mark it as intentionally undocumented in EVP_PKEY_asn1_new.3 and remove it from all other manuals.
* Mark some API-to-be-removed as intentionally undocumentedtb2023-12-211-2/+6
|
* Remove some superfluous parenthesestb2023-12-211-3/+3
|
* Clean up includes in cms_pwri.ctb2023-12-201-8/+10
|
* Use BIO_indent() for indentation in tasn_prn.ctb2023-12-201-10/+4
| | | | | | | | | | | | | | | Using a loop to print pieces of a static buffer containing 20 spaces to indent things is just silly. Even sillier is making this buffer const without looking what it's actually used for... There is BIO_indent() or BIO_printf() that can handle "%*s". Add a length check to preserve behavior since BIO_indent() succeeds for negattive indent. However, peak silliness must be how BIO_dump_indent_cb() indents things. That's for another day. ok jsing
* Rename impl into enginetb2023-12-201-4/+4
|
* Rename inl to in_len throughout the filetb2023-12-201-32/+32
|
* Rename outl into out_len throughout the filetb2023-12-201-32/+32
|
* Tweak a comment a bittb2023-12-201-3/+3
|
* Remove block_mask from EVP_CIPHER_CTXtb2023-12-202-7/+15
| | | | | | | The block mask is only used in EVP_{De,En}cryptUpdate(). There's no need to hang it off the EVP_CIPHER_CTX since it is easy to compute and validate. ok joshua jsing
* Add some sanity checks for EVP_CIPHER_meth_new()tb2023-12-201-1/+8
| | | | | | | Ensure that the nid and key length are non-negative and that the block size is one of the three sizes 1, 8, or 16 supported by the EVP subsystem. ok joshua jsing
* Merge p_open and p_seal into p_legacytb2023-12-204-247/+104
| | | | discussed with jsing
* Fold p_dec.c and p_enc.c into a new p_legacy.ctb2023-12-203-81/+16
| | | | discussed with jsing
* Less confusing variable names in EVP_PKEY_{de,en}crypt_old()tb2023-12-202-10/+10
| | | | ok jsing
* Improve local variable namestb2023-12-201-29/+29
| | | | | | | Rename the slightly awkward buf_offset into partial_len and rename buf_avail into partial_needed to match. suggested by jsing
* Rename buf_len into partial_len in EVP_CIPHER_CTXtb2023-12-202-11/+11
| | | | suggested by jsing
* Clean up EVP_DecryptFinal_ex()tb2023-12-201-32/+35
| | | | | | | | | | Rework the code to use the usual variable names, return early if we have block size 1 and unindent the remainder of the code for block sizes 8 and 16. Rework the padding check to be less acrobatic and copy the remainder of the plain text into out using memcpy() rather than a for loop. input/ok jsing
* Clean up EVP_EncryptFinal_ex()tb2023-12-201-16/+13
| | | | | | | This switches to the variable names used in other functions, adds a reminder to add a missing length check and uses memset for the padding. ok jsing
* Simplify EVP_DecryptUpdate() a bittb2023-12-201-26/+28
| | | | | | | | | | | | | | | This time the block size is called b and there's some awful length fiddling with fix_len, which until recently also served as store for the return value for do_cipher()... If we land on a block boundary, we keep the last block decrypted and don't count it as part of the output. So in the next call we need to feed it back in. Feeding it back in counts as output written this time around, so instead of remembering that we need to adjust outl, keep a tally of the bytes written. This way we can also do some overflow and underflow checking. ok jsing
* Remove commented out version of EVP_SealUpdate()tb2023-12-201-13/+1
|
* Remove preprocessor mess in EVP_PKEY_{de,en}crypt_old()tb2023-12-202-39/+8
| | | | | | | | This was done the worst possible way. It would be much simpler to invert the logic and use a single #ifdef. jsing prefers keeping the current logic and suggested we ditch the preprocessor mess altogether. ok jsing, claudio agreed with the initial diff
* Remove a changelog from 1991tb2023-12-201-8/+1
|
* DES_random_key() sets the keytb2023-12-203-71/+15
| | | | | There's no need to have 60 lines of license for 4 lines of actual code. Move DES_random_key() to set_key.c.
* Remove commented-out codetb2023-12-201-8/+1
|
* A small cleanup of malloc_bytes(), getting rid of a goto and a tinyotto2023-12-191-29/+27
| | | | bit of optimization; ok tb@ asou@