diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-02 13:05:02 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-02 13:05:02 +0200 |
commit | f992ba117fe420a7231f005e62627380689d57ab (patch) | |
tree | cd8310f3deafb78f910832aaf47b2ff7ac98aa05 /src/prefs.c | |
parent | ff52105505dfa74fc93016aace904a1f1e86b570 (diff) |
Server certificates may also be verified by CAs
If the CA file/path are configured in preferences, trust CA verification
over manual TOFU checks.
Diffstat (limited to 'src/prefs.c')
-rw-r--r-- | src/prefs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/prefs.c b/src/prefs.c index 97ad7f48..e3b5d603 100644 --- a/src/prefs.c +++ b/src/prefs.c | |||
@@ -22,6 +22,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
22 | 22 | ||
23 | #include "prefs.h" | 23 | #include "prefs.h" |
24 | 24 | ||
25 | #include <the_Foundation/fileinfo.h> | ||
26 | |||
25 | void init_Prefs(iPrefs *d) { | 27 | void init_Prefs(iPrefs *d) { |
26 | d->dialogTab = 0; | 28 | d->dialogTab = 0; |
27 | d->useSystemTheme = iTrue; | 29 | d->useSystemTheme = iTrue; |
@@ -48,6 +50,8 @@ void init_Prefs(iPrefs *d) { | |||
48 | d->docThemeDark = colorfulDark_GmDocumentTheme; | 50 | d->docThemeDark = colorfulDark_GmDocumentTheme; |
49 | d->docThemeLight = white_GmDocumentTheme; | 51 | d->docThemeLight = white_GmDocumentTheme; |
50 | d->saturation = 1.0f; | 52 | d->saturation = 1.0f; |
53 | init_String(&d->caFile); | ||
54 | init_String(&d->caPath); | ||
51 | init_String(&d->geminiProxy); | 55 | init_String(&d->geminiProxy); |
52 | init_String(&d->gopherProxy); | 56 | init_String(&d->gopherProxy); |
53 | init_String(&d->httpProxy); | 57 | init_String(&d->httpProxy); |
@@ -56,6 +60,10 @@ void init_Prefs(iPrefs *d) { | |||
56 | #if defined (iPlatformAppleMobile) | 60 | #if defined (iPlatformAppleMobile) |
57 | d->hoverLink = iFalse; | 61 | d->hoverLink = iFalse; |
58 | #endif | 62 | #endif |
63 | /* TODO: Add some platform-specific common locations? */ | ||
64 | if (fileExistsCStr_FileInfo("/etc/ssl/certs")) { | ||
65 | setCStr_String(&d->caPath, "/etc/ssl/certs"); | ||
66 | } | ||
59 | } | 67 | } |
60 | 68 | ||
61 | void deinit_Prefs(iPrefs *d) { | 69 | void deinit_Prefs(iPrefs *d) { |
@@ -64,4 +72,6 @@ void deinit_Prefs(iPrefs *d) { | |||
64 | deinit_String(&d->gopherProxy); | 72 | deinit_String(&d->gopherProxy); |
65 | deinit_String(&d->httpProxy); | 73 | deinit_String(&d->httpProxy); |
66 | deinit_String(&d->downloadDir); | 74 | deinit_String(&d->downloadDir); |
75 | deinit_String(&d->caPath); | ||
76 | deinit_String(&d->caFile); | ||
67 | } | 77 | } |