Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ssl submodule for Mbed TLS 3.0.0 compat #27

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,11 @@ static int ssl_negotiated(struct uh_connection_internal *conn)
int ret;

ret = ssl_accept(conn->ssl, on_ssl_verify_error, NULL);
if (ret == SSL_PENDING)
if (ret == SSL_WANT_READ || ret == SSL_WANT_WRITE)
return 0;

if (ret == SSL_ERROR) {
log_err("ssl connect error: %s\n", ssl_last_error_string(err_buf, sizeof(err_buf)));
log_err("ssl connect error: %s\n", ssl_last_error_string(conn->ssl, err_buf, sizeof(err_buf)));
return -1;
}

Expand All @@ -853,11 +853,11 @@ static int conn_ssl_read(int fd, void *buf, size_t count, void *arg)

ret = ssl_read(conn->ssl, buf, count);
if (ret == SSL_ERROR) {
log_err("ssl_read: %s\n", ssl_last_error_string(err_buf, sizeof(err_buf)));
log_err("ssl_read: %s\n", ssl_last_error_string(conn->ssl, err_buf, sizeof(err_buf)));
return P_FD_ERR;
}

if (ret == SSL_PENDING)
if (ret == SSL_WANT_READ || ret == SSL_WANT_WRITE)
return P_FD_PENDING;

return ret;
Expand All @@ -884,11 +884,11 @@ static void conn_write_cb(struct ev_loop *loop, struct ev_io *w, int revents)

ret = ssl_write(conn->ssl, buffer_data(b), buffer_length(b));
if (ret == SSL_ERROR) {
log_err("ssl_write: %s\n", ssl_last_error_string(err_buf, sizeof(err_buf)));
log_err("ssl_write: %s\n", ssl_last_error_string(conn->ssl, err_buf, sizeof(err_buf)));
goto err;
}

if (ret == SSL_PENDING)
if (ret == SSL_WANT_READ || ret == SSL_WANT_WRITE)
return;

buffer_pull(b, NULL, ret);
Expand Down
2 changes: 1 addition & 1 deletion src/ssl
Submodule ssl updated 9 files
+2 −4 CMakeLists.txt
+32 −26 example-client.c
+35 −28 example-server.c
+21 −0 example.crt
+91 −0 example.h
+28 −0 example.key
+77 −111 mbedtls.c
+87 −91 openssl.c
+19 −32 ssl.h
2 changes: 1 addition & 1 deletion src/uhttpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static int uh_server_ssl_init(struct uh_server *srv, const char *cert, const cha
return -1;
}

if (ssl_load_crt_file(srvi->ssl_ctx, cert)) {
if (ssl_load_cert_file(srvi->ssl_ctx, cert)) {
log_err("load certificate file fail\n");
return -1;
}
Expand Down
Loading