aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_crypto.c
AgeCommit message (Collapse)Author
2018-05-24Merge branch 'maint-0.3.3'Nick Mathewson
2018-05-24Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-05-24Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-05-24Add a unit test for PEM-encrypted documents.Nick Mathewson
2018-05-21Improve openssl_version tests with better messagesNick Mathewson
These tests would report errors, but wouldn't report the offending strings.
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-12Fix warnings about passing uninitialized buffers into functionsNick Mathewson
Most of these buffers were never actually inspected, but it's still bad style.
2017-09-12Clear up dead-assignment warnings from scan-buildNick Mathewson
2017-08-24apply ahf's test_assert_null.cocciNick Mathewson
2017-08-24apply ahf's test_assert_int.cocciNick Mathewson
2017-08-24Fix operator usage in src/test/*.cAlexander Færøy
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch]
2017-07-24Rename the hybrid_encrypt/decrypt functions; label them as dangerousNick Mathewson
We need to keep these around for TAP and old-style hidden services, but they're obsolete, and we shouldn't encourage anyone to use them. So I've added "obsolete" to their names, and a comment explaining what the problem is. Closes ticket 23026.
2017-06-28ed25519: Add tests blinding bad ed25519 pubkeys.George Kadianakis
2017-06-27whitespace fixNick Mathewson
2017-06-27ed25519: Add unittests for ed25519 pubkey validation.George Kadianakis
2017-04-07Test odd-sized base64 decodesTaylor Yu
Test base64_decode() with odd sized decoded lengths, including unpadded encodings and padded encodings with "right-sized" output buffers. Convert calls to base64_decode_nopad() to base64_decode() because base64_decode_nopad() is redundant.
2017-03-31Remove openssl/evp.h dependency from test_crypto.cNick Mathewson
2017-03-31Remove crypto/rand include from test_crypto.cNick Mathewson
Create a new test_crypto_openssl to test openssl-only crypto.c functionality.
2017-03-15Run the copyright update script.Nick Mathewson
2016-12-14crypto: Change crypto_mac_sha3_256 to use the key length in the constructionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-14prop224 prepwork: Introduce HMAC-SHA3 function.George Kadianakis
2016-09-16Add support for AES256 and AES192Nick Mathewson
(This will be used by prop224)
2016-09-16Simplify the crypto_cipher_t interface and structureNick Mathewson
Previously, the IV and key were stored in the structure, even though they mostly weren't needed. The only purpose they had was to support a seldom-used API where you could pass NULL when creating a cipher in order to get a random key/IV, and then pull that key/IV back out. This saves 32 bytes per AES instance, and makes it easier to support different key lengths.
2016-09-09Make a couple more tests run faster.Nick Mathewson
The point of diminishing returns has been reached.
2016-09-09Move the donna-fuzzing tests into test_slow.Nick Mathewson
This shaves another 3-4 seconds off the main-path tests for me, which is again worth it, according to XKCD#1204.
2016-09-06checkSpace.pl now forbids more identifiers.Nick Mathewson
The functions it warns about are: assert, memcmp, strcat, strcpy, sprintf, malloc, free, realloc, strdup, strndup, calloc. Also, fix a few lingering instances of these in the code. Use other conventions to indicate _intended_ use of assert and malloc/realloc/etc.
2016-08-23Introduce ed25519_{sign,checksig}_prefixed functions().George Kadianakis
2016-06-20Make base16_decodes return number of decoded bytesnikkolasg
base16_decodes() now returns the number of decoded bytes. It's interface changes from returning a "int" to a "ssize_t". Every callsite now checks the returned value. Fixes #14013 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-06-09Reduce make check-spaces noiseAndrea Shepard
2016-06-06Repair test_crypto_openssl_version with LibreSSLNick Mathewson
2016-06-06Check tor_sscanf return value in test_crypto.cNick Mathewson
Coverity noticed that we check tor_sscanf's return value everywhere else.
2016-06-02Use tor_sscanf, not sscanf, in test_crypto.cNick Mathewson
Fixes the 0.2.9 instance of bug #19213, which prevented mingw64 from working. This case wasn't in any released Tor.
2016-05-18Fix a bad sizeof() in test_crypto.c. Harmless. Spotted by coverity.Nick Mathewson
2016-05-16Fix memory leak in test_crypto_aes_ctr_testvecNick Mathewson
2016-05-16Windows lacks truncate(3).Nick Mathewson
Fix the new crypto tests, which used truncate(3).
2016-05-16Cover all our DH code, and/or mark it unreachable.Nick Mathewson
2016-05-16At long last, unit tests for degenerate DH public keys.Nick Mathewson
Apparently, we detect and reject them correctly. Aren't you glad?
2016-05-16Slight improvements to DH coverage.Nick Mathewson
2016-05-16Improve test coverage of our strongest-rng code.Nick Mathewson
2016-05-16Test coverage on ed25519 load/store functions.Nick Mathewson
2016-05-16HKDF-SHA256 test vectors from RFC5869Nick Mathewson
2016-05-03Ed25519 test vectors from draft-irtf-cfrg-eddsa-05Nick Mathewson
2016-05-03Add test vector for AES_CTR from NIST SP800-38a sec F.5Nick Mathewson
2016-05-03Add test vector for Curve25519 from RFC7748Nick Mathewson
2016-05-03tests for some of the simpler functions in crypto.cNick Mathewson
2016-05-03White-box tests for crypto_rand_*_range(), rand_hostname().Nick Mathewson
Coverage-driven; part of ticket 16794.