1
0
Fork 0

minor cleanup

This commit is contained in:
Ailin Nemui 2024-04-01 16:33:36 +02:00
parent f2b97631e1
commit 98b391f62e
2 changed files with 6 additions and 5 deletions

View File

@ -250,7 +250,7 @@ static void scram_authenticate(IRC_SERVER_REC *server, const char *data, const c
scram_session_create(digest, conn->sasl_username, conn->sasl_password);
if (conn->scram_session == NULL) {
g_error("Could not create SCRAM session with digest %s", digest);
g_critical("Could not create SCRAM session with digest %s", digest);
irc_send_cmd_now(server, "AUTHENTICATE *");
return;
}
@ -260,13 +260,13 @@ static void scram_authenticate(IRC_SERVER_REC *server, const char *data, const c
if (ret == SCRAM_IN_PROGRESS) {
// Authentication is still in progress
GString *resp = g_string_new(output);
GString *resp = g_string_new_len(output, output_len);
sasl_send_response(server, resp);
g_string_free(resp, TRUE);
g_free(output);
} else if (ret == SCRAM_SUCCESS) {
// Authentication succeeded
irc_send_cmd_now(server, "AUTHENTICATE +");
sasl_send_response(server, NULL);
scram_session_free(conn->scram_session);
conn->scram_session = NULL;
} else if (ret == SCRAM_ERROR) {

View File

@ -137,7 +137,8 @@ static scram_status process_server_first(SCRAM_SESSION_REC *session, const char
param_count = g_strv_length(params);
if (param_count < 3) {
session->error = g_strdup_printf("Invalid server-first-message: %s", data);
/* Invalid server-first-message */
session->error = g_strdup_printf("%s", data);
g_strfreev(params);
return SCRAM_ERROR;
}
@ -300,4 +301,4 @@ scram_status scram_process(SCRAM_SESSION_REC *session, const char *input, char *
}
return status;
}
}