From a2794947661f29bd73da2db431a9c3c39e1e8afa Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 9 Aug 2016 12:07:53 +0100 Subject: [PATCH] Option to remove pinning for a domain from the control panel --- src/freedombone-sec | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/freedombone-sec b/src/freedombone-sec index b0ef99b4..554fad9b 100755 --- a/src/freedombone-sec +++ b/src/freedombone-sec @@ -702,6 +702,25 @@ function pin_all_tls_certs { ${PROJECT_NAME}-pin-cert all } +function remove_pinning { + data=$(tempfile 2>/dev/null) + trap "rm -f $data" 0 1 2 5 15 + dialog --title $"Remove pinning for a domain" \ + --backtitle $"Freedombone Security Settings" \ + --inputbox $"Enter the website domain name (without https://)" 8 60 2>$data + sel=$? + case $sel in + 0) + domain=$(<$data) + ${PROJECT_NAME}-pin-cert "$domain" remove + if [ ! "$?" = "0" ]; then + dialog --title $"Removed pinning from $domain" \ + --msgbox "$?" 6 40 + fi + ;; + esac +} + function housekeeping { cmd=(dialog --separate-output \ --backtitle "Freedombone Security Configuration" \ @@ -715,7 +734,8 @@ function housekeeping { 6 "Enable GPG based authentication (monkeysphere)" off 7 "Register a website with monkeysphere" off 8 "Pin all TLS certificates" off - 9 "Go Back/Exit" on) + 9 "Remove pinning for a domain" off + 10 "Go Back/Exit" on) choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) clear for choice in $choices @@ -746,6 +766,9 @@ function housekeeping { pin_all_tls_certs ;; 9) + remove_pinning + ;; + 10) exit 0 ;; esac