aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops/crypto_rand.c
AgeCommit message (Collapse)Author
2021-06-28Suppress strict-prototypes warning on NSS pk11pub.h headerNick Mathewson
We already did this in a couple of places, but there are more that we didn't get. This is necessary for systems with versions of NSS that don't do their prototypes properly. Fixes #40409; bugfix on 0.3.5.1-alpha.
2021-06-10Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-06-10Assert on _all_ failures from RAND_bytes().Nick Mathewson
Previously, we would detect errors from a missing RNG implementation, but not failures from the RNG code itself. Fortunately, it appears those failures do not happen in practice when Tor is using OpenSSL's default RNG implementation. Fixes bug 40390; bugfix on 0.2.8.1-alpha. This issue is also tracked as TROVE-2021-004. Reported by Jann Horn at Google's Project Zero.
2020-01-09Merge branch 'pre_formatter_cleanups_squashed'Nick Mathewson
2020-01-09Use new ENABLE/DISABLE_GCC_WARNINGNick Mathewson
This is an automated commit, generated by: perl -i -pe 'next if /define/; s/((?:ENABLE|DISABLE)_GCC_WARNING)\(([A-Za-z0-9_\-]+)\)/$1(\"-W$2\")/' src/*/*/*.[ch] src/*/*.[ch]
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-06-05Run "make autostyle."Nick Mathewson
2019-04-30Use safe_mem_is_zero in a few more places.Nick Mathewson
I don't believe any of these represent a real timing vulnerability (remote timing against memcmp() on a modern CPU is not easy), but these are the ones where I believe we should be more careful.
2019-02-14Merge branch 'tor-github/pr/702'David Goulet
2019-02-14Merge branch 'maint-0.3.5'George Kadianakis
2019-02-08Add more openssl includes to fix no-deprecated compilationNick Mathewson
Closes ticket 29026; patch from Mangix.
2019-02-06Extract numeric CSPRNG functions into a new module.Nick Mathewson
Some of the code for getting a random value within a range wants to be shared between crypto_rand() and the new crypto_fast_rng() code.
2019-02-06Remove extraneous #if/#endif wrapper in crypto_rand.cNick Mathewson
I don't know how this got here, but this kind of a wrapper only belongs in a header file.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-10Rename crypto_rand_uint32() -> crypto_rand_u32()George Kadianakis
See https://github.com/torproject/tor/pull/624#discussion_r246453777
2019-01-02Implement and test probability distributions used by WTF-PAD.George Kadianakis
This project introduces the prob_distr.c subsystem which implements all the probability distributions that WTF-PAD needs. It also adds unittests for all of them. Code and tests courtesy of Riastradh. Co-authored-by: Taylor R Campbell <campbell+tor@mumble.net> Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2018-09-18Make crypto_strongest_rand() non-mockableNick Mathewson
Instead, have it call a mockable function. We don't want crypto_strongest_rand() to be mockable, since doing so creates a type error when we call it from ed25519-donna, which we do not build in a test mode. Fixes bug 27728; bugfix on 0.3.5.1-alpha
2018-09-07Merge remote-tracking branch 'dgoulet/ticket20700_035_03'Nick Mathewson
2018-09-07test: Build an HSv3 descriptor with authorized clientSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-21When enabling NSS, disable OpenSSL.Nick Mathewson
We used to link both libraries at once, but now that I'm working on TLS, there's nothing left to keep OpenSSL around for when NSS is enabled. Note that this patch causes a couple of places that still assumed OpenSSL to be disabled when NSS is enabled - tor-gencert - pbkdf2
2018-07-31Use NSS in crypto_rand.cNick Mathewson
This is comparatively straightforward too, except for a couple of twists: * For as long as we're building with two crypto libraries, we want to seed _both_ their RNGs, and use _both_ their RNGs to improve the output of crypto_strongest_rand() * The NSS prng will sometimes refuse to generate huge outputs. When it does, we stretch the output with SHAKE. We only need this for the tests.
2018-07-10Rename torlog.[ch] to log.[ch]Nick Mathewson
Fun fact: these files used to be called log.[ch] until we ran into conflicts with systems having a log.h file. But now that we always include "lib/log/log.h", we should be fine.
2018-07-10Rename util_malloc to malloc.Nick Mathewson
2018-06-28Remove all include common/ uses in crypto_ops and tls.Nick Mathewson
2018-06-28Move weakrng into lib/intmathNick Mathewson
2018-06-27Move util_format into a new libtor-encoding libraryNick Mathewson
libtor-encoding is about various ways to transform data to and from character sequences.
2018-06-27Fix up include paths for sandbox.h (automated)Nick Mathewson
2018-06-22Automated fixup of include paths after torlog.h movement.Nick Mathewson
2018-06-22Extract smartlist.h from container.hNick Mathewson
2018-06-22Rectify include paths after container split (automatic)Nick Mathewson
2018-06-21Rectify include paths (automated).Nick Mathewson
You have no idea how glad I am that this is automated.
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-21Split crypto and tls libraries into directoriesNick Mathewson
I am calling the crypto library "crypt_ops", since I want higher-level crypto things to be separated from lower-level ones. This library will hold only the low-level ones, once we have it refactored.