-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Giulia <[email protected]>
- Loading branch information
Showing
12 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/openssl-3.0.5/ | ||
/openssl-3.0.5.tar.gz* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Build OpenSSL as static PIE | ||
|
||
Script to build OpenSSL as a static PIE binary for use with Unikraft | ||
|
||
|
||
## Requirements | ||
|
||
Make sure that you have the following packages: | ||
* GCC | ||
* GNU Make | ||
|
||
## Build | ||
|
||
RUn the build.sh file. | ||
It will create a folder where the static PIE OpenSSL will be located. | ||
|
||
|
||
|
||
## Running | ||
|
||
### Encrypt | ||
|
||
```bash | ||
./openssl aes-256-cbc -a -salt -pbkdf2 -pass pass:PASSWORD -in rootfs/plaintext.txt -out rootfs/ciphertext.enc | ||
``` | ||
|
||
### Decrypt | ||
|
||
```bash | ||
./openssl aes-256-cbc -d -a -salt -pbkdf2 -pass pass:PASSWORD -in rootfs/ciphertext.enc | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
SSL_URL="https://www.openssl.org/source/openssl-3.0.5.tar.gz" | ||
rm -rf SSL-* | ||
echo -n "Downloading OpenSSL ... " | ||
wget -q "$SSL_URL" | ||
echo "" | ||
|
||
echo -n "Unpacking OpenSSL ... " | ||
tar xzf openssl-3.0.5.tar.gz | ||
echo "" | ||
|
||
|
||
pushd openssl-3.0.5 > /dev/null 2>&1 || exit 1 | ||
|
||
|
||
echo -n "Configuring OpenSSL for static-PIE building..." | ||
./Configure -static | ||
echo "" | ||
|
||
echo "Building OpenSSL..." | ||
sed -i '0,/$(BIN_LDFLAGS)/{s/$(BIN_LDFLAGS)[^ ]*/-static-pie/}' Makefile | ||
make -j "$(nproc)" | ||
echo "" | ||
|
||
|
||
popd > /dev/null 2>&1 || exit 1 | ||
|
||
ln -fn openssl-3.0.5/apps/openssl . | ||
|
||
rm openssl-3.0.5.tar.gz* | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
U2FsdGVkX189ngaVPb5krYDlQl7EaJSOs3fx7C+zC+4= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abcdefgh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/openssl-3.0.5/ | ||
/openssl-3.0.5.tar.gz* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Build OpenSSL as static PIE | ||
|
||
Script to build OpenSSL as a static PIE ELF binary. | ||
|
||
## Requirements | ||
|
||
Make sure that you have the following packages: | ||
* GCC | ||
* GNU Make | ||
|
||
## Build | ||
|
||
Run the build.sh file. | ||
It will create a folder where the static PIE OpenSSL will be located. | ||
|
||
## Running | ||
|
||
### Encrypt | ||
|
||
```bash | ||
./openssl aes-256-cbc -a -salt -pbkdf2 -pass pass:PASSWORD -in rootfs/plaintext.txt -out rootfs/ciphertext.enc | ||
``` | ||
|
||
### Decrypt | ||
|
||
```bash | ||
./openssl aes-256-cbc -d -a -salt -pbkdf2 -pass pass:PASSWORD -in rootfs/ciphertext.enc | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
SSL_URL="https://www.openssl.org/source/openssl-3.0.5.tar.gz" | ||
rm -rf SSL-* | ||
echo -n "Downloading OpenSSL ... " | ||
wget -q "$SSL_URL" | ||
echo "" | ||
|
||
echo -n "Unpacking OpenSSL ... " | ||
tar xzf openssl-3.0.5.tar.gz | ||
echo "" | ||
|
||
pushd openssl-3.0.5 > /dev/null 2>&1 || exit 1 | ||
|
||
echo -n "Configuring OpenSSL for static-PIE building..." | ||
./Configure -static | ||
echo "" | ||
|
||
echo "Building OpenSSL..." | ||
sed -i "0,/$(BIN_LDFLAGS)/{s/$(BIN_LDFLAGS)[^ ]*/-static-pie/}" Makefile | ||
make -j "$(nproc)" | ||
echo "" | ||
|
||
popd > /dev/null 2>&1 || exit 1 | ||
|
||
ln -fn openssl-3.0.5/apps/openssl . | ||
|
||
rm openssl-3.0.5.tar.gz* |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
U2FsdGVkX189ngaVPb5krYDlQl7EaJSOs3fx7C+zC+4= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abcdefgh |