Skip to content

Commit 984d2cf

Browse files
committed
BUG/MINOR: ssl/cli: 'set ssl cert' does not check the transaction name correctly
Since commit 089c138 ("MEDIUM: ssl: ssl-load-extra-del-ext work only with .crt"), the 'set ssl cert' CLI command does not check correctly if the transaction you are trying to update is the right one. The consequence is that you could commit accidentaly a transaction on the wrong certificate. The fix introduces the check again in case you are not using ssl-load-extra-del-ext. This must be backported in all stable versions.
1 parent 18582ed commit 984d2cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ssl_ckch.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2600,7 +2600,7 @@ static int cli_parse_set_cert(char **args, char *payload, struct appctx *appctx,
26002600
errcode |= ERR_ALERT | ERR_FATAL;
26012601
goto end;
26022602
}
2603-
2603+
/* check again with the right extension */
26042604
if (strcmp(ckchs_transaction.path, buf->area) != 0) {
26052605
/* remove .crt of the error message */
26062606
*(b_orig(buf) + b_data(buf) + strlen(".crt")) = '\0';
@@ -2610,6 +2610,11 @@ static int cli_parse_set_cert(char **args, char *payload, struct appctx *appctx,
26102610
errcode |= ERR_ALERT | ERR_FATAL;
26112611
goto end;
26122612
}
2613+
} else {
2614+
/* without del-ext the error is definitive */
2615+
memprintf(&err, "The ongoing transaction is about '%s' but you are trying to set '%s'\n", ckchs_transaction.path, buf->area);
2616+
errcode |= ERR_ALERT | ERR_FATAL;
2617+
goto end;
26132618
}
26142619
}
26152620

0 commit comments

Comments
 (0)