-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathget_openssl_binaries.sh
More file actions
41 lines (33 loc) · 1018 Bytes
/
Copy pathget_openssl_binaries.sh
File metadata and controls
41 lines (33 loc) · 1018 Bytes
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
#!/bin/bash
set -ex
env
if [ -z "$OPENSSL_DIR" ]; then
echo "Error: OPENSSL_DIR is not set."
exit 1
fi
# If uname is arm64, then OS_NAME should be macos_arm
if [[ "$(uname)" == "Darwin" && "$(uname -m)" == "arm64" ]]; then
OS_NAME="macos_arm"
fi
if [[ -z "$OS_NAME" || "$OS_NAME" == "ui" ]]; then
OS_NAME=ubuntu_22_04
else
OS_NAME=${OS_NAME#fips_}
fi
if [ -z "$ARCHITECTURE" ]; then
ARCHITECTURE=$(uname -m)
fi
OPENSSL_VERSION=3.2.0
echo "Setup for OpenSSL version $OPENSSL_VERSION with FIPS module"
echo "Installing OpenSSL to ${1}..."
# Creating ssl config files directory.
rm -rf "${OPENSSL_DIR}/ssl"
mkdir -p "${OPENSSL_DIR}/ssl"
# Downloading and installing OpenSSL
wget "https://package.cosmian.com/openssl/$OPENSSL_VERSION/${OS_NAME}/${ARCHITECTURE}/${OPENSSL_VERSION}.tar.gz"
mv "${OPENSSL_VERSION}.tar.gz" "${OPENSSL_DIR}"
echo -n Extracting compressed archive...
cd "${OPENSSL_DIR}"
tar -xf "$OPENSSL_VERSION.tar.gz"
chmod u+x lib*/ossl-modules/*
rm "$OPENSSL_VERSION.tar.gz"