/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "apr_dbd.h"
#include "apr_escape.h"
#include "apr_strings.h"
#include "httpd.h"
#include "http_log.h"
#include "http_main.h"
#include "ssl_ct_sct.h"
#include "ssl_ct_log_config.h"
#include "ssl_ct_util.h"
const char **msg)
{
int rc;
if (rv != APR_SUCCESS) {
if (msg) {
*msg = "SQLite3 driver cannot be loaded";
}
return 0;
}
if (rv != APR_SUCCESS) {
return 0;
}
/* is there a cheaper way? */
"SELECT * FROM loginfo WHERE id = 0", 0);
if (rc != 0) {
return 0;
}
return 1;
}
{
return APR_SUCCESS;
}
{
if (rv != APR_SUCCESS) {
return rv;
}
if (!pubkey) {
rv = APR_EINVAL;
"public key file %s",
return rv;
}
return APR_SUCCESS;
}
{
}
{
if (rv == APR_SUCCESS) {
"parsed or is missing required elements", lu);
rv = APR_EINVAL;
}
"\"http\" (instead of \"%s\") is currently "
"accepted",
rv = APR_EINVAL;
}
"\"/\" (instead of \"%s\") is currently accepted",
rv = APR_EINVAL;
}
}
if (rv == APR_SUCCESS) {
}
return rv;
}
{
const char *end;
errno = 0;
return APR_EINVAL;
}
return APR_SUCCESS;
}
/* The log_config array should have already been allocated from p. */
apr_pool_t *p,
const char *log_id,
const char *pubkey_fname,
const char *distrusted_str,
const char *min_time_str,
const char *max_time_str,
const char *url)
{
int distrusted;
if (!distrusted_str) {
}
}
}
else {
return APR_EINVAL;
}
if (log_id) {
}
}
if (pubkey_fname) {
if (rv != APR_SUCCESS) {
return rv;
}
}
else {
public_key = NULL;
}
if (min_time_str) {
if (rv) {
return rv;
}
}
else {
min_time = 0;
}
if (max_time_str) {
if (rv) {
return rv;
}
}
else {
max_time = 0;
}
if (url) {
if (rv != APR_SUCCESS) {
return rv;
}
}
if (newconf->public_key) {
(unsigned char *)computed_log_id);
}
if (computed_log_id && log_id_bin) {
"of public key");
return APR_EINVAL;
}
}
if (url) {
}
return APR_SUCCESS;
}
const char *log_config_fname,
{
int rc;
if (rv != APR_SUCCESS) {
return rv;
}
if (rv != APR_SUCCESS) {
return rv;
}
"SELECT * FROM loginfo", 0);
if (rc != 0) {
return APR_EINVAL;
}
switch (rc) {
case -1:
return APR_EINVAL;
case 0:
return APR_SUCCESS;
default:
/* quiet some lints */
break;
}
rv == APR_SUCCESS;
int cur = 0;
"Log config: Record %s, log id %s, public key file %s, distrusted %s, URL %s, time %s->%s",
id,
if (rv != APR_SUCCESS) {
return rv;
}
}
return APR_SUCCESS;
}
{
if (l->distrusted == DISTRUSTED) {
return 0;
}
return 0;
}
return 0;
}
return 1;
}
{
/* The log could return us an SCT with an older timestamp which
* is within the trusted time interval for the log, but for
* simplicity let's just assume that if the log isn't still
* within a trusted interval we won't send SCTs from the log.
*/
return log_valid_for_received_sct(l, apr_time_now());
}
{
/* must have a url and a public key configured in order to obtain
* an SCT from the log
*/
}