]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add empty implementations of quic method functions
authorTomas Mraz <tomas@openssl.org>
Fri, 13 May 2022 13:34:22 +0000 (15:34 +0200)
committerPauli <pauli@openssl.org>
Fri, 3 Jun 2022 02:07:17 +0000 (12:07 +1000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18307)

ssl/build.info
ssl/quic/build.info [new file with mode: 0644]
ssl/quic/quic_impl.c [new file with mode: 0644]
ssl/quic/quic_local.h [new file with mode: 0644]
ssl/quic/quic_method.c [new file with mode: 0644]

index fd13ede5e86d9aad91be5d3797acd0ebea161e37..31355f00e0b1c4f10be212b3f31c49917229b2d7 100644 (file)
@@ -1,5 +1,9 @@
 LIBS=../libssl
 
+IF[{- !$disabled{quic} -}]
+  SUBDIRS=quic
+ENDIF
+
 #Needed for the multiblock code in rec_layer_s3.c
 IF[{- !$disabled{asm} -}]
   $AESDEF_x86=AES_ASM
diff --git a/ssl/quic/build.info b/ssl/quic/build.info
new file mode 100644 (file)
index 0000000..f957845
--- /dev/null
@@ -0,0 +1,3 @@
+$LIBSSL=../../libssl
+
+SOURCE[$LIBSSL]=quic_method.c quic_impl.c
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
new file mode 100644 (file)
index 0000000..bc10a4b
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2022 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/macros.h>
+#include <openssl/objects.h>
+#include "quic_local.h"
+
+__owur int ossl_quic_new(SSL *s)
+{
+    return s->method->ssl_clear(s);
+}
+
+void ossl_quic_free(SSL *s)
+{
+    return;
+}
+
+int ossl_quic_clear(SSL *s)
+{
+    return 1;
+}
+
+__owur int ossl_quic_accept(SSL *s)
+{
+    return 1;
+}
+
+__owur int ossl_quic_connect(SSL *s)
+{
+    return 1;
+}
+
+__owur int ossl_quic_read(SSL *s, void *buf, size_t len, size_t *readbytes)
+{
+    return 1;
+}
+
+__owur int ossl_quic_peek(SSL *s, void *buf, size_t len, size_t *readbytes)
+{
+    return 1;
+}
+
+__owur int ossl_quic_write(SSL *s, const void *buf, size_t len, size_t *written)
+{
+    return 1;
+}
+
+__owur int ossl_quic_shutdown(SSL *s)
+{
+    return 1;
+}
+
+__owur long ossl_quic_ctrl(SSL *s, int cmd, long larg, void *parg)
+{
+    return 0;
+}
+
+__owur long ossl_quic_ctx_ctrl(SSL_CTX *s, int cmd, long larg, void *parg)
+{
+    return 0;
+}
+
+__owur long ossl_quic_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
+{
+    return 0;
+}
+
+__owur long ossl_quic_ctx_callback_ctrl(SSL_CTX *s, int cmd, void (*fp) (void))
+{
+    return 0;
+}
+
+__owur size_t ossl_quic_pending(const SSL *s)
+{
+    return 0;
+}
diff --git a/ssl/quic/quic_local.h b/ssl/quic/quic_local.h
new file mode 100644 (file)
index 0000000..ffb6171
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2022 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
+ */
+
+#ifndef OSSL_QUIC_LOCAL_H
+# define OSSL_QUIC_LOCAL_H
+
+# include <openssl/ssl.h>
+# include "../ssl_local.h"
+
+# define OSSL_QUIC_ANY_VERSION 0xFFFFF
+
+# define IMPLEMENT_quic_meth_func(version, func_name, s_accept, \
+                                 s_connect, enc_data) \
+const SSL_METHOD *func_name(void)  \
+        { \
+        static const SSL_METHOD func_name##_data= { \
+                version, \
+                0, \
+                0, \
+                ossl_quic_new, \
+                ossl_quic_clear, \
+                ossl_quic_free, \
+                s_accept, \
+                s_connect, \
+                ossl_quic_read, \
+                ossl_quic_peek, \
+                ossl_quic_write, \
+                ossl_quic_shutdown, \
+                NULL /* renegotiate */, \
+                NULL /* renegotiate_check */, \
+                NULL /* read_bytes */, \
+                NULL /* write_bytes */, \
+                NULL /* dispatch_alert */, \
+                ossl_quic_ctrl, \
+                ossl_quic_ctx_ctrl, \
+                NULL /* get_cipher_by_char */, \
+                NULL /* put_cipher_by_char */, \
+                ossl_quic_pending, \
+                NULL /* num_ciphers */, \
+                NULL /* get_cipher */, \
+                NULL /* default_timeout */, \
+                &enc_data, \
+                ssl_undefined_void_function, \
+                ossl_quic_callback_ctrl, \
+                ossl_quic_ctx_callback_ctrl, \
+        }; \
+        return &func_name##_data; \
+        }
+
+__owur int ossl_quic_new(SSL *s);
+void ossl_quic_free(SSL *s);
+int ossl_quic_clear(SSL *s);
+__owur int ossl_quic_accept(SSL *s);
+__owur int ossl_quic_connect(SSL *s);
+__owur int ossl_quic_read(SSL *s, void *buf, size_t len, size_t *readbytes);
+__owur int ossl_quic_peek(SSL *s, void *buf, size_t len, size_t *readbytes);
+__owur int ossl_quic_write(SSL *s, const void *buf, size_t len, size_t *written);
+__owur int ossl_quic_shutdown(SSL *s);
+__owur long ossl_quic_ctrl(SSL *s, int cmd, long larg, void *parg);
+__owur long ossl_quic_ctx_ctrl(SSL_CTX *s, int cmd, long larg, void *parg);
+__owur long ossl_quic_callback_ctrl(SSL *s, int cmd, void (*fp) (void));
+__owur long ossl_quic_ctx_callback_ctrl(SSL_CTX *s, int cmd, void (*fp) (void));
+__owur size_t ossl_quic_pending(const SSL *s);
+
+#endif
diff --git a/ssl/quic/quic_method.c b/ssl/quic/quic_method.c
new file mode 100644 (file)
index 0000000..2c769f1
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2022 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/macros.h>
+#include <openssl/objects.h>
+#include "quic_local.h"
+
+IMPLEMENT_quic_meth_func(OSSL_QUIC_ANY_VERSION,
+                         OSSL_QUIC_client_method,
+                         ssl_undefined_function,
+                         ossl_quic_connect, ssl3_undef_enc_method)
+
+IMPLEMENT_quic_meth_func(OSSL_QUIC_ANY_VERSION,
+                         OSSL_QUIC_client_thread_method,
+                         ssl_undefined_function,
+                         ossl_quic_connect, ssl3_undef_enc_method)
+
+IMPLEMENT_quic_meth_func(OSSL_QUIC_ANY_VERSION,
+                         OSSL_QUIC_server_method,
+                         ossl_quic_accept,
+                         ssl_undefined_function, ssl3_undef_enc_method)