diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/tpm_test/u2f_test.py | 3 | ||||
-rw-r--r-- | test/u2f.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/test/tpm_test/u2f_test.py b/test/tpm_test/u2f_test.py index 97ca4a4141..a0118c7b13 100644 --- a/test/tpm_test/u2f_test.py +++ b/test/tpm_test/u2f_test.py @@ -102,9 +102,10 @@ def g2f_get_cert(tpm): ] g2f_read_cmd = bytes(g2f_read) response = tpm.command(g2f_read_cmd) - if len(response) <= 10: + if len(response) <= 16 or response.count(0) > 100: raise subcmd.TpmTestError('Unexpected G2F response: ' + utils.hex_dump(response)) + print('G2F cert len', len(response)) return response diff --git a/test/u2f.c b/test/u2f.c index 3ddf38616b..c99dc7d631 100644 --- a/test/u2f.c +++ b/test/u2f.c @@ -41,9 +41,10 @@ bool fips_trng_bytes(void *buffer, size_t len) return true; } -int DCRYPTO_x509_gen_u2f_cert_name(const p256_int *d, const p256_int *pk_x, - const p256_int *pk_y, const p256_int *serial, - const char *name, uint8_t *cert, const int n) +size_t DCRYPTO_x509_gen_u2f_cert_name(const p256_int *d, const p256_int *pk_x, + const p256_int *pk_y, + const p256_int *serial, const char *name, + uint8_t *cert, const size_t n) { /* Return the size of certificate, 0 means error. */ return 0; |