/* 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 "ssl_ct_sct.h"
#include "ssl_ct_util.h"
#include "http_log.h"
{
int rc;
return APR_EINVAL;
}
sctf->signed_data_len));
}
{
int i;
for (i = 0; i < nelts; i++) {
continue;
}
"out of trusted time interval");
return APR_EINVAL;
}
if (rv != APR_SUCCESS) {
rv, c,
}
else {
"verify_signature succeeded");
}
return rv;
}
}
return APR_NOTFOUND;
}
server_rec *s, const unsigned char *sct,
{
const unsigned char *cur;
/* no room for header */
len);
return APR_EINVAL;
}
cur++;
len -= 1;
cur += LOG_ID_SIZE;
len -= LOG_ID_SIZE;
/* XXX maybe do this only if log level is such that we'll
* use it later?
*/
if (len < 2) {
"for extension len", orig_len);
return APR_EINVAL;
}
"space for %hu bytes of extensions",
return APR_EINVAL;
}
}
else {
fields->extensions = 0;
}
if (len < 4) {
"for hash algorithm, signature algorithm, and "
"signature len",
orig_len);
return APR_EINVAL;
}
cur += 1;
len -= 1;
cur += 1;
len -= 1;
return APR_EINVAL;
}
if (cc) {
/* If we have the server certificate, we can construct the
* data over which the signature is computed.
*/
/* XXX Which part is signed? */
* method Serializer::SerializeV1CertSCTSignatureInput()
*/
int der_length;
unsigned char *mem;
unsigned char *orig_mem;
if (der_length < 0) {
rv = APR_EINVAL;
}
if (rv == APR_SUCCESS) {
orig_len = 0
+ 1 /* version 1 */
+ 1 /* CERTIFICATE_TIMESTAMP */
+ 8 /* timestamp */
+ 2 /* X509_ENTRY */
;
if (rv == APR_SUCCESS) {
}
if (rv == APR_SUCCESS) {
}
if (rv == APR_SUCCESS) {
}
if (rv == APR_SUCCESS) {
/* Get DER encoding of leaf certificate */
unsigned char *der_buf
/* get OpenSSL to allocate: */
= NULL;
if (der_length < 0) {
rv = APR_EINVAL;
}
else {
}
}
if (rv == APR_SUCCESS) {
}
}
if (rv != APR_SUCCESS) {
"SCT");
}
else {
if (avail != 0) {
"data (%" APR_SIZE_T_FMT
}
/* Force invalid signature error: orig_mem[0] = orig_mem[0] + 1; */
}
}
"SCT from %s: version %d timestamp %s hash alg %d sig alg %d",
#endif /* httpd has ap_log_*data() */
return rv;
}
{
if (sctf->signed_data) {
}
}
{
"%s)",
return APR_EINVAL;
}
return APR_SUCCESS;
}