mirror of
https://github.com/opnsense/src.git
synced 2026-06-07 15:52:40 -04:00
Summary: Release notes can be found at https://www.openssl.org/news/openssl-3.0-notes.html . Obtained from: https://www.openssl.org/source/openssl-3.0.8.tar.gz Differential Revision: https://reviews.freebsd.org/D38835 Test Plan: ``` $ git status On branch vendor/openssl-3.0 nothing to commit, working tree clean $ (cd ..; fetch http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz.asc) openssl-3.0.8.tar.gz 14 MB 4507 kBps 04s openssl-3.0.8.tar.gz.asc 833 B 10 MBps 00s $ set | egrep '(XLIST|OSSLVER)=' OSSLVER=3.0.8 XLIST=FREEBSD-Xlist $ gpg --list-keys /home/ngie/.gnupg/pubring.kbx ----------------------------- pub rsa4096 2014-10-04 [SC] 7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C uid [ unknown] Richard Levitte <richard@levitte.org> uid [ unknown] Richard Levitte <levitte@lp.se> uid [ unknown] Richard Levitte <levitte@openssl.org> sub rsa4096 2014-10-04 [E] $ gpg --verify openssl-${OSSLVER}.tar.gz.asc openssl-${OSSLVER}.tar.gz gpg: Signature made Tue Feb 7 05:43:55 2023 PST gpg: using RSA key 7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C gpg: Good signature from "Richard Levitte <richard@levitte.org>" [unknown] gpg: aka "Richard Levitte <levitte@lp.se>" [unknown] gpg: aka "Richard Levitte <levitte@openssl.org>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 7953 AC1F BC3D C8B3 B292 393E D5E9 E43F 7DF9 EE8C $ (cd vendor.checkout/; git status; find . -type f -or -type l | cut -c 3- | sort > ../old) On branch vendor/openssl-3.0 nothing to commit, working tree clean $ tar -x -X $XLIST -f ../openssl-${OSSLVER}.tar.gz -C .. $ rsync --exclude FREEBSD.* --delete -avzz ../openssl-${OSSLVER}/* . $ cat .git gitdir: /home/ngie/git/freebsd-src/.git/worktrees/vendor.checkout $ diff -arq ../openssl-3.0.8 . Only in .: .git Only in .: FREEBSD-Xlist Only in .: FREEBSD-upgrade $ git status FREEBSD* On branch vendor/openssl-3.0 nothing to commit, working tree clean $ ``` Reviewers: emaste, jkim Subscribers: imp, andrew, dab Differential Revision: https://reviews.freebsd.org/D38835
125 lines
4.3 KiB
C
125 lines
4.3 KiB
C
/*
|
|
* Copyright 1995-2021 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_HTTP_SERVER_H
|
|
# define OSSL_HTTP_SERVER_H
|
|
|
|
# include "apps.h"
|
|
|
|
# ifndef HAVE_FORK
|
|
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
|
|
# define HAVE_FORK 0
|
|
# else
|
|
# define HAVE_FORK 1
|
|
# endif
|
|
# endif
|
|
|
|
# if HAVE_FORK
|
|
# undef NO_FORK
|
|
# else
|
|
# define NO_FORK
|
|
# endif
|
|
|
|
# if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \
|
|
&& !defined(OPENSSL_NO_POSIX_IO)
|
|
# define HTTP_DAEMON
|
|
# include <sys/types.h>
|
|
# include <sys/wait.h>
|
|
# include <syslog.h>
|
|
# include <signal.h>
|
|
# define MAXERRLEN 1000 /* limit error text sent to syslog to 1000 bytes */
|
|
# else
|
|
# undef LOG_DEBUG
|
|
# undef LOG_INFO
|
|
# undef LOG_WARNING
|
|
# undef LOG_ERR
|
|
# define LOG_DEBUG 7
|
|
# define LOG_INFO 6
|
|
# define LOG_WARNING 4
|
|
# define LOG_ERR 3
|
|
# endif
|
|
|
|
/*-
|
|
* Log a message to syslog if multi-threaded HTTP_DAEMON, else to bio_err
|
|
* prog: the name of the current app
|
|
* level: the severity of the message, e.g., LOG_ERR
|
|
* fmt: message with potential extra parameters like with printf()
|
|
* returns nothing
|
|
*/
|
|
void log_message(const char *prog, int level, const char *fmt, ...);
|
|
|
|
# ifndef OPENSSL_NO_SOCK
|
|
/*-
|
|
* Initialize an HTTP server by setting up its listening BIO
|
|
* prog: the name of the current app
|
|
* port: the port to listen on
|
|
* returns a BIO for accepting requests, NULL on error
|
|
*/
|
|
BIO *http_server_init_bio(const char *prog, const char *port);
|
|
|
|
/*-
|
|
* Accept an ASN.1-formatted HTTP request
|
|
* it: the expected request ASN.1 type
|
|
* preq: pointer to variable where to place the parsed request
|
|
* ppath: pointer to variable where to place the request path, or NULL
|
|
* pcbio: pointer to variable where to place the BIO for sending the response to
|
|
* acbio: the listening bio (typically as returned by http_server_init_bio())
|
|
* found_keep_alive: for returning flag if client requests persistent connection
|
|
* prog: the name of the current app, for diagnostics only
|
|
* port: the local port listening to, for diagnostics only
|
|
* accept_get: whether to accept GET requests (in addition to POST requests)
|
|
* timeout: connection timeout (in seconds), or 0 for none/infinite
|
|
* returns 0 in case caller should retry, then *preq == *ppath == *pcbio == NULL
|
|
* returns -1 on fatal error; also then holds *preq == *ppath == *pcbio == NULL
|
|
* returns 1 otherwise. In this case it is guaranteed that *pcbio != NULL while
|
|
* *ppath == NULL and *preq == NULL if and only if the request is invalid,
|
|
* On return value 1 the caller is responsible for sending an HTTP response,
|
|
* using http_server_send_asn1_resp() or http_server_send_status().
|
|
* The caller must free any non-NULL *preq, *ppath, and *pcbio pointers.
|
|
*/
|
|
int http_server_get_asn1_req(const ASN1_ITEM *it, ASN1_VALUE **preq,
|
|
char **ppath, BIO **pcbio, BIO *acbio,
|
|
int *found_keep_alive,
|
|
const char *prog, const char *port,
|
|
int accept_get, int timeout);
|
|
|
|
/*-
|
|
* Send an ASN.1-formatted HTTP response
|
|
* cbio: destination BIO (typically as returned by http_server_get_asn1_req())
|
|
* note: cbio should not do an encoding that changes the output length
|
|
* keep_alive: grant persistent connnection
|
|
* content_type: string identifying the type of the response
|
|
* it: the response ASN.1 type
|
|
* resp: the response to send
|
|
* returns 1 on success, 0 on failure
|
|
*/
|
|
int http_server_send_asn1_resp(BIO *cbio, int keep_alive,
|
|
const char *content_type,
|
|
const ASN1_ITEM *it, const ASN1_VALUE *resp);
|
|
|
|
/*-
|
|
* Send a trivial HTTP response, typically to report an error or OK
|
|
* cbio: destination BIO (typically as returned by http_server_get_asn1_req())
|
|
* status: the status code to send
|
|
* reason: the corresponding human-readable string
|
|
* returns 1 on success, 0 on failure
|
|
*/
|
|
int http_server_send_status(BIO *cbio, int status, const char *reason);
|
|
|
|
# endif
|
|
|
|
# ifdef HTTP_DAEMON
|
|
extern int multi;
|
|
extern int acfd;
|
|
|
|
void socket_timeout(int signum);
|
|
void spawn_loop(const char *prog);
|
|
# endif
|
|
|
|
#endif
|