aboutsummaryrefslogtreecommitdiff
path: root/test/ct_test.c
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-04-08 09:33:17 -0400
committerRich Salz <rsalz@openssl.org>2017-05-22 08:03:22 -0400
commitc9cf4bc815e08ee53e84da4b4c8300dad1d4d178 (patch)
treea07033e1ba83e554c99698818ab4b37da3ba3f8c /test/ct_test.c
parent2d8e9dbd2c62f29f777dd3002a39419d45a891dd (diff)
downloadopenssl-c9cf4bc815e08ee53e84da4b4c8300dad1d4d178.zip
openssl-c9cf4bc815e08ee53e84da4b4c8300dad1d4d178.tar.gz
openssl-c9cf4bc815e08ee53e84da4b4c8300dad1d4d178.tar.bz2
Update the test to assert that the SCT is from an X.509 extension
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3149)
Diffstat (limited to 'test/ct_test.c')
-rw-r--r--test/ct_test.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/ct_test.c b/test/ct_test.c
index 583db44..6b36a43 100644
--- a/test/ct_test.c
+++ b/test/ct_test.c
@@ -262,6 +262,7 @@ static int execute_cert_test(CT_TEST_FIXTURE fixture)
if (fixture.certificate_file != NULL) {
int sct_extension_index;
+ int i;
X509_EXTENSION *sct_extension = NULL;
if (!TEST_ptr(cert = load_pem_cert(fixture.certs_dir,
@@ -289,18 +290,16 @@ static int execute_cert_test(CT_TEST_FIXTURE fixture)
expected_sct_text))
goto end;
- if (fixture.test_validity) {
- int i;
-
- scts = X509V3_EXT_d2i(sct_extension);
- for (i = 0; i < sk_SCT_num(scts); ++i) {
- SCT *sct_i = sk_SCT_value(scts, i);
+ scts = X509V3_EXT_d2i(sct_extension);
+ for (i = 0; i < sk_SCT_num(scts); ++i) {
+ SCT *sct_i = sk_SCT_value(scts, i);
- if (!TEST_true(SCT_set_source(sct_i,
- SCT_SOURCE_X509V3_EXTENSION)))
- goto end;
+ if (!TEST_int_eq(SCT_get_source(sct_i), SCT_SOURCE_X509V3_EXTENSION)) {
+ goto end;
}
+ }
+ if (fixture.test_validity) {
if (!assert_validity(fixture, scts, ct_policy_ctx))
goto end;
}