Create internal/ssl.h
authorMatt Caswell <matt@openssl.org>
Mon, 22 May 2023 14:23:21 +0000 (15:23 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 24 May 2023 11:18:33 +0000 (12:18 +0100)
We create the internal/ssl.h header file and move the typedef for
ossl_msg_cb. This is needed by both the QUIC code (which generally doesn't
include ssl_local.h) and the rest of libssl.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20914)

include/internal/quic_types.h
include/internal/ssl.h [new file with mode: 0644]
ssl/ssl_local.h

index 2fa36d46e96035f09440d0ae72062e1e756dcd50..830c755779a919864ea8630d0a28d7321f97f30e 100644 (file)
@@ -11,6 +11,7 @@
 # define OSSL_QUIC_TYPES_H
 
 # include <openssl/ssl.h>
+# include <internal/ssl.h>
 # include <assert.h>
 # include <string.h>
 
@@ -95,9 +96,6 @@ static ossl_unused ossl_inline int ossl_quic_conn_id_eq(const QUIC_CONN_ID *a,
 
 #  define QUIC_STATELESS_RESET_TOKEN_LEN    16
 
-typedef void (*ossl_msg_cb)(int write_p, int version, int content_type,
-                            const void *buf, size_t len, SSL *ssl, void *arg);
-
 # endif
 
 #endif
diff --git a/include/internal/ssl.h b/include/internal/ssl.h
new file mode 100644 (file)
index 0000000..3bf9bf9
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/ssl.h>
+
+#ifndef OSSL_INTERNAL_SSL_H
+# define OSSL_INTERNAL_SSL_H
+# pragma once
+
+typedef void (*ossl_msg_cb)(int write_p, int version, int content_type,
+                            const void *buf, size_t len, SSL *ssl, void *arg);
+
+#endif
index be834d8f688c7b781f3b0f62c1b3276b82453a25..69a578dc5cb335de827741b89c2f39572aa131af 100644 (file)
@@ -36,6 +36,7 @@
 # include "internal/bio.h"
 # include "internal/ktls.h"
 # include "internal/time.h"
+# include "internal/ssl.h"
 # include "record/record.h"
 
 # ifdef OPENSSL_BUILD_SHLIBSSL
@@ -799,9 +800,6 @@ typedef struct {
 
 # define TLS_GROUP_FFDHE_FOR_TLS1_3 (TLS_GROUP_FFDHE|TLS_GROUP_ONLY_FOR_TLS1_3)
 
-typedef void (*ossl_msg_cb)(int write_p, int version, int content_type,
-                            const void *buf, size_t len, SSL *ssl, void *arg);
-
 struct ssl_ctx_st {
     OSSL_LIB_CTX *libctx;