11#include <openssl/ec.h>
13#include <openssl/x509.h>
22#define CWIST_DTLS_MTU 1200
98 unsigned int dlen = 0;
102 for (
unsigned int i = 0;
i <
dlen && off + 3 <
cap;
i++)
104 return off > 0 && off <
cap ? 0 : -1;
159static int dgram_bio_read(
BIO *
bio,
char *out,
int outl) {
176static int dgram_bio_write(
BIO *
bio,
const char *
in,
int inl) {
179 if (!conn ||
inl < 0)
return -1;
186static long dgram_bio_ctrl(
BIO *
bio,
int cmd,
long num,
void *ptr) {
194static int dgram_bio_create(
BIO *
bio) {
200static void dgram_method_init(
void) {
213 if (!g_dgram_method)
return NULL;
int cwist_dtls_fingerprint(X509 *cert, char *out, size_t cap)
Compute the SHA-256 fingerprint of a certificate in SDP format.
int cwist_dtls_generate_cert(X509 **cert_out, EVP_PKEY **pkey_out)
Generate an ephemeral self-signed ECDSA certificate for DTLS.
SSL_CTX * cwist_dtls_ctx_new(int is_server, X509 *cert, EVP_PKEY *pkey)
Create a DTLS SSL_CTX for the client or server role.
unsigned int cwist_dtls_link_mtu(void)
Return the DTLS link MTU in bytes.
BIO * cwist_dtls_bio_new(struct cwist_webrtc_conn *conn)
Datagram BIO for conn: reads return conn->dtls_in once, writes go to cwist_webrtc_conn_dtls_out() one...
#define CWIST_DTLS_MTU
DTLS record/link MTU assumed for the media path (bytes). Used to size outgoing DTLS records so they f...
mbedTLS TLS backend: EVP subset (HMAC digest tags, AES-256-CBC).
#define SSL_CTX_check_private_key
#define SSL_CTX_set_verify
struct cwist_mtls_ctx SSL_CTX
#define SSL_CTX_set_min_proto_version
One peer: ICE state, DTLS session, SCTP association.
void cwist_webrtc_conn_dtls_out(struct cwist_webrtc_conn *conn, const uint8_t *data, size_t len)
Queue one datagram to the conn's peer (owner thread).
Internal types and cross-file helpers for the WebRTC DataChannel module (ICE-lite + DTLS + SCTP over ...