Fix safestack issues in ocsp.h

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12781)
This commit is contained in:
Matt Caswell 2020-09-03 15:05:30 +01:00
parent 904e1f92b3
commit fd3ed85c67
12 changed files with 19 additions and 23 deletions

1
.gitignore vendored
View File

@ -27,6 +27,7 @@
/include/openssl/cms.h
/include/openssl/configuration.h
/include/openssl/fipskey.h
/include/openssl/ocsp.h
/include/openssl/opensslv.h
/include/openssl/safestack.h
/include/openssl/ssl.h

View File

@ -33,7 +33,6 @@
#include <openssl/bn.h>
#include <openssl/x509v3.h>
DEFINE_STACK_OF(OCSP_CERTID)
DEFINE_STACK_OF(CONF_VALUE)
#if defined(__TANDEM)

View File

@ -19,6 +19,7 @@ DEPEND[]=include/openssl/asn1.h \
include/openssl/configuration.h \
include/openssl/fipskey.h \
include/openssl/opensslv.h \
include/openssl/ocsp.h \
include/openssl/safestack.h \
include/openssl/ssl.h \
include/openssl/x509.h \
@ -31,6 +32,7 @@ GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
GENERATE[include/openssl/cmp.h]=include/openssl/cmp.h.in
GENERATE[include/openssl/cms.h]=include/openssl/cms.h.in
GENERATE[include/openssl/fipskey.h]=include/openssl/fipskey.h.in
GENERATE[include/openssl/ocsp.h]=include/openssl/ocsp.h.in
GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
GENERATE[include/openssl/safestack.h]=include/openssl/safestack.h.in
GENERATE[include/openssl/ssl.h]=include/openssl/ssl.h.in

View File

@ -18,9 +18,6 @@
#include <openssl/ocsp.h>
#include "ocsp_local.h"
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(OCSP_SINGLERESP)
/*
* Utility functions related to sending OCSP requests and extracting relevant
* information from the response.

View File

@ -14,9 +14,6 @@
#include "internal/cryptlib.h"
#include <openssl/pem.h>
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(OCSP_SINGLERESP)
static int ocsp_certid_print(BIO *bp, OCSP_CERTID *a, int indent)
{
BIO_printf(bp, "%*sCertificate ID:\n", indent, "");

View File

@ -16,9 +16,6 @@
#include <openssl/ocsp.h>
#include "ocsp_local.h"
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(OCSP_SINGLERESP)
/*
* Utility functions related to sending OCSP responses and extracting
* relevant information from the request.

View File

@ -12,9 +12,6 @@
#include <openssl/err.h>
#include <string.h>
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(OCSP_SINGLERESP)
static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
STACK_OF(X509) *certs, unsigned long flags);
static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id);

View File

@ -1,4 +1,6 @@
/*
* {- join("\n * ", @autowarntext) -}
*
* Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@ -7,6 +9,10 @@
* https://www.openssl.org/source/license.html
*/
{-
use OpenSSL::stackhash qw(generate_stack_macros);
-}
#ifndef OPENSSL_OCSP_H
# define OPENSSL_OCSP_H
# pragma once
@ -110,8 +116,10 @@ typedef struct ocsp_req_info_st OCSP_REQINFO;
typedef struct ocsp_signature_st OCSP_SIGNATURE;
typedef struct ocsp_request_st OCSP_REQUEST;
DEFINE_OR_DECLARE_STACK_OF(OCSP_CERTID)
DEFINE_OR_DECLARE_STACK_OF(OCSP_ONEREQ)
{-
generate_stack_macros("OCSP_CERTID")
.generate_stack_macros("OCSP_ONEREQ");
-}
# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
@ -125,7 +133,9 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
# define V_OCSP_RESPID_NAME 0
# define V_OCSP_RESPID_KEY 1
DEFINE_OR_DECLARE_STACK_OF(OCSP_RESPID)
{-
generate_stack_macros("OCSP_RESPID");
-}
typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
@ -136,7 +146,9 @@ typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
typedef struct ocsp_single_response_st OCSP_SINGLERESP;
DEFINE_OR_DECLARE_STACK_OF(OCSP_SINGLERESP)
{-
generate_stack_macros("OCSP_SINGLERESP");
-}
typedef struct ocsp_response_data_st OCSP_RESPDATA;

View File

@ -28,7 +28,6 @@
#include "internal/refcount.h"
#include "internal/ktls.h"
DEFINE_STACK_OF(OCSP_RESPID)
DEFINE_STACK_OF(SCT)
static int ssl_undefined_function_1(SSL *ssl, SSL3_RECORD *r, size_t s, int t,

View File

@ -12,8 +12,6 @@
#include "internal/cryptlib.h"
#include "statem_local.h"
DEFINE_STACK_OF(OCSP_RESPID)
EXT_RETURN tls_construct_ctos_renegotiate(SSL *s, WPACKET *pkt,
unsigned int context, X509 *x,
size_t chainidx)

View File

@ -12,8 +12,6 @@
#include "statem_local.h"
#include "internal/cryptlib.h"
DEFINE_STACK_OF(OCSP_RESPID)
#define COOKIE_STATE_FORMAT_VERSION 0
/*

View File

@ -47,7 +47,6 @@ int tls_provider_init(const OSSL_CORE_HANDLE *handle,
const OSSL_DISPATCH *in,
const OSSL_DISPATCH **out,
void **provctx);
DEFINE_STACK_OF(OCSP_RESPID)
static OPENSSL_CTX *libctx = NULL;
static OSSL_PROVIDER *defctxnull = NULL;