Skip to content

Commit 353c9a9

Browse files
committed
add option to allow unsafe digest
1 parent d04ca37 commit 353c9a9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/datum_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ bool datum_api_check_admin_password_only(struct MHD_Connection * const connectio
441441

442442
static enum MHD_DigestAuthAlgorithm datum_api_pick_digest_algo(struct MHD_Connection * const connection) {
443443
const char * const ua = MHD_lookup_connection_value(connection, MHD_HEADER_KIND, "User-Agent");
444-
if (strstr(ua, "AppleWebKit/") && !(strstr(ua, "Chrome/") || strstr(ua, "Brave/") || strstr(ua, "Edge/"))) {
444+
if (strstr(ua, "AppleWebKit/") && !(strstr(ua, "Chrome/") || strstr(ua, "Brave/") || strstr(ua, "Edge/")) && datum_config.api_allow_unsecure_macos_auth) {
445445
static bool safari_warned = false;
446446
if (!(safari_warned)) {
447447
DLOG_WARN("Detected login request from Apple Safari. For some reason, this browser only supports obsolete and insecure MD5 digest authentication. Login at your own risk!");

src/datum_conf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ const T_DATUM_CONFIG_ITEM datum_config_options[] = {
139139
{ .var_type = DATUM_CONF_BOOL, .category = "api", .name = "modify_conf", .description = "Enable modifying the config file from API/dashboard",
140140
.example_default = true,
141141
.required = false, .ptr = &datum_config.api_modify_conf, .default_bool = false },
142+
{ .var_type = DATUM_CONF_BOOL, .category = "api", .name = "allow_unsecure_macos_auth", .description = "Allow unsecure authentication on macOS",
143+
.required = false, .ptr = &datum_config.api_allow_unsecure_macos_auth, .default_bool = false },
142144

143145
// extra block submissions list
144146
{ .var_type = DATUM_CONF_STRING_ARRAY, .category = "extra_block_submissions", .name = "urls", .description = "Array of bitcoind RPC URLs to submit our blocks to directly. Include auth info: http://user:pass@IP",

src/datum_conf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ typedef struct {
136136
char api_listen_addr[128];
137137
int api_listen_port;
138138
bool api_modify_conf;
139+
bool api_allow_unsecure_macos_auth;
139140
json_t *config_json;
140141

141142
int extra_block_submissions_count;

0 commit comments

Comments
 (0)