summaryrefslogtreecommitdiff
path: root/lib/libcrypto/evp
AgeCommit message (Collapse)Author
2018-11-24zap 10 tab leading whitespace before 'struct evp_pkey_ctx_st {'Theo Buehler
2018-11-11Add EVP_sm3() to OpenSSL_add_all_digests_internal().Theo Buehler
ok beck inoguchi
2018-11-11Add Ribose Inc's implementation of the SM3 hashing function withTheo Buehler
tweaks from jsing and myself. The SM2/SM3/SM4 algorithms are mandatory for legal use of cryptography within China and [are] widely applied in the country, covering identification/financial cards, contactless, TPM 2.0 and PKI. ok beck inoguchi jsing
2018-09-12Add some accessor functions:Damien Miller
RSA_meth_get_finish() RSA_meth_set1_name() EVP_CIPHER_CTX_(get|set)_iv() feedback and ok jsing@ tb@
2018-08-24Add const to EVP_PKCS82PKEY().Theo Buehler
tested in a bulk by sthen ok jsing
2018-08-24Add consts to EVP_PKEY_asn1_set_private()Theo Buehler
Requires adding a const to the priv_decode() member of EVP_PKEY_ASN1_METHOD and adjusting all *_priv_decode() functions. All this is already documented this way. tested in a bulk build by sthen ok jsing
2018-08-24After removing support for broken PKCS#8 formats (it was high time),Theo Buehler
we can add const to PKCS8_pkey_get0(). In order for this to work, we need to sprinkle a few consts here and there. tested in a bulk by sthen ok jsing
2018-08-24Remove EVP_PKEY2PKCS8_broken() and PKCS8_set_broken()Theo Buehler
Provide PKCS8_pkey_add1_attr_by_NID() and PKCS8_pkey_get0_attrs(). Remove the whole broken code and simplify pkcs8_priv_key_info_st accordingly. Based on OpenSSL commit 54dbf42398e23349b59f258a3dd60387bbc5ba13 plus some const that was added later. tested in a bulk build by sthen ok jsing
2018-08-24Check return value of EVP_EncodeUpdate() in b64_write().Theo Buehler
ok jsing
2018-08-24Convert EVP_EncodeUpdate() to return an int to allow for errorTheo Buehler
checking. Matches our documented behavior. Based on OpenSSL commit c5ebfcab713a82a1d46a51c8c2668c419425b387 tested in a bulk by sthen ok jsing
2018-08-24Provide EVP_CIPHER_CTX_encrypting().Theo Buehler
tested in a bulk by sthen ok jsing
2018-08-24Return an int in BIO_set_cipher() to be able to report errors.Theo Buehler
tested in a bulk by sthen ok jsing
2018-08-14Add a comment that explains what the check is doing and why len >= 1.Theo Buehler
Prompted by a remark by jsing
2018-08-14The UI_add_{input,verify}_string() functions want a length not includingTheo Buehler
the terminating NUL. EVP_read_pw_string_min() got this wrong, leading to a one-byte buffer overrun in all callers of EVP_read_pw_string(). Found by mestre running 'openssl passwd' with MALLOC_OPTIONS including C. Fix this by doing some basic sanity checking in EVP_read_pw_string_min(). Cap the len argument at BUFSIZ and ensure that min < len as well as 0 <= min and 1 <= len. The last two checks are important as these numbers may end up in reallocarray(). ok bcook (on previous version), jsing, mestre
2018-08-10Add glue to EVP_md5_sha1() so that it can be used with EVP_Sign* andJoel Sing
EVP_Verify*. ok tb@
2018-05-30Add a const qualifier to the argument of EVP_PKEY_size().Theo Buehler
tested in a bulk build by sthen ok jsing
2018-05-13Add a const qualifier to the ASN1_OBJECT * argument of the following:Theo Buehler
EVP_PKEY_get_attr_by_OBJ(3), X509at_get_attr_by_OBJ(3), X509at_get0_data_by_OBJ(3), X509_REQ_get_attr_by_OBJ(3) tested in a bulk by sthen ok beck (as part of a larger diff)
2018-05-13Add a const qualifier to the argument of EVP_PKEY_get0_asn1(3).Theo Buehler
tested in a bulk build by sthen ok beck (as part of a larger diff)
2018-05-13Add a const qualifier to the argument of EVP_PKEY_get0(3).Theo Buehler
tested in a bulk build by sthen ok beck (as part of a larger diff)
2018-05-13Add a const qualifier to the argument of EVP_PKEY_bits(3).Theo Buehler
tested in a bulk build by sthen ok beck (as part of a larger diff)
2018-05-13Add a const qualifier to the second argument of EVP_DigestVerifyFinal(3).Theo Buehler
tested in a bulk build by sthen ok beck (as part of a larger diff)
2018-05-02Add const qualifiers to return value of BIO_f_{base64,cipher,md}().Theo Buehler
tested in bulk by sthen ok jsing
2018-04-14make ENGINE_finish() succeed on NULL and simplify callers as inTheo Buehler
OpenSSL commit 7c96dbcdab9 by Rich Salz. This cleans up the caller side quite a bit and reduces the number of lines enclosed in #ifndef OPENSSL_NO_ENGINE. codesearch.debian.net shows that almost nothing checks the return value of ENGINE_finish(). While there, replace a few nearby 'if (!ptr)' with 'if (ptr == NULL)'. ok jsing, tested by & ok inoguchi
2018-03-17Bring in compatibility for OpenSSL 1.1 style init functions.Bob Beck
This adds OPENSSL_init_crypto and OPENSSL_init_ssl, as well thread safety modifications for the existing LibreSSL init functions. The initialization routines are called automatically by the normal entry points into the library, as in newer OpenSSL ok jsing@, nits by tb@ and deraadt@
2018-02-20Provide EVP_PKEY_get0_EC_KEY() and 'if (ret)' vs 'if (ret != 0)' cosmetics.Theo Buehler
ok jsing
2018-02-17Provide EVP_CIPHER_CTX_reset().Joel Sing
Rides previous minor bump.
2018-02-17Provide EVP_MD_CTX_new(), EVP_MD_CTX_free() and EVP_MD_CTX_reset().Joel Sing
2018-02-17Provide further parts of the OpenSSL 1.1 API: {DH,DSA}_get0_{key,pqg}(),Theo Buehler
EVP_PKEY_get0_{DH,DSA,RSA}(), RSA_{g,s}et0_key(). ok jsing
2018-02-14Provide EVP_PKEY_up_ref().Joel Sing
2017-11-28GNU ld has prefixed the contents of .gnu.warning.SYMBOL sectionsTheo Buehler
with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. From Scott Cheloha ok jca, deraadt
2017-08-28Remove EVP_aead_chacha20_poly1305_old() now that the original/oldJoel Sing
chacha20-poly1305 cipher suites have been removed from libssl.
2017-05-11Fix a problem introduced in freezero() conversion and useJonathan Gray
sizeof(struct) not sizeof(pointer). otto@ points out that on OpenBSD currently freezero() would have still zeroed the entire allocation, but this is not documented behaviour and may change in future. ok tom@
2017-05-02use freezero() instead of memset/explicit_bzero + free. SubstantiallyTheo de Raadt
reduces conditional logic (-218, +82). MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH cache alignment calculation bn/bn_exp.c wasn'tt quite right. Two other tricky bits with ASN1_STRING_FLAG_NDEF and BN_FLG_STATIC_DATA where the condition cannot be collapsed completely. Passes regress. ok beck
2017-04-29Stop calling OPENSSL_init() internally, since it is a no-op. Also placeJoel Sing
it under #ifndef LIBRESSL_INTERNAL. ok beck@
2017-03-01Include EVP_md5_sha1() via OpenSSL_add_all_digests().Joel Sing
2017-02-28Add an EVP interface that provides concatenated MD5+SHA1 hashes, which areJoel Sing
used in various parts of TLS 1.0/1.1. This will allow for code simplification in libssl. The same interface exists in OpenSSL 1.1. ok beck@ deraadt@ inoguchi@ millert@
2017-01-31LibreSSL : Truncated packet could crash via OOB readKinichiro Inoguchi
This patch is originally from master branch of OpenSSL. - 2198b3a crypto/evp: harden AEAD ciphers. - 8e20499 crypto/evp: harden RC4_MD5 cipher. ok tom@
2017-01-29Send the function codes from the error functions to the bit bucket,Bob Beck
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
2017-01-21Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.Joel Sing
No change to generated assembly excluding line numbers.
2016-12-21Explicitly export a list of symbols from libcrypto.Joel Sing
Move the "internal" BN functions from bn.h to bn_lcl.h and stop exporting the bn_* symbols. These are documented as only being intended for internal use, so why they were placed in a public header is beyond me... This hides 363 previously exported symbols, most of which exist in headers that are not installed and were never intended to be public. This also removes a few crusty old things that should have died long ago (like _ossl_old_des_read_pw). But don't worry... there are still 3451 symbols exported from the library. With input and testing from inoguchi@. ok beck@ inoguchi@
2016-11-08Stricter checks of ASN1_INTEGER to reject ASN1_NEG_INTEGER in places whenMiod Vallat
they don't make sense. ok beck@
2016-11-05No need to duplicate definitions from evp.h locally.Miod Vallat
ok bock@ jsing@
2016-11-04Replace all uses of magic numbers when operating on OPENSSL_ia32_P[] byMiod Vallat
meaningful constants in a private header file, so that reviewers can actually get a chance to figure out what the code is attempting to do without knowing all cpuid bits. While there, turn it from an array of two 32-bit ints into a properly aligned 64-bit int. Use of OPENSSL_ia32_P is now restricted to the assembler parts. C code will now always use OPENSSL_cpu_caps() and check for the proper bits in the whole 64-bit word it returns. i386 tests and ok jsing@
2016-11-04Remove I386_ONLY define. It was only used to prefer aMiod Vallat
faster-on-genuine-80386-but-slower-on-80486-onwards innstruction sequence in the SHA512 code, and had not been enabled in years, if at all. ok tom@ bcook@
2016-09-09back out calls to EVP_CIPHER_CTX_cleanup() in EVP_Cipher/Encrypt/DecryptFinalBrent Cook
Software that refers to ctx after calling Final breaks with these changes. revert parts of 1.31 and 1.32
2016-09-04include <sys/types.h> to get <sys/cdefs.h> instead (for __warn_references)Brent Cook
corrected by deraadt@ / guenther@
2016-09-04include <sys/cdefs.h> for portableBrent Cook
2016-09-02warn on use of deprecated EVP functionsBrent Cook
This adds a linker warning for EVP_EncryptFinal(), EVP_DecryptFinal(), EVP_CipherFinal(), and documents the recent behavior updates. ok beck@
2016-05-30deprecate internal use of EVP_[Cipher|Encrypt|Decrypt]_Final.Bob Beck
14 years ago these were changed in OpenSSL to be the same as the _ex functions. We use the _ex functions only internally to ensure it is obvious the ctx must be cleared. ok bcook@
2016-05-04fix for integer overflow in encode and encrypt update functions.Ted Unangst
additionally, in EncodeUpdate, if the amount written would overflow, return 0 instead to prevent bugs in the caller. CVE-2016-2105 and CVE-2016-2106 from openssl.