1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5b077aed3SPierre ProncheryCTLOG_STORE_new_ex, 6e71b7053SJung-uk KimCTLOG_STORE_new, CTLOG_STORE_free, 7e71b7053SJung-uk KimCTLOG_STORE_load_default_file, CTLOG_STORE_load_file - 8e71b7053SJung-uk KimCreate and populate a Certificate Transparency log list 9e71b7053SJung-uk Kim 10e71b7053SJung-uk Kim=head1 SYNOPSIS 11e71b7053SJung-uk Kim 12e71b7053SJung-uk Kim #include <openssl/ct.h> 13e71b7053SJung-uk Kim 14b077aed3SPierre Pronchery CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq); 15e71b7053SJung-uk Kim CTLOG_STORE *CTLOG_STORE_new(void); 16e71b7053SJung-uk Kim void CTLOG_STORE_free(CTLOG_STORE *store); 17e71b7053SJung-uk Kim 18e71b7053SJung-uk Kim int CTLOG_STORE_load_default_file(CTLOG_STORE *store); 19e71b7053SJung-uk Kim int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file); 20e71b7053SJung-uk Kim 21e71b7053SJung-uk Kim=head1 DESCRIPTION 22e71b7053SJung-uk Kim 23e71b7053SJung-uk KimA CTLOG_STORE is a container for a list of CTLOGs (Certificate Transparency 24e71b7053SJung-uk Kimlogs). The list can be loaded from one or more files and then searched by LogID 25e71b7053SJung-uk Kim(see RFC 6962, Section 3.2, for the definition of a LogID). 26e71b7053SJung-uk Kim 27b077aed3SPierre ProncheryCTLOG_STORE_new_ex() creates an empty list of CT logs associated with 28b077aed3SPierre Proncherythe library context I<libctx> and the property query string I<propq>. 29b077aed3SPierre Pronchery 30b077aed3SPierre ProncheryCTLOG_STORE_new() does the same thing as CTLOG_STORE_new_ex() but with 31b077aed3SPierre Proncherythe default library context and property query string. 32b077aed3SPierre Pronchery 33b077aed3SPierre ProncheryThe CTLOG_STORE is then populated by CTLOG_STORE_load_default_file() or 34b077aed3SPierre ProncheryCTLOG_STORE_load_file(). CTLOG_STORE_load_default_file() loads from the default 35b077aed3SPierre Proncheryfile, which is named F<ct_log_list.cnf> in OPENSSLDIR (see the output of 36b077aed3SPierre ProncheryL<openssl-version(1)>). This can be overridden using an environment variable 37b077aed3SPierre Proncherynamed B<CTLOG_FILE>. CTLOG_STORE_load_file() loads from a caller-specified file 38b077aed3SPierre Proncherypath instead. Both of these functions append any loaded CT logs to the 39b077aed3SPierre ProncheryCTLOG_STORE. 40e71b7053SJung-uk Kim 41e71b7053SJung-uk KimThe expected format of the file is: 42e71b7053SJung-uk Kim 43e71b7053SJung-uk Kim enabled_logs=foo,bar 44e71b7053SJung-uk Kim 45e71b7053SJung-uk Kim [foo] 46e71b7053SJung-uk Kim description = Log 1 47e71b7053SJung-uk Kim key = <base64-encoded DER SubjectPublicKeyInfo here> 48e71b7053SJung-uk Kim 49e71b7053SJung-uk Kim [bar] 50e71b7053SJung-uk Kim description = Log 2 51e71b7053SJung-uk Kim key = <base64-encoded DER SubjectPublicKeyInfo here> 52e71b7053SJung-uk Kim 53e71b7053SJung-uk KimOnce a CTLOG_STORE is no longer required, it should be passed to 54e71b7053SJung-uk KimCTLOG_STORE_free(). This will delete all of the CTLOGs stored within, along 55*a7148ab3SEnji Cooperwith the CTLOG_STORE itself. If the argument is NULL, nothing is done. 56e71b7053SJung-uk Kim 57e71b7053SJung-uk Kim=head1 NOTES 58e71b7053SJung-uk Kim 59e71b7053SJung-uk KimIf there are any invalid CT logs in a file, they are skipped and the remaining 60e71b7053SJung-uk Kimvalid logs will still be added to the CTLOG_STORE. A CT log will be considered 61e71b7053SJung-uk Kiminvalid if it is missing a "key" or "description" field. 62e71b7053SJung-uk Kim 63e71b7053SJung-uk Kim=head1 RETURN VALUES 64e71b7053SJung-uk Kim 65e71b7053SJung-uk KimBoth B<CTLOG_STORE_load_default_file> and B<CTLOG_STORE_load_file> return 1 if 66e71b7053SJung-uk Kimall CT logs in the file are successfully parsed and loaded, 0 otherwise. 67e71b7053SJung-uk Kim 68e71b7053SJung-uk Kim=head1 SEE ALSO 69e71b7053SJung-uk Kim 70e71b7053SJung-uk KimL<ct(7)>, 71e71b7053SJung-uk KimL<CTLOG_STORE_get0_log_by_id(3)>, 72e71b7053SJung-uk KimL<SSL_CTX_set_ctlog_list_file(3)> 73e71b7053SJung-uk Kim 74e71b7053SJung-uk Kim=head1 HISTORY 75e71b7053SJung-uk Kim 76b077aed3SPierre ProncheryCTLOG_STORE_new_ex was added in OpenSSL 3.0. All other functions were 77b077aed3SPierre Proncheryadded in OpenSSL 1.1.0. 78e71b7053SJung-uk Kim 79e71b7053SJung-uk Kim=head1 COPYRIGHT 80e71b7053SJung-uk Kim 81*a7148ab3SEnji CooperCopyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved. 82e71b7053SJung-uk Kim 83b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 84e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 85e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 86e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 87e71b7053SJung-uk Kim 88e71b7053SJung-uk Kim=cut 89