mbedtls/tests/suites/test_suite_hmac_drbg.misc.data
Gilles Peskine efa2ac879d Uniquify test case descriptions
Make check-test-cases.py pass.

Prior to this commit, there were many repeated test descriptions, but
none with the same test data and dependencies and comments, as checked
with the following command:

    for x in tests/suites/*.data; do perl -00 -ne 'warn "$ARGV: $. = $seen{$_}\n" if $seen{$_}; $seen{$_}=$.' $x; done

Wherever a test suite contains multiple test cases with the exact same
description, add " [#1]", " [#2]", etc. to make the descriptions
unique. We don't currently use this particular arrangement of
punctuation, so all occurrences of " [#" were added by this script.

I used the following ad hoc code:

import sys

def fix_test_suite(data_file_name):
    in_paragraph = False
    total = {}
    index = {}
    lines = None
    with open(data_file_name) as data_file:
        lines = list(data_file.readlines())
        for line in lines:
            if line == '\n':
                in_paragraph = False
                continue
            if line.startswith('#'):
                continue
            if not in_paragraph:
                # This is a test case description line.
                total[line] = total.get(line, 0) + 1
                index[line] = 0
            in_paragraph = True
    with open(data_file_name, 'w') as data_file:
        for line in lines:
            if line in total and total[line] > 1:
                index[line] += 1
                line = '%s [#%d]\n' % (line[:-1], index[line])
            data_file.write(line)

for data_file_name in sys.argv[1:]:
    fix_test_suite(data_file_name)
2019-09-20 15:59:31 +02:00

83 lines
2.5 KiB
Plaintext

HMAC_DRBG entropy usage SHA-1
depends_on:MBEDTLS_SHA1_C
hmac_drbg_entropy_usage:MBEDTLS_MD_SHA1
HMAC_DRBG entropy usage SHA-224
depends_on:MBEDTLS_SHA256_C
hmac_drbg_entropy_usage:MBEDTLS_MD_SHA224
HMAC_DRBG entropy usage SHA-256
depends_on:MBEDTLS_SHA256_C
hmac_drbg_entropy_usage:MBEDTLS_MD_SHA256
HMAC_DRBG entropy usage SHA-384
depends_on:MBEDTLS_SHA512_C
hmac_drbg_entropy_usage:MBEDTLS_MD_SHA384
HMAC_DRBG entropy usage SHA-512
depends_on:MBEDTLS_SHA512_C
hmac_drbg_entropy_usage:MBEDTLS_MD_SHA512
HMAC_DRBG write/update seed file SHA-1 [#1]
depends_on:MBEDTLS_SHA1_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA1:"data_files/hmac_drbg_seed":0
HMAC_DRBG write/update seed file SHA-1 [#2]
depends_on:MBEDTLS_SHA1_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA1:"no_such_dir/file":MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR
HMAC_DRBG write/update seed file SHA-224 [#1]
depends_on:MBEDTLS_SHA256_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA224:"data_files/hmac_drbg_seed":0
HMAC_DRBG write/update seed file SHA-224 [#2]
depends_on:MBEDTLS_SHA256_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA224:"no_such_dir/file":MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR
HMAC_DRBG write/update seed file SHA-256 [#1]
depends_on:MBEDTLS_SHA256_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA256:"data_files/hmac_drbg_seed":0
HMAC_DRBG write/update seed file SHA-256 [#2]
depends_on:MBEDTLS_SHA256_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA256:"no_such_dir/file":MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR
HMAC_DRBG write/update seed file SHA-384 [#1]
depends_on:MBEDTLS_SHA512_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA384:"data_files/hmac_drbg_seed":0
HMAC_DRBG write/update seed file SHA-384 [#2]
depends_on:MBEDTLS_SHA512_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA384:"no_such_dir/file":MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR
HMAC_DRBG write/update seed file SHA-512 [#1]
depends_on:MBEDTLS_SHA512_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA512:"data_files/hmac_drbg_seed":0
HMAC_DRBG write/update seed file SHA-512 [#2]
depends_on:MBEDTLS_SHA512_C
hmac_drbg_seed_file:MBEDTLS_MD_SHA512:"no_such_dir/file":MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR
HMAC_DRBG from buffer SHA-1
depends_on:MBEDTLS_SHA1_C
hmac_drbg_buf:MBEDTLS_MD_SHA1
HMAC_DRBG from buffer SHA-224
depends_on:MBEDTLS_SHA256_C
hmac_drbg_buf:MBEDTLS_MD_SHA224
HMAC_DRBG from buffer SHA-256
depends_on:MBEDTLS_SHA256_C
hmac_drbg_buf:MBEDTLS_MD_SHA256
HMAC_DRBG from buffer SHA-384
depends_on:MBEDTLS_SHA512_C
hmac_drbg_buf:MBEDTLS_MD_SHA384
HMAC_DRBG from buffer SHA-512
depends_on:MBEDTLS_SHA512_C
hmac_drbg_buf:MBEDTLS_MD_SHA512
HMAC_DRBG self test
hmac_drbg_selftest: