minor ssl logging changes and buffer fix

This commit is contained in:
2019-01-03 22:35:23 +02:00
parent 9cd8cc2c90
commit 0382ead79b
3 changed files with 6 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ static void show_certs(SSL *ssl)
static void *servlet(void *args) /* Serve the connection -- threadable */
{
struct msg_t buf;
struct msg_t buf = {0};
int bytes, ret;
//unsigned short job[MAXJOBS] = { 0 };
struct agent_args *agent = (struct agent_args *)args;
@@ -77,7 +77,7 @@ static void *servlet(void *args) /* Serve the connection -- threadable */
} else {
show_certs(agent->ssl);
do {
buf.meta.type = GET_MEMORY;
buf.meta.type = GET_OS;
sleep(1);
SSL_write(agent->ssl, &buf, sizeof(buf));
bytes = SSL_read(agent->ssl, &buf, sizeof(buf));
@@ -96,12 +96,10 @@ static void *servlet(void *args) /* Serve the connection -- threadable */
}
if (SSL_get_shutdown(agent->ssl)
== SSL_RECEIVED_SHUTDOWN)
log(VERBOSE,
"SSL_RECEIVED_SHUTDOWN from agent [%s]",
log(VERBOSE, "SSL_RECEIVED_SHUTDOWN from agent [%s]",
agent->ip);
else {
log(VERBOSE,
"Client didn't send data! SSL error below:");
log(VERBOSE, "Client didn't send data!");
/* I think logging is NOT needed here */
//log_ssl();
sprintf((char *)buf.chunk.data, "%s",

View File

@@ -79,7 +79,7 @@ static void *servlet(void *args) /* Serve the connection -- threadable */
if (SSL_get_shutdown(client->ssl) == SSL_RECEIVED_SHUTDOWN)
log(VERBOSE, "SSL_RECEIVED_SHUTDOWN from client [%s]", client->ip);
else {
log(VERBOSE, "Client didn't send data! SSL error below:");
log(VERBOSE, "Client didn't send data!");
//log_ssl(); /* We actually don't have anything to log from SSL */
sprintf((char *)buf.chunk.data, "%s", "Where's the data, m8?");
SSL_write(client->ssl, &buf, sizeof(struct msg_t));