From 8fbb93d0e24da283a21bb48c4361e20a17bba955 Mon Sep 17 00:00:00 2001 From: Rob Percival Date: Fri, 4 Mar 2016 20:37:28 +0000 Subject: [PATCH] Makes SCT_LIST_set_source return the number of successes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No longer terminates on first error, but instead tries to set the source of every SCT regardless of whether an error occurs with some. Reviewed-by: Emilia Käsper Reviewed-by: Rich Salz --- crypto/ct/ct_sct.c | 7 +++---- include/openssl/ct.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crypto/ct/ct_sct.c b/crypto/ct/ct_sct.c index 2b7211d7ea..8290945e51 100644 --- a/crypto/ct/ct_sct.c +++ b/crypto/ct/ct_sct.c @@ -317,12 +317,11 @@ int SCT_set_source(SCT *sct, sct_source_t source) int SCT_LIST_set_source(const STACK_OF(SCT) *scts, sct_source_t source) { - int i, ret = 1; + int i, ret = 0; for (i = 0; i < sk_SCT_num(scts); ++i) { - ret = SCT_set_source(sk_SCT_value(scts, i), source); - if (ret != 1) - break; + if (SCT_set_source(sk_SCT_value(scts, i), source)) + ++ret; } return ret; diff --git a/include/openssl/ct.h b/include/openssl/ct.h index 6d2182f796..7a19053018 100644 --- a/include/openssl/ct.h +++ b/include/openssl/ct.h @@ -305,7 +305,7 @@ int SCT_set_source(SCT *sct, sct_source_t source); /* * Sets the source of all of the SCTs to the same value. - * Returns 1 on success. + * Returns the number of SCTs whose source was set successfully. */ int SCT_LIST_set_source(const STACK_OF(SCT) *scts, sct_source_t source); -- 2.25.1