Adding in curl and openssl repos

This commit is contained in:
2025-08-14 12:09:30 -04:00
parent af2117b574
commit 0ace93e303
21174 changed files with 3607720 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
$LIBSSL=../../libssl
SOURCE[$LIBSSL]=poll_immediate.c

View File

@@ -0,0 +1,57 @@
ssl/rio/libssl-lib-poll_immediate.o: ssl/rio/poll_immediate.c \
include/internal/common.h include/openssl/configuration.h \
include/internal/e_os.h include/openssl/opensslconf.h \
include/openssl/macros.h include/openssl/opensslv.h \
include/openssl/e_os2.h include/openssl/crypto.h \
include/openssl/safestack.h include/openssl/stack.h \
include/openssl/types.h include/openssl/cryptoerr.h \
include/openssl/symhacks.h include/openssl/cryptoerr_legacy.h \
include/openssl/core.h include/internal/numbers.h \
include/internal/nelem.h include/openssl/ssl.h \
include/openssl/e_ostime.h include/openssl/comp.h \
include/openssl/comperr.h include/openssl/bio.h include/openssl/bioerr.h \
include/openssl/x509.h include/openssl/buffer.h \
include/openssl/buffererr.h include/openssl/evp.h \
include/openssl/core_dispatch.h include/openssl/indicator.h \
include/openssl/params.h include/openssl/bn.h include/openssl/bnerr.h \
include/openssl/evperr.h include/openssl/objects.h \
include/openssl/obj_mac.h include/openssl/asn1.h \
include/openssl/asn1err.h include/openssl/objectserr.h \
include/openssl/ec.h include/openssl/ecerr.h include/openssl/rsa.h \
include/openssl/rsaerr.h include/openssl/dsa.h include/openssl/dh.h \
include/openssl/dherr.h include/openssl/dsaerr.h include/openssl/sha.h \
include/openssl/x509err.h include/openssl/x509_vfy.h \
include/openssl/lhash.h include/openssl/pkcs7.h \
include/openssl/pkcs7err.h include/openssl/http.h include/openssl/conf.h \
include/openssl/conferr.h include/openssl/conftypes.h \
include/openssl/pem.h include/openssl/pemerr.h include/openssl/hmac.h \
include/openssl/async.h include/openssl/asyncerr.h include/openssl/ct.h \
include/openssl/cterr.h include/openssl/sslerr.h \
include/openssl/sslerr_legacy.h include/openssl/prov_ssl.h \
include/openssl/ssl2.h include/openssl/ssl3.h include/openssl/tls1.h \
include/openssl/dtls1.h include/openssl/srtp.h include/openssl/quic.h \
include/openssl/err.h ssl/rio/../ssl_local.h \
include/internal/recordmethod.h include/internal/statem.h \
include/internal/packet.h include/internal/dane.h \
include/internal/refcount.h include/openssl/trace.h \
include/internal/tsan_assist.h include/internal/bio.h \
include/internal/ktls.h include/internal/time.h \
include/internal/safe_math.h include/internal/ssl.h \
include/internal/cryptlib.h ssl/rio/../record/record.h \
ssl/rio/../quic/quic_local.h include/internal/quic_ssl.h \
include/internal/quic_record_rx.h include/internal/quic_wire_pkt.h \
include/internal/packet_quic.h include/internal/quic_vlint.h \
include/internal/quic_types.h include/internal/quic_predef.h \
include/internal/quic_record_util.h include/internal/quic_demux.h \
include/internal/bio_addr.h include/internal/sockets.h \
include/internal/list.h include/internal/quic_ackm.h \
include/internal/quic_statm.h include/internal/quic_cc.h \
include/internal/quic_wire.h include/internal/quic_channel.h \
include/internal/quic_record_tx.h include/internal/qlog.h \
include/internal/qlog_events.h include/internal/thread.h \
include/internal/thread_arch.h include/crypto/context.h \
include/internal/quic_txp.h include/internal/quic_cfq.h \
include/internal/quic_txpim.h include/internal/quic_stream.h \
include/internal/quic_fc.h include/internal/quic_stream_map.h \
include/internal/quic_tls.h include/internal/quic_reactor.h \
include/internal/quic_thread_assist.h ssl/rio/../quic/../ssl_local.h

View File

@@ -0,0 +1,136 @@
/*
* Copyright 2024-2025 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 "internal/common.h"
#include <openssl/ssl.h>
#include <openssl/err.h>
#include "../ssl_local.h"
#if defined(_AIX)
/*
* Some versions of AIX define macros for events and revents for use when
* accessing pollfd structures (see Github issue #24236). That interferes
* with our use of these names here. We simply undef them.
*/
# undef revents
# undef events
#endif
#define ITEM_N(items, stride, n) \
(*(SSL_POLL_ITEM *)((char *)(items) + (n)*(stride)))
#define FAIL_FROM(n) \
do { \
size_t j; \
\
for (j = (n); j < num_items; ++j) \
ITEM_N(items, stride, j).revents = 0; \
\
ok = 0; \
goto out; \
} while (0)
#define FAIL_ITEM(i) \
do { \
ITEM_N(items, stride, i).revents = SSL_POLL_EVENT_F; \
++result_count; \
FAIL_FROM(i + 1); \
} while (0)
int SSL_poll(SSL_POLL_ITEM *items,
size_t num_items,
size_t stride,
const struct timeval *timeout,
uint64_t flags,
size_t *p_result_count)
{
int ok = 1;
size_t i, result_count = 0;
SSL_POLL_ITEM *item;
SSL *ssl;
uint64_t revents;
ossl_unused uint64_t events;
ossl_unused int do_tick = ((flags & SSL_POLL_FLAG_NO_HANDLE_EVENTS) == 0);
int is_immediate
= (timeout != NULL
&& timeout->tv_sec == 0 && timeout->tv_usec == 0);
/*
* Prevent calls which use SSL_poll functionality which is not currently
* supported.
*/
if (!is_immediate) {
ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
"SSL_poll does not currently support blocking "
"operation");
FAIL_FROM(0);
}
/* Trivial case. */
if (num_items == 0)
goto out;
/* Poll current state of each item. */
for (i = 0; i < num_items; ++i) {
item = &ITEM_N(items, stride, i);
events = item->events;
revents = 0;
switch (item->desc.type) {
case BIO_POLL_DESCRIPTOR_TYPE_SSL:
ssl = item->desc.value.ssl;
if (ssl == NULL)
/* NULL items are no-ops and have revents reported as 0 */
break;
switch (ssl->type) {
#ifndef OPENSSL_NO_QUIC
case SSL_TYPE_QUIC_CONNECTION:
case SSL_TYPE_QUIC_XSO:
if (!ossl_quic_conn_poll_events(ssl, events, do_tick, &revents))
/* above call raises ERR */
FAIL_ITEM(i);
if (revents != 0)
++result_count;
break;
#endif
default:
ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
"SSL_poll currently only supports QUIC SSL "
"objects");
FAIL_ITEM(i);
}
break;
case BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD:
ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
"SSL_poll currently does not support polling "
"sockets");
FAIL_ITEM(i);
default:
ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
"SSL_poll does not support unknown poll descriptor "
"type %d", item->desc.type);
FAIL_ITEM(i);
}
item->revents = revents;
}
/* TODO(QUIC POLLING): Blocking mode */
/* TODO(QUIC POLLING): Support for polling FDs */
out:
if (p_result_count != NULL)
*p_result_count = result_count;
return ok;
}