summaryrefslogtreecommitdiff
path: root/src/test/test_crypto.c
AgeCommit message (Collapse)Author
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-09-05Try to fix new coverity warnings in unit tests.Nick Mathewson
2018-09-04Rename crypto_pk_check_key(), use it more reasonably, add testsNick Mathewson
This function was a wrapper around RSA_check_key() in openssl, which checks for invalid RSA private keys (like those where p or q are composite, or where d is not the inverse of e, or where n != p*q). We don't need a function like this in NSS, since unlike OpenSSL, NSS won't let you import a bogus private key. I've renamed the function and changed its return type to make it more reasonable, and added a unit test for trying to read a key where n != p*q.
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-08-21Refactor crypto_rsa to use pem module.Nick Mathewson
This cleans up a lot of junk from crypto_rsa_openssl, and will save us duplicated code in crypto_rsa_nss (when it exists). (Actually, it already exists, but I am going to use git rebase so that this commit precedes the creation of crypto_rsa_nss.)
2018-08-21Rename functions that encode/decode private keysNick Mathewson
It is not nice to expose a private key's contents without having the function name advertise the fact. Fortunately, we weren't misusing these yet.
2018-07-31Additional tests for NSS DHNick Mathewson
Notably, there's a test to make sure that it round-trips with OpenSSL, if OpenSSL is enabled.
2018-07-11Move the initialization and cleanup parts of crypto.cNick Mathewson
These are now part of crypto_init.c. The openssl-only parts now live in crypto_openssl_mgt.c. I recommend reviewing this patch with -b and --color-moved.
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Remove util.hNick Mathewson
Inline its contents (which were all includes) into or.h, and some of its contents into other places that didn't include or.h at all.
2018-07-03Merge remote-tracking branch 'github/ticket26626'Nick Mathewson
2018-07-03Replace U64_LITERAL with the standard UINT64_CNick Mathewson
2018-07-03Clean up various things that broke with our stdint.h changesNick Mathewson
Casting before printf was necessary; now it's not so smart. We don't have SIZEOF_UINT8_T any more.
2018-07-01Remove system headers from or.hNick Mathewson
2018-07-01Minimize headers that include crypto_formats and x25519 stuffNick Mathewson
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
2018-07-01Combine DH_BYTES and DH_KEY_LEN; put them in a lib/defs header.Nick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-21Merge remote-tracking branch 'rl1987/ticket19979_2'Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-19When possible, use RFC5869 HKDF implementation from OpenSSLrl1987
Also, stop supporting empty HKDF input key material
2018-06-17Merge remote-tracking branch 'github/bug26152_035'Nick Mathewson
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.