From 49e5db0b313c36c59a943750d9192310ad7f5cf8 Mon Sep 17 00:00:00 2001 From: Rob Percival Date: Thu, 10 Mar 2016 18:21:40 +0000 Subject: check reviewer --reviewer=emilia Pass entire CTLOG_STORE to SCT_print, rather than just the SCT's CTLOG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SCT_print now looks up the correct CT log for you. Reviewed-by: Emilia Käsper Reviewed-by: Rich Salz --- crypto/ct/ct_prn.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'crypto/ct') diff --git a/crypto/ct/ct_prn.c b/crypto/ct/ct_prn.c index 239ffc832c..0d9d0197d5 100644 --- a/crypto/ct/ct_prn.c +++ b/crypto/ct/ct_prn.c @@ -96,8 +96,16 @@ static void timestamp_print(uint64_t timestamp, BIO *out) ASN1_GENERALIZEDTIME_free(gen); } -void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG *log) +void SCT_print(const SCT *sct, BIO *out, int indent, + const CTLOG_STORE *log_store) { + const CTLOG *log = NULL; + + if (log_store != NULL) { + log = CTLOG_STORE_get0_log_by_id(log_store, sct->log_id, + sct->log_id_len); + } + BIO_printf(out, "%*sSigned Certificate Timestamp:", indent, ""); BIO_printf(out, "\n%*sVersion : ", indent + 4, ""); @@ -139,14 +147,8 @@ void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent, for (i = 0; i < sk_SCT_num(sct_list); ++i) { SCT *sct = sk_SCT_value(sct_list, i); - const CTLOG *log = NULL; - - if (log_store != NULL) { - log = CTLOG_STORE_get0_log_by_id(log_store, sct->log_id, - sct->log_id_len); - } - SCT_print(sct, out, indent, log); + SCT_print(sct, out, indent, log_store); if (i < sk_SCT_num(sct_list) - 1) BIO_printf(out, "%s", separator); } -- cgit v1.2.3