Removed BIOs
This commit is contained in:
@ -48,7 +48,6 @@ int client_connection_handler(sock *client) {
|
||||
client->ssl = SSL_new(client->ctx);
|
||||
SSL_set_fd(client->ssl, client->socket);
|
||||
SSL_set_accept_state(client->ssl);
|
||||
SSL_set_bio(client->ssl, client->bio_in, client->bio_out);
|
||||
|
||||
ret = SSL_accept(client->ssl);
|
||||
if (ret <= 0) {
|
||||
@ -61,8 +60,6 @@ int client_connection_handler(sock *client) {
|
||||
if (client->enc) {
|
||||
SSL_shutdown(client->ssl);
|
||||
SSL_free(client->ssl);
|
||||
BIO_free(client->bio_in);
|
||||
BIO_free(client->bio_out);
|
||||
}
|
||||
shutdown(client->socket, SHUT_RDWR);
|
||||
close(client->socket);
|
||||
|
@ -200,11 +200,6 @@ int main(int argc, const char *argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
client.bio_in = BIO_new(BIO_s_mem());
|
||||
client.bio_out = BIO_new(BIO_s_mem());
|
||||
BIO_set_mem_eof_return(client.bio_in, -1);
|
||||
BIO_set_mem_eof_return(client.bio_out, -1);
|
||||
|
||||
for (int i = 0; i < NUM_SOCKETS; i++) {
|
||||
if (listen(SOCKETS[i], LISTEN_BACKLOG) == -1) {
|
||||
fprintf(stderr, ERR_STR "Unable to listen on socket %i: %s" CLR_STR "\n", i, strerror(errno));
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/ssl.h>
|
||||
@ -38,8 +37,6 @@ typedef struct {
|
||||
int socket;
|
||||
SSL_CTX *ctx;
|
||||
SSL *ssl;
|
||||
BIO *bio_in;
|
||||
BIO *bio_out;
|
||||
} sock;
|
||||
|
||||
char *ssl_get_error(SSL *ssl, int ret);
|
||||
|
Reference in New Issue
Block a user