summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>1999-03-01 04:27:46 +0000
committerbeck <beck@openbsd.org>1999-03-01 04:27:46 +0000
commitda4e2a805b85b1e03ee77f85b14e50055c16e437 (patch)
tree1b45eae4a3a05003ba7cf157f7388b789dfae8bc /usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c
parenttweak for 2.5 (diff)
downloadwireguard-openbsd-da4e2a805b85b1e03ee77f85b14e50055c16e437.tar.xz
wireguard-openbsd-da4e2a805b85b1e03ee77f85b14e50055c16e437.zip
mod_ssl-2.2.3-1.3.4 (will require libssl-1.1 for https to work, but
mostly harmless otherwise).
Diffstat (limited to 'usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c')
-rw-r--r--usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c b/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c
new file mode 100644
index 00000000000..2d8632ae355
--- /dev/null
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_util_ssl.c
@@ -0,0 +1,94 @@
+/* _ _
+** _ __ ___ ___ __| | ___ ___| |
+** | '_ ` _ \ / _ \ / _` | / __/ __| |
+** | | | | | | (_) | (_| | \__ \__ \ | mod_ssl - Apache Interface to SSLeay
+** |_| |_| |_|\___/ \__,_|___|___/___/_| http://www.engelschall.com/sw/mod_ssl/
+** |_____|
+** ssl_util_ssl.c
+** Additional Utility Functions for SSLeay
+*/
+
+/* ====================================================================
+ * Copyright (c) 1998-1999 Ralf S. Engelschall. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by
+ * Ralf S. Engelschall <rse@engelschall.com> for use in the
+ * mod_ssl project (http://www.engelschall.com/sw/mod_ssl/)."
+ *
+ * 4. The names "mod_ssl" must not be used to endorse or promote
+ * products derived from this software without prior written
+ * permission. For written permission, please contact
+ * rse@engelschall.com.
+ *
+ * 5. Products derived from this software may not be called "mod_ssl"
+ * nor may "mod_ssl" appear in their names without prior
+ * written permission of Ralf S. Engelschall.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by
+ * Ralf S. Engelschall <rse@engelschall.com> for use in the
+ * mod_ssl project (http://www.engelschall.com/sw/mod_ssl/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR
+ * HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
+#include "mod_ssl.h"
+
+
+/* _________________________________________________________________
+**
+** Additional High-Level Functions for SSLeay
+** _________________________________________________________________
+*/
+
+int SSL_get_app_data2_idx(void)
+{
+ static int app_data2_idx = -1;
+
+ if (app_data2_idx < 0) {
+ app_data2_idx = SSL_get_ex_new_index(0,
+ "Second Application Data for SSL", NULL, NULL, NULL);
+ app_data2_idx = SSL_get_ex_new_index(0,
+ "Second Application Data for SSL", NULL, NULL, NULL);
+ }
+ return(app_data2_idx);
+}
+
+void *SSL_get_app_data2(SSL *ssl)
+{
+ return (void *)SSL_get_ex_data(ssl, SSL_get_app_data2_idx());
+}
+
+void SSL_set_app_data2(SSL *ssl, void *arg)
+{
+ SSL_set_ex_data(ssl, SSL_get_app_data2_idx(), (char *)arg);
+ return;
+}
+