diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2019-11-05 09:56:59 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-12-12 10:57:25 +0000 |
commit | 3dbc5156b0b2c7a57be160706e6ad38a14edae37 (patch) | |
tree | e86c4b137be850621acfd835398b4bc1cf699467 /test/cmp_hdr_test.c | |
parent | 0402c90ff9caac4c680e3cb6db7729e00d3fc20b (diff) | |
download | openssl-new-3dbc5156b0b2c7a57be160706e6ad38a14edae37.tar.gz |
chunk 6 of CMP contribution to OpenSSL
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10297)
Diffstat (limited to 'test/cmp_hdr_test.c')
-rw-r--r-- | test/cmp_hdr_test.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/test/cmp_hdr_test.c b/test/cmp_hdr_test.c index 4f1b4a5a79..a9b2aff79c 100644 --- a/test/cmp_hdr_test.c +++ b/test/cmp_hdr_test.c @@ -193,7 +193,9 @@ static int execute_HDR_set1_senderKID_test(CMP_HDR_TEST_FIXTURE *fixture) if (!TEST_ptr(senderKID)) return 0; - ASN1_OCTET_STRING_set(senderKID, rand_data, sizeof(rand_data)); + if (!TEST_int_eq(ASN1_OCTET_STRING_set(senderKID, rand_data, + sizeof(rand_data)), 1)) + return 0; if (!TEST_int_eq(ossl_cmp_hdr_set1_senderKID(fixture->hdr, senderKID), 1)) return 0; if (!TEST_int_eq( @@ -372,7 +374,7 @@ static int execute_HDR_init_test(CMP_HDR_TEST_FIXTURE *fixture) || !TEST_true(0 == ASN1_OCTET_STRING_cmp( ossl_cmp_hdr_get0_senderNonce(fixture->hdr), fixture->cmp_ctx->senderNonce)) - || !TEST_true(0 == ASN1_OCTET_STRING_cmp( + || !TEST_true(0 == ASN1_OCTET_STRING_cmp( OSSL_CMP_HDR_get0_transactionID(fixture->hdr), fixture->cmp_ctx->transactionID))) goto err; @@ -414,9 +416,9 @@ static int test_HDR_init_with_subject(void) fixture->expected = 1; if (!TEST_ptr(subject = X509_NAME_new()) - || !TEST_true(X509_NAME_ADD(subject, "CN", "Common Name")) - || !TEST_true(OSSL_CMP_CTX_set1_subjectName(fixture->cmp_ctx, - subject))) { + || !TEST_true(X509_NAME_ADD(subject, "CN", "Common Name")) + || !TEST_true(OSSL_CMP_CTX_set1_subjectName(fixture->cmp_ctx, + subject))) { tear_down(fixture); fixture = NULL; } @@ -461,8 +463,10 @@ int setup_tests(void) ADD_TEST(test_HDR_init); ADD_TEST(test_HDR_init_with_subject); ADD_TEST(test_HDR_init_no_ref_no_subject); - /* TODO make sure that total number of tests (here currently 24) is shown, - also for other cmp_*text.c. Currently the test drivers always show 1. */ + /* + * TODO make sure that total number of tests (here currently 24) is shown, + * also for other cmp_*text.c. Currently the test drivers always show 1. + */ return 1; } |