summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove e_old.c againtb2023-04-261-159/+0
| | | | | | | | | Also remove nonexistent symbols #defined to other symbols that confuse some linkers in -portable. This commit entails no ABI change on OpenBSD. Discussed with jsing
* Reinstate e_old.c it is still used by -portabletb2023-04-251-0/+159
|
* e_old can also gotb2023-04-251-159/+0
|
* Move truncated sha-2 and sha3 out of #ifdef wrapperstb2023-04-251-5/+1
|
* Remove X9.31 supporttb2023-04-251-2/+1
| | | | ok jsing
* Wire up truncated SHA-2, SHA-3 and related thingstb2023-04-251-1/+9
| | | | from jsing
* Provide EVP methods for SHA3 224/256/384/512.jsing2023-04-162-1/+182
| | | | ok tb@
* Provide EVP methods for SHA512/224 and SHA512/256.jsing2023-04-162-2/+83
| | | | ok tb@
* Provide and use sha{224,384}_{update,final} functions.jsing2023-04-091-28/+54
| | | | | | | | | | Improve readability and consistency by providing and using functions named for the specific hash, rather than reusing the sha256/sha512 update and final functions. No functional change. ok tb@
* Rename SHA functions to have sha{1,224,256,384,512}_ prefix.jsing2023-04-091-31/+31
| | | | | | | | Also remove some unnecessary parentheses. No functional change. ok tb@
* Expose the EVP_CIPHER_meth_* API (setter only) in evp.htb2023-03-101-3/+1
|
* Convert EVP_CIPHER_meth_dup() to using calloc()tb2023-03-011-3/+2
| | | | | | | There is no reason for this to call EVP_CIPHER_meth_new(), as the flags will be copied a line later anyway. Simplify this. Requested by jsing
* Make cipher_method_lib.c compile with LibreSSLtb2023-03-011-15/+29
| | | | | | | OPENSSL_zalloc() -> calloc(), OPENSSL_free() -> free() and a few assorted cosmetic tweaks to match our style better. ok jsing
* Add EVP_CIPHER_meth_* prototypes to evp.htb2023-03-011-1/+25
| | | | | | | As usual, this will be guarded by LIBRESSL_INTERNAL || LIBRESSL_NEXT_API until the next bump. ok jsing
* Make the cleanup() method return an int againtb2023-03-014-7/+12
| | | | | | | | | This partially reverts jsing's OpenBSD commit b8185953, but without adding back the error check that potentialy results in dumb leaks. No cleanup() method in the wild returns anything but 1. Since that's the signature in the EVP_CIPHER_meth_* API, we have no choice... ok jsing
* Fix line wrapping of function pointer argumentstb2023-03-011-15/+8
| | | | ok jsing
* First KNF approximation as per knfmt(1)tb2023-03-011-60/+72
| | | | ok jsing
* Drop the EVP_CIPHER_METH_get_* functionstb2023-03-011-42/+1
| | | | | | | | Nothing interesting uses them. There's a Debian SSH-1 module and corresponding ncrack bits. That's not reason enough to have this garbage. ok jsing
* Add RCS tagtb2023-03-011-0/+1
|
* Revert OpenSSL commit aa6bb135tb2023-03-011-5/+54
| | | | | | | | | | | | This reinstates the original license on this file. Don't bother bumping the copyright year. Nothing interesting has happened in here since the initial commit. (There was one interesting commit though: "Don't care openssl_zmalloc()", which is interesting due to the lack of care, not because it's copyright worthy) ok jsing
* libcrypto: import a copy of OpenSSL 1.1's cmeth_lib.ctb2023-03-011-0/+151
| | | | | | | | | | This is the file as of OpenSSL 1.1.1 commit 82dfb986. Call the file cipher_method_lib.c since the short names in this directory are hard enough to read. This is a first step towards providing the poorly named EVP_CIPHER_meth_* API which is needed by some projects because of EVP_CIPHER opacity. ok jsing
* spelling fixes; from paul tagliamontejmc2022-12-263-6/+6
| | | | | | | i removed the arithmetics -> arithmetic changes, as i felt they were not clearly correct ok tb
* Make header guards of internal headers consistenttb2022-11-261-4/+4
| | | | | Not all of them, only those that didn't leak into a public header... Yes.
* Make internal header file names consistenttb2022-11-2653-113/+113
| | | | | | | | | | | | | | | | Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
* Change the pkey.ptr from char * to void *tb2022-11-182-4/+4
| | | | | | | | Now that EVP_PKEY is opaque, there is no reason to keep the ptr member of the pkey union as a weird char pointer, a void pointer will do. This avoids a few stupid casts and simplifies an upcoming diff. ok jsing
* Expose various EVP hooks for Ed25519 and X25519tb2022-11-131-6/+3
| | | | | | | | This adds the EVP_PKEY_ED25519 and EVP_PKEY_X25519 aliases for the NIDs and exposes the raw public key API. The ED25519_KEYLEN and X25519_KEYLEN defines are still kept internal for now to match what OpenSSL have. We may want to expose those later.
* Implement EVP interfaces for Ed25519 and X25519.jsing2022-11-103-3/+26
| | | | ok beck@ tb@
* Provide digestsign/digestverify hooks for EVP_PKEY_METHOD.jsing2022-11-104-4/+32
| | | | | | These are needed for EVP implementations of Ed25519 and X25519. ok beck@ tb@
* Port EVP raw key API from OpenSSL.jsing2022-11-103-4/+106
| | | | | | This will be needed to deal with Curve25519 based keys. ok beck@ tb@
* Fix up indentation for EVP_PKEY_* defines.jsing2022-11-091-19/+19
|
* Clean up EVP_PKEY_METHOD related tables and code.jsing2022-11-091-56/+41
| | | | | | | This is effectively the same as done for EVP_PKEY_ASN1_METHOD, although this table only has nine entries. ok tb@
* Sort EVP_PKEY_METHOD externs.jsing2022-11-091-5/+10
|
* Add EVP_chacha20_poly1305()tb2022-10-211-1/+4
| | | | | | Omission reported by jca. ok jca jsing
* Use LONG_MAX as the limit for ciphers with long based APIs.jsing2022-09-156-169/+120
| | | | | | | | | | | These ciphers have long based APIs, while EVP has a size_t based API. The intent of these loops is to handle sizes that are bigger than LONG_MAX. Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX rounded down to a large block size, ensuring that it is a block size multiple. Revert the recently added overflow checks now that this is handled more appropriately. ok tb@
* Stop pretending that EVP_CIPHER cleanup can fail.jsing2022-09-134-14/+15
| | | | | | | Now that EVP_CIPHER is opaque, stop pretending that EVP_CIPHER cleanup can fail. ok tb@
* Expose EVP_chacha20_poly1305()tb2022-09-111-3/+1
| | | | ok jsing
* Expose various EVP AEAD constants for EVP ChaCha and QUICtb2022-09-111-3/+1
| | | | ok jsing
* Increment the input and output position for EVP AES CFB1.jsing2022-09-101-1/+3
| | | | | | | | | | The length is decremented, however the input is repeatedly read from and output written to the same position. Correct this by actually incrementing the input and output pointers. Found via OpenSSL 604e591ed7, ok tb@
* Use correct length for EVP CFB mode ciphers.jsing2022-09-107-22/+22
| | | | | | | | | | The BLOCK_CIPHER_* macros contained a bug where the total length is passed to the underlying cipher implementation, rather than the length of the current chunk. Correct this and use the chunk length instead. Should address the remaining issues reported by Coverity. ok tb@
* Replace aes_{ccm,xts}_cleanup usage with NULL.jsing2022-09-061-16/+11
| | | | Only change in generated assembly is due to line numbers.
* Stop casting a size_t to a long and then passing it as a size_t.jsing2022-09-063-31/+31
| | | | | | | | | These cipher implementations take a size_t length argument, so stop casting it to a long. Found by Coverity. ok tb@
* Remove dead code.jsing2022-09-042-36/+12
| | | | No change in generated assembly.
* Add bounds checks for various EVP cipher implementations.jsing2022-09-046-7/+98
| | | | | | | | | | The EVP cipher API uses size_t, however a number of the underlying implementations use long in their API. This means that an input with size > LONG_MAX will go negative. Found by Coverity, hiding under a large pile of macros. ok tb@
* Remove dead code.jsing2022-09-045-25/+10
| | | | Only change to generated assembly is due to line numbers.
* Expand the looney M_do_cipher macro.jsing2022-09-041-11/+9
| | | | Only change in generated assembly is due to line numbers.
* Rearrange some functions.jsing2022-09-048-177/+141
| | | | | | | Pull the init_key and ctrl (if present) functions up to the top. This improves readability and allows for the removal of function prototypes. No functional change.
* Remove now unused EVP_C_DATA macro.jsing2022-09-041-3/+1
|
* Remove now unused BLOCK_CIPHER_* macros.jsing2022-09-041-186/+1
|
* Expand BLOCK_CIPHER_* macros.jsing2022-09-041-15/+108
| | | | No change in generated assembly.
* Mechanically expand BLOCK_CIPHER_* macros.jsing2022-09-042-32/+387
| | | | No change in generated assembly.