From: Matthias Kruk Date: Mon, 14 Jun 2021 22:53:00 +0000 (+0900) Subject: include/ipc: Remove option to disable authentication X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=e554fcdecd0b3c68f5d97ab4dbf75fef30396c60;p=toolbox include/ipc: Remove option to disable authentication Providing the option to disable authentication does not bring any real benefits, while it adds code paths that need to be tested. This commit removes the option to disable authentication. --- diff --git a/include/ipc.sh b/include/ipc.sh index 29bd5ce..096015b 100644 --- a/include/ipc.sh +++ b/include/ipc.sh @@ -10,7 +10,6 @@ __init() { declare -gxr __ipc_private="$__ipc_root/priv/$USER" declare -gxr __ipc_group="toolbox_ipc" - declare -gxi __ipc_authentication=1 declare -gxir __ipc_version=1 if ! mkdir -p "$__ipc_private" || @@ -42,18 +41,6 @@ _ipc_msg_decode() { fi } -ipc_authentication_enable() { - log_info "MESSAGE AUTHENTICATION ENABLED" - __ipc_authentication=1 - return 0 -} - -ipc_authentication_disable() { - log_error "MESSAGE AUTHENTICATION DISABLED" - __ipc_authentication=0 - return 0 -} - _ipc_msg_get() { local msg="$1" local field="$2" @@ -73,7 +60,6 @@ _ipc_msg_get_signature() { local data local signature - local output data=$(_ipc_msg_get "$msg" "data") signature=$(_ipc_msg_get "$msg" "signature") @@ -120,8 +106,7 @@ _ipc_msg_version_supported() { ipc_msg_validate() { local msg="$1" - if (( __ipc_authentication == 1 )) && - ! _ipc_msg_verify "$msg"; then + if ! _ipc_msg_verify "$msg"; then return 1 fi @@ -199,7 +184,6 @@ ipc_msg_dump() { local version_ok local signature_ok - local validation_status version=$(_ipc_msg_get "$msg" "version") data=$(_ipc_msg_get "$msg" "data") @@ -207,7 +191,6 @@ ipc_msg_dump() { version_ok="no" signature_ok="no" - validation_status="disabled" if _ipc_msg_version_supported "$msg"; then version_ok="yes" @@ -217,13 +200,9 @@ ipc_msg_dump() { signature_ok="yes" fi - if (( __ipc_authentication == 1 )); then - validation_status="enabled" - fi - cat <