set_dhparams: pass BIO_new_file() "r" for the file mode, not O_RDONLY.

Unlike BIO_new_fp(), BIO_new_file() takes an fopen-style mode string.
This commit is contained in:
Todd C. Miller
2022-05-17 08:38:49 -06:00
parent 161a972600
commit 3ba807b70f

View File

@@ -233,7 +233,7 @@ set_dhparams(SSL_CTX *ctx, const char *dhparam_file)
bool ret = false;
debug_decl(set_dhparams, SUDO_DEBUG_UTIL);
bio = BIO_new_file(dhparam_file, O_RDONLY);
bio = BIO_new_file(dhparam_file, "r");
if (bio != NULL) {
if (set_dhparams_bio(ctx, bio)) {
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,