summaryrefslogtreecommitdiff
path: root/src/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Align EVP_PKEY_get1_RSA() with EVP_PKEY_get0_RSA()tb2023-09-021-6/+7
|
* Many improvements, almost amounting to a partial rewrite:schwarze2023-09-011-48/+109
| | | | | | | | | | | | | * more precision what the CIPHER_CTX functions do * more precision what an NID is * avoid talking about RC2, use AES-256 for an example instead * clarify that block sizes are measured in bytes * mention additional restrictions regarding valid block sizes * add the missing description of the *_flags(3) functions * mention the public mask constant EVP_CIPH_MODE * add three missing modes that can occur as return values * add the missing entries for *_flags(3) and *_mode(3) below RETURN VALUES * tweak various wordings for precision and conciseness
* Fix EVP_PKEY_get0_RSA() for RSA-PSStb2023-09-011-6/+6
| | | | | | It currently returns NULL. This is OpenSSL 4088b926 + De Morgan. ok jsing
* fix an obvious typo in the OBJ_NAME_add(3) prototypeschwarze2023-09-011-3/+3
|
* Split three new manual pages EVP_CIPHER_nid(3), EVP_CIPHER_CTX_ctrl(3),schwarze2023-08-316-451/+727
| | | | | | | | | | | and EVP_CIPHER_CTX_set_flags(3) out of the excessively large and unwieldy EVP_EncryptInit(3). This causes a number of inaccuracies and gaps to stand out, but i'm not mixing text changes or content additions into this split. Using very useful feedback from tb@ regarding what belongs together and how important the various functions are. I refrained from bothering him with the complete patch, but he likes the general direction.
* Ensure no memory is leaked after passing NULL to ASN1_TIME_normalize()libressl-v3.8.1job2023-08-301-1/+3
| | | | OK tb@
* Document EVP_{CIPHER,MD}_do_all{,_sorted}(3)tb2023-08-303-3/+139
| | | | | | | | | | The function prototypes in the SYNOPSIS don't look great, but schwarze assures me that this is how it is supposed to be. It is rather strange that OpenSSL chose to sprinkle OPENSSL_init_crypto() calls into these four functions rather than two inside OBJ_NAME_do_all{,_sorted}(3). Surely there was a good reason for that. With input and fixes from schwarze
* Fix leaks in copy_issuer()tb2023-08-301-8/+14
| | | | | | | | | | | | | | The stack of subject alternative names from the issuer is parsed using X509V3_EXT_d2i(), so it must be freed with sk_GENERAL_NAME_pop_free(). It's not worth doing complicated ownership handling when the individual alternative names can be copied with GENERAL_NAME_dup(). Previously, ialt and its remaining members would be leaked when the call to sk_GENERAL_NAME_push() failed halfway through. This is only reachable via the issuer:copy x509v3.cnf(5) directive. ok jsing
* Replace last ecdh.h and ecdsa.h occurrences with ec.htb2023-08-294-16/+12
| | | | | | Except if backward compatibility with older LibreSSL and OpenSSL versions is explicitly needed, ecdsa.h and ecdh.h should no longer be used. They are now trivial wrappers of ec.h.
* Move the weak SHA-1 and MD5 hashes out of EVP_DigestInit(3)schwarze2023-08-274-46/+138
| | | | | into a new EVP_sha1(3) manual page, and also mention EVP_md4(3) there. Using input from tb@ and jsing@, who like the general direction.
* document the return value of EVP_PKEY_asn1_find(3) andschwarze2023-08-271-4/+20
| | | | the "len" argument and the return value of EVP_PKEY_asn1_find_str(3)
* EVP_PKEY_set_type_str(3) is now documented, so switch from .Fn to .Xrschwarze2023-08-271-3/+3
|
* document EVP_PKEY_set_type_str(3)schwarze2023-08-271-7/+46
|
* add the missing information that and how flags can be combined,schwarze2023-08-261-3/+7
| | | | and add the missing link to evp(3)
* Write documentation for EVP_CIPHER_CTX_buf_noconst(3) from scratch.schwarze2023-08-261-5/+42
| | | | | | | Put it here rather than into EVP_EncryptInit(3) because similar to EVP_CIPHER_CTX_get_cipher_data(3), application software should not use it. These functions will likely not be needed except by people implementing custom encryption algorithms.
* write documentation for EVP_CIPHER_CTX_copy(3)schwarze2023-08-261-4/+86
| | | | and EVP_CIPHER_CTX_encrypting(3) from scratch
* transfering -> transferringjsg2023-08-261-3/+3
|
* Remove two unnecessary local variablestb2023-08-261-9/+3
|
* make the one-line description read betterschwarze2023-08-251-3/+13
| | | | | and be more specific below RETURN VALUES; OK tb@
* In evp.h rev.s 1.90 and 1.97, tb@ provided EVP_CIPHER_CTX_get_cipher_data(3)schwarze2023-08-253-3/+114
| | | | | | and EVP_CIPHER_CTX_set_cipher_data(3). Import the manual page from the OpenSSL 1.1 branch, which is still under a free licence, with several improvements by me.
* fix eight more instances of copy & paste glitchesschwarze2023-08-251-9/+9
|
* KNF, no assembly changeschwarze2023-08-252-19/+15
| | | | OK tb@ jsing@
* Mention another bug for EVP_add_{cipher,digest}(3)tb2023-08-251-1/+4
|
* Improve EVP_add_cipher.3 a bittb2023-08-251-9/+26
| | | | | Fix some copy-paste errors in the prototypes, tweak the explanatory text and add some more details.
* Add more cross referencestb2023-08-252-4/+7
|
* Document EVP_add_{cipher,digest} and friendstb2023-08-253-3/+163
| | | | | These and EVP_{add,remove}_{cipher,digest}_alias() are mostly for internal use.
* zap a stray spacetb2023-08-251-2/+2
|
* cms_content_bio() is not used outside of cms_lib.ctb2023-08-242-5/+3
| | | | | Make it a static function and remove its prototype from the internal header.
* Some tweaking of cms_content_bio()tb2023-08-241-10/+10
| | | | | | | More idiomatic error checking and drop an always false test for !*pos. Use a slightly closer approximation to actual English sentences in comments. ok jsing
* Better names for the BIOs in CMS_dataInit()tb2023-08-241-14/+14
| | | | | | Rename cmsbio into cms_bio and use {,in_}content_bio for {,i}cont. ok jsing
* Update references from RFC 7539 to RFC 8439tb2023-08-243-10/+10
| | | | | | | | RFC 7539 was superseded by RFC 8439, incorporating errata and making editorial improvements. Very little of substance changed, in particular section numbers remain the same. Prompted by a question from schwarze
* Align the documentation of EVP_chacha20() with actual behaviortb2023-08-241-6/+6
| | | | | | | | Incorrect OpenSSL documentation was moved here and inherited parts of a comment that was fixed in evp/e_chacha.c r1.13. Adjust the manual page accordingly. Discussed with schwarze
* Clarify how the EVP IV is used with ChaChatb2023-08-241-8/+6
| | | | | | | | | | | EVP_chacha20() was aligned to follow OpenSSL's nonconformant implementation during a2k20 by djm and myself in an effort to allow OpenSSH to use the OpenSSL 1.1 API. Some corresponding OpenSSL 1.1 documentation was imported at the same time. A comment attempted to translate between implementation and the incorrect documentation, which was necessarily gibberish. Improve the situation by rephrasing and dropping nonsensical bits. Prompted by a question of schwarze
* Mention key and nonce lengths of AEAD ciphers.schwarze2023-08-232-33/+105
| | | | | | | | | Mention portability considerations regarding the EVP_AEAD API. Avoid confusing words like "older" and "native" API, be specific. Mention RFC 7905. Move publications we don't implement from STANDARDS to CAVEATS. Based on input from jsing@ and tb@, OK tb@.
* Pull the NULL check for cmsbio into the switchtb2023-08-221-14/+10
| | | | ok jsing
* Plug a leak of cont in CMS_dataInit()tb2023-08-221-11/+12
| | | | | | This and ts/ts_rsp_sign.c r1.32 were part of OpenSSL 309e73df. ok jsing
* Plug a leak of ASN1_INTEGR in def_serial_cb()tb2023-08-221-4/+7
| | | | ok jsing
* ec_ameth: clean up eckey_{pub,priv}_encode()tb2023-08-211-62/+67
| | | | | | | | | | | | | | | | | | | Factor eckey_param_free() out of eckey_pub_encode(). ASN1_OBJECT_free() is not actually needed. This will be addressed later. i2o_ECPublicKey() allocates internally if *out == NULL, so no need to do the two-call dance. Its return value is documented to be <= 0 on error, which is wrong in the sense that only 0 is returned. Keep using the same check for <= 0 as everywhere else. Set of EC_PKEY_NO_PARAMETERS after the poorly named eckey_param2type() to avoid potential underhanded side effects. In eckey_priv_encode(), error exits would leak pval was leaked a few times. Avoid this and simplify using i2d's internal allocation. Reinstate the flags in a single error path. ok jsing
* spellingjsg2023-08-211-4/+4
|
* Check X509_digest() return in x509v3_cache_extensions()tb2023-08-181-2/+3
| | | | | | | | On failure invalidate the cert with EXFLAG_INVALID. It's unlikely that a cert would make it through to the end of this function without setting the flag, but it's bad style anyway. ok jsing
* Garbage collect two commented abort()tb2023-08-171-3/+1
|
* Make the local ASN1_OBJECTs consttb2023-08-171-2/+2
| | | | ok jsing
* Remove some unnecessary else branchestb2023-08-171-7/+5
|
* Remove some parents from return statementstb2023-08-171-8/+8
|
* Use cmp instead of i for the result of a comparisontb2023-08-171-5/+5
| | | | ok jsing
* Use OBJ_cmp() instead of inlining two variantstb2023-08-171-12/+4
| | | | | | | | | | This also avoids more undefined behavior with memcmp(). ok jsing PS: Unsolicited advice for no one in particular: there is this awesome tool called grep. If someone reports an issue, you might want to use it to find more instances.
* Avoid memcmp(NULL, x, 0) in OBJ_cmp()tb2023-08-171-6/+7
| | | | | | | | If a->length is 0, either a->data or b->data could be NULL and memcmp() will rely on undefined behavior to compare them as equal. So avoid this comparison in the first place. ok jsing
* add the missing entry for EVP_CIPHER_CTX_ctrl(3) to the RETURN VALUES sectionschwarze2023-08-161-2/+11
|
* Describe more precisely how these functions are supposed to be used,schwarze2023-08-161-19/+185
| | | | | | | | document the control operations supported by EVP_chacha20_poly1305(3), and add the missing STANDARDS and HISTORY sections. This replaces all text written by Matt Caswell and all text Copyrighted by OpenSSL in the year 2019.
* Zap extra parenstb2023-08-151-2/+2
|