summary refs log tree commit diff
path: root/pkgs/tools/security/cipherscan/path.patch
blob: 3b6d8ef805098fb2f8cf00360038e4a9ea2f9b30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
diff --git a/analyze.py b/analyze.py
index bb62af8..e929253 100755
--- a/analyze.py
+++ b/analyze.py
@@ -418,13 +418,7 @@ def build_ciphers_lists(opensslbin):
 
     # use system openssl if not on linux 64
     if not opensslbin:
-        if platform.system() == 'Linux' and platform.architecture()[0] == '64bit':
-            opensslbin = mypath + '/openssl'
-        elif platform.system() == 'Darwin' and platform.architecture()[0] == '64bit':
-            opensslbin = mypath + '/openssl-darwin64'
-        else:
-            opensslbin='openssl'
-            print("warning: analyze.py is using system's openssl, which may limit the tested ciphers and recommendations")
+        opensslbin = "@OPENSSLBIN@"
 
     logging.debug('Loading all ciphers: ' + allC)
     all_ciphers = subprocess.Popen([opensslbin, 'ciphers', allC],
diff --git a/cipherscan b/cipherscan
index 236b34f..a240d13 100755
--- a/cipherscan
+++ b/cipherscan
@@ -30,43 +30,12 @@ if [[ -n $NOAUTODETECT ]]; then
 else
     case "$(uname -s)" in
         Darwin)
-            opensslbin_name="openssl-darwin64"
-
-            READLINKBIN=$(which greadlink 2>/dev/null)
-            if [[ -z $READLINKBIN ]]; then
-                echo "greadlink not found. (try: brew install coreutils)" 1>&2
-                exit 1
-            fi
-            TIMEOUTBIN=$(which gtimeout 2>/dev/null)
-            if [[ -z $TIMEOUTBIN ]]; then
-                echo "gtimeout not found. (try: brew install coreutils)" 1>&2
-                exit 1
-            fi
+            READLINKBIN="@READLINKBIN@"
+            TIMEOUTBIN="@TIMEOUTBIN@"
             ;;
         *)
-            opensslbin_name="openssl"
-
-            # test that readlink or greadlink (darwin) are present
-            READLINKBIN="$(which readlink)"
-
-            if [[ -z $READLINKBIN ]]; then
-                READLINKBIN="$(which greadlink)"
-                if [[ -z $READLINKBIN ]]; then
-                    echo "neither readlink nor greadlink are present. install coreutils with {apt-get,yum,brew} install coreutils" 1>&2
-                    exit 1
-                fi
-            fi
-
-            # test that timeout or gtimeout (darwin) are present
-            TIMEOUTBIN="$(which timeout)"
-
-            if [[ -z $TIMEOUTBIN ]]; then
-                TIMEOUTBIN="$(which gtimeout)"
-                if [[ -z $TIMEOUTBIN ]]; then
-                    echo "neither timeout nor gtimeout are present. install coreutils with {apt-get,yum,brew} install coreutils" 1>&2
-                    exit 1
-                fi
-            fi
+            READLINKBIN="@READLINKBIN@"
+            TIMEOUTBIN="@TIMEOUTBIN@"
 
             # Check for busybox, which has different arguments
             TIMEOUTOUTPUT="$($TIMEOUTBIN --help 2>&1)"
@@ -1944,20 +1913,7 @@ do
 done
 
 if [[ -z $OPENSSLBIN ]]; then
-    readlink_result=$("$READLINKBIN" -f "$0")
-    if [[ -z $readlink_result ]]; then
-        echo "$READLINKBIN -f $0 failed, aborting." 1>&2
-        exit 1
-    fi
-    REALPATH=$(dirname "$readlink_result")
-    if [[ -z $REALPATH ]]; then
-        echo "dirname $REALPATH failed, aborting." 1>&2
-        exit 1
-    fi
-    OPENSSLBIN="${REALPATH}/${opensslbin_name}"
-    if ! [[ -x "${OPENSSLBIN}" ]]; then
-        OPENSSLBIN="$(which openssl)"  # fallback to generic openssl
-    fi
+    OPENSSLBIN="@OPENSSLBIN@"
 fi
 # use custom config file to enable GOST ciphers
 if [[ -e $DIRNAMEPATH/openssl.cnf ]]; then