summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/crypto_init.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-12-19Correctly describe the return values of BN_hex2bn(3) and BN_dec2bn(3).schwarze1-5/+8
Inspired by OpenSSL commit a130950d Aug 23 12:06:41 2017 -0400 by Rich Salz <rsalz at openssl dot org>, but using a more explicit wording, and fixing *both* places rather than only half of them.
2018-12-19Specify the return values of some of these functions more precisely;schwarze1-15/+16
inspired by OpenSSL commit 1f13ad31 Dec 25 17:50:39 2017 +0800 by Paul Yang <yang sot yang at baishancloud dot com>, but without creating a RETURN VALUES section because that makes no sense here: it would either result in a confusing order of information or in duplicate information.
2018-12-19typo;schwarze1-4/+5
from Jakub Wilk <jwilk at jwilk dot net> via OpenSSL commit a21285b3 Aug 21 18:30:34 2018 +0200
2018-12-16Add regress test for bugs in stdio/fread.c rev 1.13 and 1.17millert3-2/+160
2018-12-16Regenerate root CA list using updated format-pem.pl. Specifically thissthen1-101/+1
drops CA certificates whose validity dates don't comply with the rules on ASN.1 encoding in RFC 5280 (and predecessors - same rule goes back to at least RFC 2459, section 4.1.2.5). LibreSSL strictly enforces this, so attempting to validate certificates signed by these CAs just result in the following: error 13 at 1 depth lookup:format error in certificate's notBefore field "probably" beck@
2018-12-16Add a check that libressl is actually able to verify CA certs.sthen1-12/+28
Skip outputting them if invalid (e.g. GENERALIZEDTIME date before 2050).
2018-12-15add a -R option to set/unset resolver flags.libressl-v2.9.0eric9-20/+101
use strcasecmp for reading args.
2018-12-14Delete a note taken during the rev. 1.1 man page spliteschwarze1-5/+2
that should have been deleted before commit. The cross reference is already present below SEE ALSO. Glitch noticed by jsing@.
2018-12-10Improve speed for the multi-threaded case by reducing lock contention.otto1-30/+21
tested by many; ok florian@
2018-12-09Keep usage in sync with logic if OPENSSL_NO_DES is set.tobias1-1/+3
ok jmc@, jsing@
2018-12-09style; OK ottoflorian1-3/+3
2018-12-07Remove an ugly hack in the client certificate verification code that workstb1-48/+44
around broken GOST implementations. It looks like client certificates with GOST have been completely broken since reimport of the GOST code, so no-one is using LibreSSL this way. The client side was fixed only last week for TLSv1.0 and TLSv1.1. This workaround is now in the way of much needed simplifcation and cleanup, so it is time for it to go. suggested by and ok jsing
2018-12-05remove a stray line accidentally left behind in rev. 1.120;schwarze1-3/+2
patch from Hiltjo Posthuma <hiltjo at codemadness dot org>
2018-12-03Send SSL_AD_DECODE alerts in the case of a bad hello request or antb1-7/+7
invalid change cipher spec. Found due to dead assignment warnings by the Clang static analyzer. ok inoguchi (previous version), jsing
2018-11-30Restore function prototype for ASN1_dup, fixing usage on I32LP64 platforms.jeremy1-1/+7
This prototype was removed inadvertantly in r1.50. OK jsing@
2018-11-29This test does not terminate if malloc conf is preconfigured withbluhm1-2/+6
J. Clear that option to allow running full regress with paranoid malloc flags. This is the same fix as for malloc_ulimit1.
2018-11-29missed adding tls_default_ca_cert_file here. found by sthentedu1-0/+1
2018-11-29update for libtls default cert changes.tedu2-7/+8
bonus: this exposed a few missing const qualifiers.
2018-11-29expose the default cert file as a function, not a define. it's reallytedu5-10/+24
an internal detail of the library, so the string should live inside it, not in the application code. ok jsing
2018-11-29Refactor a tangle in ssl3_send_client_verify() into one function for eachtb1-118/+213
type, sigalgs/rsa/ec/gost. Move a few special dances for GOST where they belong now. This prompted a fix for a long-standing bug with GOST client certificate authentication where tls1_transcript_data() fails since the transcript was already freed before. Add a bit of missing error checking and leave some further cleanup for later. idea, guidance & ok jsing
2018-11-29We're manipulating malloc flags ourselves, start with restting them all.otto1-1/+5
ok bluhm@
2018-11-28Correct lock initialisation for libcrypto.jsing2-16/+55
The current crypto_lock_init() function is not called early enough, meaning that locks are already in use before it gets called. Worse, locks could be in use when they are then initialised. Furthermore, since functions like CRYPTO_lock() are public API, these could be called directly bypassing initialisation. Avoid these issues by using static initialisers. ok bcook@
2018-11-28This test does not terminate if malloc conf is preconfigured withbluhm1-4/+8
J. Clear that option to allow running full regress with paranoid malloc flags. Also fix whitespace. OK otto@
2018-11-27Refactor "find the right pool" code into a function. ok djm@ tb@otto1-65/+34
2018-11-25spelling; from miodjmc1-2/+2
2018-11-24zap 10 tab leading whitespace before 'struct evp_pkey_ctx_st {'tb1-2/+2
2018-11-24Store and return the locking callbacks, restoring previous behaviour.jsing1-6/+12
The previous code meant that a caller could set the locking callback, after which CRYPTO_get_locking_callback() would return non-NULL. Some existing code depends on this behaviour, specifically to identify if lock handling has been configured. As such, always returning NULL from CRYPTO_get_locking_callback() can result in unexpected application behaviour. ok bcook@
2018-11-21Fix DTLS transcript handling for HelloVerifyRequest.jsing4-18/+26
If DTLS sees a HelloVerifyRequest the transcript is reset - the previous tls1_init_finished_mac() function could be called multiple times and would discard any existing state. The replacement tls1_transcript_init() is more strict and fails if a transcript already exists. Provide an explicit tls1_transcript_reset() function and call it from the appropriate places. This also lets us make DTLS less of a special snowflake and call tls1_transcript_init() in the same place as used for TLS. ok beck@ tb@
2018-11-21fold the contents of malloc.conf.5 into malloc.3 and sysctl.2,jmc1-6/+118
now that there is essentially no malloc.conf; text tweaked by deraadt; ok otto deraadt
2018-11-21Introducing malloc_usable_size() was a mistake. While some otherotto2-105/+5
libs have it, it is a function that is considered harmful, so: Delete malloc_usable_size(). It is a function that blurs the line between malloc managed memory and application managed memory and exposes some of the internal workings of malloc. If an application relies on that, it is likely to break using another implementation of malloc. If you want usable size x, just allocate x bytes. ok deraadt@ and other devs
2018-11-20Saw a mention somewhere a while back that the gotdata() function inderaadt5-144/+27
here could creates non-uniformity since very short fetches of 0 would be excluded. blocks of 0 are just as random as any other data, including blocks of 4 4 4.. This is a misguided attempt to identify errors from the entropy churn/gather code doesn't make sense, errors don't happen. ok bcook
2018-11-19Fix compilation on alpha, where DEF_WEAK() really must be paired withguenther1-2/+1
PROTO_NORMAL(). Problem noted by deraadt@
2018-11-19Revert previous - DTLSv1 uses MD5+SHA1 for RSA signature verification.jsing2-10/+4
Discussed with beck@
2018-11-19Revert previous - the default sigalg for RSA key exchange is {sha1,rsa}.jsing1-4/+4
In TLSv1.2, if the client does not send a signature algorithms extension then for RSA key exchange a signature algorithm of {sha1,rsa} is implied. The MD5+SHA1 hash only applies to older versions of TLS, which do not support sigalgs.
2018-11-18Implement malloc_usable_size(); ok millert@ deraadt@ and jmc@ for the man pageotto2-6/+108
2018-11-17Fix DTLS, because DTLS still remains a special flower, allows regress to passbeck2-4/+10
2018-11-17Fix whitespace around assignment operators.tb1-7/+7
2018-11-16revert previousbeck1-5/+3
2018-11-16Fix DTLS. Because the DTLS code is strange. I am really coming around tobeck1-3/+5
joel's line of thinking about it
2018-11-16Unbreak legacy ciphers for prior to 1.1 by setting having a legacybeck4-10/+22
sigalg for MD5_SHA1 and using it as the non sigalgs default ok jsing@
2018-11-15Port OpenSSL commit 99540ec79491f59ed8b46b4edf130e17dc907f52 -- mitigationtb1-4/+4
for a timing vullnerability in ECDSA signature generation (CVE-2018-0735). Note that the blinding that we introduced back in June for ECDSA and DSA should mitigate this and related issues. This simply adds an additional layer of protection. discussed with jsing
2018-11-14Fix wrong sizeof argument by using 'uint16_t *', with minor nit from tb@,mestre1-2/+2
instead of 'uint16_t' Found with llvm's static analyzer, noticed that it was also already reported in Coverity CID 155890 and to ensure this was correct also inspected OpenSSL's equivalent code. OK tb@ and jsing@
2018-11-14didn't found -> didn't find.tb1-2/+2
From Edgar Pettijohn III
2018-11-14In TLS1.2 we use evp_sha1 if we fall back this far, not evp_md5_sha1 as in 1.1beck1-2/+2
Makes connections to outlook.office365.com work
2018-11-13Temporary workaround for breakage seen in www.videolan.org with curve mismatchbeck1-3/+4
2018-11-13Just err if we can't create secretsbeck1-2/+2
2018-11-13NULL out mdctx to prevent possible double free introduced in version 1.4beck1-1/+2
Spotted by maestre@, ok tb@
2018-11-13Fix pkey_ok to be less strange, and add cuve checks required for the EC onesbeck1-9/+26
ok tb@
2018-11-12Missing initialization for pub_key. CID 184303.tb1-2/+2
ok bcook
2018-11-12Rework the sm3 regress based on a suggestion by jsing. Zap the weirdtb1-30/+36
hex_encode() function and use byte arrays instead of strings to store the expected values. Snatch and tweak hexdump() from beck's key_schedule test to pretty-print data in case of failure.