Skip to content

Commit

Permalink
Do not offer scram-256-plus over non-SSL connection (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke authored Aug 30, 2023
1 parent daac7d5 commit 286802c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sources/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,16 @@ static inline int od_auth_frontend_scram_sha_256(od_client_t *client)
{
od_instance_t *instance = client->global->instance;
char *mechanisms[2] = { "SCRAM-SHA-256", "SCRAM-SHA-256-PLUS" };

/* request AuthenticationSASL */
machine_msg_t *msg =
kiwi_be_write_authentication_sasl(NULL, mechanisms, 2);
machine_msg_t *msg;

if (client->tls == NULL) {
msg = kiwi_be_write_authentication_sasl(NULL, mechanisms, 1);
} else {
msg = kiwi_be_write_authentication_sasl(NULL, mechanisms, 2);
}

if (msg == NULL)
return -1;

Expand Down

0 comments on commit 286802c

Please sign in to comment.