summaryrefslogtreecommitdiff
path: root/tests/fipsdrv.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: do not use GCC variadic macro extension for xgcry_controlJussi Kivilinna2019-05-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/t-common.h (xgcry_control): Use doubly nested parenthesis for passing arguments for gcry_control instead of GCC specific variadic macro extension. * tests/aeswrap.c: Change xgcry_control to use doubly nested parenthesis. * tests/basic.c: Ditto. * tests/bench-slope.c: Ditto. * tests/benchmark.c: Ditto. * tests/curves.c: Ditto. * tests/dsa-rfc6979.c: Ditto. * tests/fips186-dsa: Ditto. * tests/fipsdrv.c: Ditto. * tests/fipsrngdrv.c: Ditto. * tests/gchash.c: Ditto. * tests/hashtest.c: Ditto. * tests/hmac.c: Ditto. * tests/keygen.c: Ditto. * tests/keygrip.c: Ditto. * tests/mpitests.c: Ditto. * tests/pkbench.c: Ditto. * tests/pkcs1v2.c: Ditto. * tests/prime.c: Ditto. * tests/pubkey.c: Ditto. * tests/random.c: Ditto. * tests/rsacvt.c: Ditto. * tests/t-convert.c: Ditto. * tests/t-cv25519.c: Ditto. * tests/t-ed25519.c: Ditto. * tests/t-kdf.c: Ditto. * tests/t-lock.c: Ditto. * tests/t-mpi-bit.c: Ditto. * tests/t-mpi-point.c: Ditto. * tests/t-secmem.c: Ditto. * tests/t-sexp.c: Ditto. * tests/version.c: Ditto. -- GnuPG-bug-id: 4499 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* tests: Fix warnings on Windows.NIIBE Yutaka2017-08-291-2/+2
| | | | | | * tests/fipsdrv.c (print_dsa_domain_parameters, print_ecdsa_dq): Fix. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Check the result of all gcry_control operations.Justus Winter2016-12-131-5/+5
| | | | | -- Signed-off-by: Justus Winter <justus@g10code.com>
* tests: Use common code for all tests.Justus Winter2016-12-131-38/+2
| | | | | | | -- Also fix minor fallout from the format string warnings. Signed-off-by: Justus Winter <justus@g10code.com>
* tests: Add attributes to helper functions.Werner Koch2016-06-251-5/+11
| | | | | | | | | | * tests/t-common.h (die, fail, info): Add attributes. * tests/random.c (die, inf): Ditto. * tests/pubkey.c (die, fail, info): Add attributes. * tests/fipsdrv.c (die): Add attribute. (main): Take care of missing --key,--iv,--dt options. Signed-off-by: Werner Koch <wk@gnupg.org>
* tests: Add new --pss option to fipsdrvVitezslav Cizek2016-03-181-4/+43
| | | | | | | | | | | | | | | | * tests/fipsdrv.c (run_rsa_sign, run_rsa_verify): Set salt-length to 0 for PSS. -- Add new --pss option to fipsdrv to specify RSA-PSS signature encoding. Signed-off-by: Vitezslav Cizek <vcizek@suse.com> Added by wk: - Help string for --pss - Check that only --pss or --pkcs1 is given. Signed-off-by: Werner Koch <wk@gnupg.org>
* tests: Add support for RSA keygen tests to fipsdrv.Vitezslav Cizek2016-03-181-0/+79
| | | | | | | | | | | * tests/fipsdrv.c (run_rsa_keygen): New. (main): Support RSA keygen and RSA keygen KAT tests. -- In fipsdrv implement support for KeyGen_RandomProbablyPrime and Known Answer Test for probably primes RSA2VS tests. Signed-off-by: Vitezslav Cizek <vcizek@suse.com>
* ecc: ECDSA adjustments for FIPS 186-4Vitezslav Cizek2016-03-181-2/+260
| | | | | | | | | | | | | | | | | | * cipher/ecc-curves.c: Unmark curve P-192 for FIPS. * cipher/ecc.c: Add ECDSA self test. * cipher/pubkey-util.c (_gcry_pk_util_init_encoding_ctx): Use SHA-2 in FIPS mode. * tests/fipsdrv.c: Add support for ECDSA signatures. -- Enable ECC in FIPS mode. According to NIST SP 800-131A, curve P-192 and SHA-1 are disallowed for key pair generation and signature generation after 2013. Thanks to Jan Matejek for the patch. Signed-off-by: Vitezslav Cizek <vcizek@suse.com> Minor source code re-formatting by -wk.
* Add new private header gcrypt-testapi.h.Werner Koch2016-02-191-10/+4
| | | | | | | | | | | | | | | | | | | | | | | * src/gcrypt-testapi.h: New. * src/Makefile.am (libgcrypt_la_SOURCES): Add new file. * random/random.h: Include gcrypt-testapi.h. (struct gcry_drbg_test_vector) : Move to gcrypt-testapi.h. * src/global.c: Include gcrypt-testapi.h. (_gcry_vcontrol): Use PRIV_CTL_* constants instead of 58, 59, 60, 61. * cipher/cipher.c: Include gcrypt-testapi.h. (_gcry_cipher_ctl): Use PRIV_CIPHERCTL_ constants instead of 61, 62. * tests/fipsdrv.c: Include gcrypt-testapi.h. Remove definition of PRIV_CTL_ constants and replace their use by the new PRIV_CIPHERCTL_ constants. * tests/t-lock.c: Include gcrypt-testapi.h. Remove PRIV_CTL_EXTERNAL_LOCK_TEST and EXTERNAL_LOCK_TEST_ constants. * random/random-drbg.c (gcry_rngdrbg_cavs_test): Rename to ... (_gcry_rngdrbg_cavs_test): this. (gcry_rngdrbg_healthcheck_one): Rename to ... (_gcry_rngdrbg_healthcheck_one): this. Signed-off-by: Werner Koch <wk@gnupg.org>
* w32: Avoid a few compiler warnings.Werner Koch2015-09-041-2/+2
| | | | | | | | | | | | * cipher/cipher-selftest.c (_gcry_selftest_helper_cbc) (_gcry_selftest_helper_cfb, _gcry_selftest_helper_ctr): Mark variable as unused. * random/rndw32.c (slow_gatherer): Avoid signed pointer mismatch warning. * src/secmem.c (init_pool): Avoid unused variable warning. * tests/random.c (writen, readn): Include on if needed. Signed-off-by: Werner Koch <wk@gnupg.org>
* Make gpg-error replacement defines more robust.Werner Koch2013-06-261-1/+1
| | | | | | | | | | | | | | | | | | | * configure.ac (AH_BOTTOM): Move GPG_ERR_ replacement defines to ... * src/gcrypt-int.h: new file. * src/visibility.h, src/cipher.h: Replace gcrypt.h by gcrypt-int.h. * tests/: Ditto for all test files. -- Defining newer gpg-error codes in config.h was not a good idea, because config.h is usually included before gpg-error.h and thus gpg-error.h would be double defines to lead to faulty code there like typedef enum { [...] 191 = 191, [...] };
* Nuked almost all trailing whitespace.post-nuke-of-trailing-wsWerner Koch2011-02-041-87/+86
| | | | Check and install the standard git pre-commit hook.
* Portability fixes.Werner Koch2009-02-161-3/+3
|
* Six DSA sign test.Werner Koch2009-01-221-9/+62
| | | | | Add stuff to help debugging.
* print N value for rsa-derive.Werner Koch2009-01-211-3/+3
|
* Fix last change.Werner Koch2009-01-211-3/+11
|
* Fix for dsa signature verifciation in fipsdrv.Werner Koch2009-01-211-8/+4
| | | | | Other small changes.
* Add fipsdriv mode rsa-derive.Werner Koch2008-12-111-2/+93
|
* Allow speicification of domain parameters for DSA key generation.Werner Koch2008-12-101-1/+3
| | | | | | | Doc updates. Allows the use of the strings AES-128, AES-192, AES-256 to specify AES algorithms.
* More DSA FIPS test suport.Werner Koch2008-12-031-29/+289
|
* Fix last moi-pow.c change.Werner Koch2008-12-031-1/+8
| | | | | Add some code to allow standalone builds of some test programs.
* Fixed the fips 186 dsa key generation.Werner Koch2008-11-281-2/+159
| | | | | | | Allow apssing of a seed value. Add a new regression test. Updated the cavs driver.
* Cleaned up the public key module calling conventions.Werner Koch2008-11-241-0/+6
| | | | | Add a way to derive RSA keys according to X9.31.
* Implement mct server mode for fips driver and use it in the CAVS tests toWerner Koch2008-11-071-71/+258
| | | | | | speed up things and to get hold of intermediate values we could not easily retrieve with the old implementaion.
* Add a method to disable the weak key detection.Werner Koch2008-11-051-25/+86
| | | | | | Add a method to return the current input block. Use this in the FIPS driver.
* Increase a buffer for use with SHA-512.Werner Koch2008-10-311-3/+3
|
* Fix ECB mode testWerner Koch2008-10-301-9/+20
|
* New CAVS driver from upstream.Werner Koch2008-10-061-40/+143
| | | | | Fixed RSA FIPS tests.
* Add rsa verify function.Werner Koch2008-10-021-33/+159
|
* Add CAVS test.Werner Koch2008-10-021-0/+1458
Various minor fixes. Sigbus fixes for AES.