Changeset View
Changeset View
Standalone View
Standalone View
b/tests/basic.c
Context not available. | |||||
if (!tv[i].algo) | if (!tv[i].algo) | ||||
continue; | continue; | ||||
if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode) | |||||
{ | |||||
if (verbose) | |||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | |||||
tv[i].algo); | |||||
continue; | |||||
} | |||||
err = gcry_cipher_open (&hde, tv[i].algo, GCRY_CIPHER_MODE_CTR, 0); | err = gcry_cipher_open (&hde, tv[i].algo, GCRY_CIPHER_MODE_CTR, 0); | ||||
if (!err) | if (!err) | ||||
err = gcry_cipher_open (&hdd, tv[i].algo, GCRY_CIPHER_MODE_CTR, 0); | err = gcry_cipher_open (&hdd, tv[i].algo, GCRY_CIPHER_MODE_CTR, 0); | ||||
Context not available. | |||||
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | ||||
{ | { | ||||
if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode) | |||||
{ | |||||
if (verbose) | |||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | |||||
tv[i].algo); | |||||
continue; | |||||
} | |||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " checking CFB mode for %s [%i]\n", | fprintf (stderr, " checking CFB mode for %s [%i]\n", | ||||
gcry_cipher_algo_name (tv[i].algo), | gcry_cipher_algo_name (tv[i].algo), | ||||
Context not available. | |||||
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | ||||
{ | { | ||||
if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode) | |||||
{ | |||||
if (verbose) | |||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | |||||
tv[i].algo); | |||||
continue; | |||||
} | |||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " checking OFB mode for %s [%i]\n", | fprintf (stderr, " checking OFB mode for %s [%i]\n", | ||||
gcry_cipher_algo_name (tv[i].algo), | gcry_cipher_algo_name (tv[i].algo), | ||||
Context not available. | |||||
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | ||||
{ | { | ||||
if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode) | |||||
{ | |||||
if (verbose) | |||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | |||||
tv[i].algo); | |||||
continue; | |||||
} | |||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " checking GCM mode for %s [%i]\n", | fprintf (stderr, " checking GCM mode for %s [%i]\n", | ||||
gcry_cipher_algo_name (tv[i].algo), | gcry_cipher_algo_name (tv[i].algo), | ||||
Context not available. | |||||
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | ||||
{ | { | ||||
if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode) | |||||
{ | |||||
if (verbose) | |||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | |||||
tv[i].algo); | |||||
continue; | |||||
} | |||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " checking CCM mode for %s [%i]\n", | fprintf (stderr, " checking CCM mode for %s [%i]\n", | ||||
gcry_cipher_algo_name (tv[i].algo), | gcry_cipher_algo_name (tv[i].algo), | ||||
Context not available. | |||||
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | ||||
{ | { | ||||
if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode) | |||||
{ | |||||
if (verbose) | |||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | |||||
tv[i].algo); | |||||
continue; | |||||
} | |||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " checking stream mode for %s [%i] (%s)\n", | fprintf (stderr, " checking stream mode for %s [%i] (%s)\n", | ||||
gcry_cipher_algo_name (tv[i].algo), tv[i].algo, tv[i].name); | gcry_cipher_algo_name (tv[i].algo), tv[i].algo, tv[i].name); | ||||
Context not available. | |||||
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | ||||
{ | { | ||||
if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode) | |||||
{ | |||||
if (verbose) | |||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | |||||
tv[i].algo); | |||||
continue; | |||||
} | |||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " checking large block stream for %s [%i] (%s)\n", | fprintf (stderr, " checking large block stream for %s [%i] (%s)\n", | ||||
gcry_cipher_algo_name (tv[i].algo), tv[i].algo, tv[i].name); | gcry_cipher_algo_name (tv[i].algo), tv[i].algo, tv[i].name); | ||||
Context not available. | |||||
for (i = 0; algos2[i]; i++) | for (i = 0; algos2[i]; i++) | ||||
{ | { | ||||
if (gcry_cipher_test_algo (algos[i]) && in_fips_mode) | if (gcry_cipher_test_algo (algos2[i]) && in_fips_mode) | ||||
{ | { | ||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | fprintf (stderr, " algorithm %d not available in fips mode\n", | ||||
algos[i]); | algos2[i]); | ||||
continue; | continue; | ||||
} | } | ||||
if (verbose) | if (verbose) | ||||
Context not available. | |||||
show_md_not_available (algos[i].md); | show_md_not_available (algos[i].md); | ||||
continue; | continue; | ||||
} | } | ||||
if ((gcry_md_test_algo (algos[i].md) || algos[i].md == GCRY_MD_MD5) | if (gcry_md_test_algo (algos[i].md) && in_fips_mode) | ||||
&& in_fips_mode) | |||||
{ | { | ||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | fprintf (stderr, " algorithm %d not available in fips mode\n", | ||||
Context not available. | |||||
show_old_hmac_not_available (algos[i].md); | show_old_hmac_not_available (algos[i].md); | ||||
continue; | continue; | ||||
} | } | ||||
if ((gcry_md_test_algo (algos[i].md) || algos[i].md == GCRY_MD_MD5) | if (gcry_md_test_algo (algos[i].md) && in_fips_mode) | ||||
&& in_fips_mode) | |||||
{ | { | ||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | fprintf (stderr, " algorithm %d not available in fips mode\n", | ||||
Context not available. | |||||
show_mac_not_available (algos[i].algo); | show_mac_not_available (algos[i].algo); | ||||
continue; | continue; | ||||
} | } | ||||
if ((gcry_mac_test_algo (algos[i].algo) | if (gcry_mac_test_algo (algos[i].algo) && in_fips_mode) | ||||
|| algos[i].algo == GCRY_MAC_HMAC_MD5) && in_fips_mode) | |||||
{ | { | ||||
if (verbose) | if (verbose) | ||||
fprintf (stderr, " algorithm %d not available in fips mode\n", | fprintf (stderr, " algorithm %d not available in fips mode\n", | ||||
Context not available. |