Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bash dependency #617

Merged
merged 4 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions kuksa_certificates/genCerts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh


genCAKey() {
Expand All @@ -23,9 +23,12 @@ genKey() {
# as some TLS client integrations cannot handle name verification towards IP-addresses
# (Only client for now in KUKSA.val that has problem with IP host validation is the kuksa-client gRPC integration)
genCert() {
tmp="$(mktemp)"
printf "subjectAltName=DNS:%s, DNS:localhost, IP:127.0.0.1" "$1" > "$tmp"
openssl req -new -key $1.key -out $1.csr -passin pass:"temp" -subj "/C=CA/ST=Ontario/L=Ottawa/O=Eclipse.org Foundation, Inc./CN=$1/[email protected]"
openssl x509 -req -in $1.csr -extfile <(printf "subjectAltName=DNS:$1, DNS:localhost, IP:127.0.0.1") -CA CA.pem -CAkey CA.key -CAcreateserial -days 365 -out $1.pem
openssl x509 -req -in $1.csr -extfile "$tmp" -CA CA.pem -CAkey CA.key -CAcreateserial -days 365 -out $1.pem
openssl verify -CAfile CA.pem $1.pem
rm "$tmp"
}

set -e
Expand Down Expand Up @@ -62,4 +65,3 @@ do
genCert $i
echo ""
done

9 changes: 4 additions & 5 deletions kuksa_certificates/jwt/recreateJWTkeyPair.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

# Copyright Robert Bosch GmbH, 2020. Part of the Eclipse Kuksa Project.
#
Expand All @@ -13,12 +13,11 @@ echo "Recreating kuksa.val key pair used for JWT verification"
echo "-------------------------------------------------------"


echo -e "\nCreating private key"
printf "\nCreating private key\n"
ssh-keygen -t rsa -b 4096 -m PEM -f jwt.key -q -N ""

echo -e "\nCreating public key"
printf "\nCreating public key\n"
openssl rsa -in jwt.key -pubout -outform PEM -out jwt.key.pub

echo -e '\nYou can use the PRIVATE key "jwt.key" to generate new tokens using https://jwt.io or the "createToken.py" script.'
printf '\nYou can use the PRIVATE key "jwt.key" to generate new tokens using https://jwt.io or the "createToken.py" script.\n'
echo 'You need to give the PUBLIC key "jwt.key.pub" to the kuksa.val server, so it can verify correctly signed JWT tokens.'

Loading