From 0404cc374aa5c9413099163a8488c6f8474ab53e Mon Sep 17 00:00:00 2001 From: anil singla Date: Mon, 2 Dec 2024 10:54:36 +0000 Subject: [PATCH] fixed bugs --- bliman_setup.sh | 7 +++++-- src/main/bash/bliman-attest-OSAR.sh | 6 +++--- src/main/bash/bliman-load-genesis.sh | 2 +- src/main/bash/bliman-verify-OSAR.sh | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bliman_setup.sh b/bliman_setup.sh index 0c34a98..65eb54a 100755 --- a/bliman_setup.sh +++ b/bliman_setup.sh @@ -210,7 +210,7 @@ EOF # Sanity checks #bliman_setup_check - [[ xx"$?" != xx"0" ]] && return 1 + #[[ xx"$?" != xx"0" ]] && return 1 bliman_setup_echo "yellow" "Installing BLIman." @@ -219,7 +219,7 @@ EOF bliman_setup_echo "red" "Bliman not downloaded properly. Please try again." return 1 elif [ -d $tmp_location/BLIman ];then - cp -r $tmp_location/BLIman/contrib/ "$BLIMAN_DIR" + #cp -r $tmp_location/BLIman/contrib/ "$BLIMAN_DIR" cp -r $tmp_location/BLIman/src/main/bash/* "$bliman_src_folder" cp -r $tmp_location/BLIman/candidates/* "$bliman_candidates_folder" mkdir -p "$BLIMAN_DIR/bin/" @@ -464,6 +464,9 @@ done case $command in install) bliman_setup_check + if [ xx"$?" != xx"0" ];then + return 1 + fi [[ -z $bliver ]] && bliman_setup_echo "yellow" "No specific BLiman version is defined. Installing latest from repository." && ! bliman_setup_download && return 1 [[ ! -z $bliver ]] && bliman_setup_echo "yellow" "Downloading BLIman version $bliver" && ! bliman_setup_download $bliver && return 1 [[ -z $genesis_path ]] && bliman_setup_echo "yellow" "No Genesis path is provided doanloading the default genesis file from Be-Secure." && ! bliman_get_genesis_file && return 1 diff --git a/src/main/bash/bliman-attest-OSAR.sh b/src/main/bash/bliman-attest-OSAR.sh index 253cc3e..045bf4b 100644 --- a/src/main/bash/bliman-attest-OSAR.sh +++ b/src/main/bash/bliman-attest-OSAR.sh @@ -310,9 +310,9 @@ function attest_local () { done - [[ -Z $OSAR_PATH ]] && __bliman_echo_red "OSAR file path is mandatory parameter." && return 1 - [[ -Z $OSAR_FILE ]] && __bliman_echo_red "OSAR file name is mandatory parameter." && return 1 - [[ -Z $KEY_BASED ]] && __bliman_echo_red "KEY based or keyless is required parameter." && return 1 + [[ -z $OSAR_PATH ]] && __bliman_echo_red "OSAR file path is mandatory parameter." && return 1 + [[ -z $OSAR_FILE ]] && __bliman_echo_red "OSAR file name is mandatory parameter." && return 1 + [[ -z $KEY_BASED ]] && __bliman_echo_red "KEY based or keyless is required parameter." && return 1 attest_file_local $OSAR_PATH $OSAR_FILE $KEY_BASED $KEY_PATH $KEY_NAME diff --git a/src/main/bash/bliman-load-genesis.sh b/src/main/bash/bliman-load-genesis.sh index fd09ee3..f9520cb 100644 --- a/src/main/bash/bliman-load-genesis.sh +++ b/src/main/bash/bliman-load-genesis.sh @@ -134,7 +134,7 @@ function __bli_load_genesis() { echo $filename | grep "genesis-*.*.yaml" if [ xx"$?" == xx"0" ];then filetype=$(echo $filename | cut -d'-' -f2 ) - [[ $filetype != "OSPO.yaml"]] && [[ $filetype != "OASP.yaml"]] && [[ $filetype != "AIC.yaml"]] && __bliman_echo_red "Nod a valid genesis filename." && return 1 + [[ $filetype != "OSPO.yaml" ]] && [[ $filetype != "OASP.yaml" ]] && [[ $filetype != "AIC.yaml" ]] && __bliman_echo_red "Nod a valid genesis filename." && return 1 fi if [ $filenamefirst == "http" ] || [ $filenamefirst == "https" ];then diff --git a/src/main/bash/bliman-verify-OSAR.sh b/src/main/bash/bliman-verify-OSAR.sh index f48fdf7..b55526f 100644 --- a/src/main/bash/bliman-verify-OSAR.sh +++ b/src/main/bash/bliman-verify-OSAR.sh @@ -173,8 +173,8 @@ function verify_local () { done - [[ -Z $OSAR_PATH ]] && __bliman_echo_red "OSAR file path is mandatory parameter." && return 1 - [[ -Z $AUTH_TYPE ]] && __bliman_echo_red "Auth type is required parameter." && return 1 + [[ -z $OSAR_PATH ]] && __bliman_echo_red "OSAR file path is mandatory parameter." && return 1 + [[ -z $AUTH_TYPE ]] && __bliman_echo_red "Auth type is required parameter." && return 1 if [ xx"$AUTH_TYPE" == xx"key-based" ];then