~rcr/rirc

2263189ab36ef17c8572f84050e2d9dbc3c23edf — Richard Robbins 6 months ago e4ca372
update mbedtls version to 3.0.0
3 files changed, 7 insertions(+), 15 deletions(-)

M lib/mbedtls.Makefile
M lib/mbedtls.h
M src/io.c
M lib/mbedtls.Makefile => lib/mbedtls.Makefile +2 -2
@@ 1,5 1,5 @@
MBEDTLS_VER     := 2.25.0
MBEDTLS_VER_SHA := f838f670f51070bc6b4ebf0c084affd9574652ded435b064969f36ce4e8b586d
MBEDTLS_VER     := 3.0.0
MBEDTLS_VER_SHA := 525bfde06e024c1218047dee1c8b4c89312df1a4b5658711009086cda5dfaa55

MBEDTLS_CFG := $(abspath $(PATH_LIB)/mbedtls.h)
MBEDTLS_SHA := $(abspath $(PATH_LIB)/mbedtls.sha256)

M lib/mbedtls.h => lib/mbedtls.h +2 -6
@@ 1,5 1,4 @@
#ifndef MBEDTLS_CONFIG_H
#define MBEDTLS_CONFIG_H
#define MBEDTLS_CONFIG_VERSION 0x03000000

/* Enabled ciphersuites, in order of preference.
 *   - Only ECHDE key exchanges, AEAD ciphers


@@ 92,6 91,7 @@
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SSL_TLS_C


@@ 110,7 110,3 @@

/* Error strings */
#define MBEDTLS_ERROR_C

#include "mbedtls/check_config.h"

#endif

M src/io.c => src/io.c +3 -7
@@ 577,7 577,7 @@ io_cx_read(struct connection *cx, uint32_t timeout)
	struct pollfd fd[1];
	unsigned char buf[1024];

	fd[0].fd = cx->net_ctx.fd;
	fd[0].fd = cx->net_ctx.MBEDTLS_PRIVATE(fd);
	fd[0].events = POLLIN;

	while ((ret = poll(fd, 1, timeout)) < 0 && errno == EAGAIN)


@@ 750,7 750,7 @@ io_net_connect(struct connection *cx)
err:
	freeaddrinfo(res);

	return (cx->net_ctx.fd = ret);
	return (cx->net_ctx.MBEDTLS_PRIVATE(fd) = ret);
}

static void


@@ 890,16 890,12 @@ io_tls_x509_vrfy(struct connection *cx)
	if (mbedtls_x509_crt_verify_info(buf, sizeof(buf), "", ret) < 0)
		return -1;

	s = buf;

	while (*s) {
	for (s = buf; s && *s; s = p) {

		if ((p = strchr(buf, '\n')))
			*p++ = 0;

		io_error(cx, " .... %s", s);

		s = p;
	}

	return 0;