Alien-ngtcp2

 view release on metacpan or  search on metacpan

vendor/picotls/include/picotls.h  view on Meta::CPAN


/**
 * global variables exposed
 */
extern struct st_ptls_log_t {
    /**
     * if application-data (e.g., payload) should be emitted as well
     */
    volatile unsigned may_include_appdata : 1;
    /**
     * endpoints that want to disable logging entirely can provide this value to the loggers
     */
    ptls_log_conn_state_t dummy_conn_state;
    /**
     * generation counter that is incremented whenever the state of loggers change; see `st_ptls_log_state_t::generation`
     */
    volatile uint64_t _generation;
} ptls_log;

/**
 * initializes a ptls_log_conn_state_t. `conn_id` and `peeraddr` (of type struct sockaddr) are optional; pass 0 and NULL

vendor/picotls/lib/picotls.c  view on Meta::CPAN

            if ((ret = call_on_client_hello_cb(tls_cbarg, ch->server_name, raw_message, ch->cipher_suites, ch->alpn.list,
                                               ch->alpn.count, NULL, 0, NULL, 0, NULL, 0, NULL, 0, 1)) != 0)
                return ret;
        }
        return PTLS_ALERT_PROTOCOL_VERSION;
    }

    /* Check TLS 1.3-specific constraints. Hereafter, we might exit without calling on_client_hello. That's fine because this CH is
     * ought to be rejected. */
    if (ch->legacy_version <= 0x0300) {
        /* RFC 8446 Appendix D.5: any endpoint receiving a Hello message with legacy_version set to 0x0300 MUST abort the handshake
         * with a "protocol_version" alert. */
        return PTLS_ALERT_PROTOCOL_VERSION;
    }
    if (!(ch->compression_methods.count == 1 && ch->compression_methods.ids[0] == 0))
        return PTLS_ALERT_ILLEGAL_PARAMETER;
    /* pre-shared key */
    if (ch->psk.hash_end != NULL) {
        /* PSK must be the last extension */
        if (!ch->psk.is_last_extension)
            return PTLS_ALERT_ILLEGAL_PARAMETER;



( run in 4.329 seconds using v1.01-cache-2.11-cpan-99fa8243a42 )