The branch master has been updated via 9b2ffec6a00fb6c7ec9f8f5c9b499e4711195c75 (commit) via bce58e7fcbc4b989ff9d02deb327f2a2d6232496 (commit) via 6960cf646b3854042c30700364d14b123b1420c8 (commit) from a0e594d6b5265efd412d248bd12e9d5305370286 (commit)
- Log ----------------------------------------------------------------- commit 9b2ffec6a00fb6c7ec9f8f5c9b499e4711195c75 Author: Dr. David von Oheimb <david.von.ohe...@siemens.com> Date: Tue Dec 17 06:07:51 2019 +0100 add missing load_pkimsg() in test/cmp_testlib.c Reviewed-by: Shane Lontis <shane.lon...@oracle.com> Reviewed-by: Matt Caswell <m...@openssl.org> Reviewed-by: Tomas Mraz <tm...@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10633) commit bce58e7fcbc4b989ff9d02deb327f2a2d6232496 Author: Dr. David von Oheimb <david.von.ohe...@siemens.com> Date: Tue Dec 17 06:07:17 2019 +0100 fix obsolete error codes in test/cmp_msg_test.c Reviewed-by: Shane Lontis <shane.lon...@oracle.com> Reviewed-by: Matt Caswell <m...@openssl.org> Reviewed-by: Tomas Mraz <tm...@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10633) commit 6960cf646b3854042c30700364d14b123b1420c8 Author: Dr. David von Oheimb <david.von.ohe...@siemens.com> Date: Tue Dec 17 05:47:50 2019 +0100 fix dependencies of cmp_{msg,protect}_test.c in test/build.info Reviewed-by: Shane Lontis <shane.lon...@oracle.com> Reviewed-by: Matt Caswell <m...@openssl.org> Reviewed-by: Tomas Mraz <tm...@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10633) ----------------------------------------------------------------------- Summary of changes: test/build.info | 4 ++-- test/cmp_msg_test.c | 14 +++++++------- test/cmp_testlib.c | 8 ++++++++ test/cmp_testlib.h | 1 + 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/test/build.info b/test/build.info index 601059f385..1d59dd9bb6 100644 --- a/test/build.info +++ b/test/build.info @@ -505,11 +505,11 @@ IF[{- !$disabled{tests} -}] INCLUDE[cmp_status_test]=.. ../include ../apps/include DEPEND[cmp_status_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_protect_test]=cmp_status_test.c cmp_testlib.c + SOURCE[cmp_protect_test]=cmp_protect_test.c cmp_testlib.c INCLUDE[cmp_protect_test]=.. ../include ../apps/include DEPEND[cmp_protect_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_msg_test]=cmp_status_test.c cmp_testlib.c + SOURCE[cmp_msg_test]=cmp_msg_test.c cmp_testlib.c INCLUDE[cmp_msg_test]=.. ../include ../apps/include DEPEND[cmp_msg_test]=../libcrypto.a libtestutil.a diff --git a/test/cmp_msg_test.c b/test/cmp_msg_test.c index 103ff58af4..463c60789b 100644 --- a/test/cmp_msg_test.c +++ b/test/cmp_msg_test.c @@ -141,7 +141,7 @@ static int test_cmp_create_ir_protection_set(void) unsigned char secret[16]; fixture->bodytype = OSSL_CMP_PKIBODY_IR; - fixture->err_code = CMP_R_ERROR_CREATING_IR; + fixture->err_code = -1; fixture->expected = 1; if (!TEST_int_eq(1, RAND_bytes(secret, sizeof(secret))) || !TEST_true(SET_OPT_UNPROTECTED_SEND(ctx, 0)) @@ -159,7 +159,7 @@ static int test_cmp_create_ir_protection_fails(void) { SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up); fixture->bodytype = OSSL_CMP_PKIBODY_IR; - fixture->err_code = CMP_R_ERROR_CREATING_IR; + fixture->err_code = -1; fixture->expected = 0; if (!TEST_true(OSSL_CMP_CTX_set1_pkey(fixture->cmp_ctx, newkey)) || !TEST_true(SET_OPT_UNPROTECTED_SEND(fixture->cmp_ctx, 0)) @@ -175,7 +175,7 @@ static int test_cmp_create_cr_without_key(void) { SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up); fixture->bodytype = OSSL_CMP_PKIBODY_CR; - fixture->err_code = CMP_R_ERROR_CREATING_CR; + fixture->err_code = -1; fixture->expected = 0; EXECUTE_TEST(execute_certreq_create_test, tear_down); return result; @@ -185,7 +185,7 @@ static int test_cmp_create_cr(void) { SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up); fixture->bodytype = OSSL_CMP_PKIBODY_CR; - fixture->err_code = CMP_R_ERROR_CREATING_CR; + fixture->err_code = -1; fixture->expected = 1; if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) { tear_down(fixture); @@ -199,7 +199,7 @@ static int test_cmp_create_certreq_with_invalid_bodytype(void) { SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up); fixture->bodytype = OSSL_CMP_PKIBODY_RR; - fixture->err_code = CMP_R_ERROR_CREATING_IR; + fixture->err_code = -1; fixture->expected = 0; if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) { tear_down(fixture); @@ -247,7 +247,7 @@ static int test_cmp_create_kur(void) { SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up); fixture->bodytype = OSSL_CMP_PKIBODY_KUR; - fixture->err_code = CMP_R_ERROR_CREATING_KUR; + fixture->err_code = -1; fixture->expected = 1; if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey)) || !TEST_true(OSSL_CMP_CTX_set1_oldCert(fixture->cmp_ctx, cert))) { @@ -262,7 +262,7 @@ static int test_cmp_create_kur_without_oldcert(void) { SETUP_TEST_FIXTURE(CMP_MSG_TEST_FIXTURE, set_up); fixture->bodytype = OSSL_CMP_PKIBODY_KUR; - fixture->err_code = CMP_R_ERROR_CREATING_KUR; + fixture->err_code = -1; fixture->expected = 0; if (!TEST_true(set1_newPkey(fixture->cmp_ctx, newkey))) { tear_down(fixture); diff --git a/test/cmp_testlib.c b/test/cmp_testlib.c index d632424272..6c696eafaa 100644 --- a/test/cmp_testlib.c +++ b/test/cmp_testlib.c @@ -40,6 +40,14 @@ X509 *load_pem_cert(const char *file) return cert; } +OSSL_CMP_MSG *load_pkimsg(const char *file) +{ + OSSL_CMP_MSG *msg; + + (void)TEST_ptr((msg = ossl_cmp_msg_load(file))); + return msg; +} + X509_REQ *load_csr(const char *file) { X509_REQ *csr = NULL; diff --git a/test/cmp_testlib.h b/test/cmp_testlib.h index 96b577e46e..f1bc55c118 100644 --- a/test/cmp_testlib.h +++ b/test/cmp_testlib.h @@ -25,6 +25,7 @@ EVP_PKEY *load_pem_key(const char *file); X509 *load_pem_cert(const char *file); X509_REQ *load_csr(const char *file); +OSSL_CMP_MSG *load_pkimsg(const char *file); int valid_asn1_encoding(const OSSL_CMP_MSG *msg); EVP_PKEY *gen_rsa(void); int STACK_OF_X509_cmp(const STACK_OF(X509) *sk1, const STACK_OF(X509) *sk2);