Fixed extraction of easyroam commonName #1

Merged
vonobernid merged 1 commits from schleedej/easyroam:main into main 2025-11-04 08:49:16 +01:00
Showing only changes of commit d225bcebd6 - Show all commits

View File

@@ -4,7 +4,7 @@
# At first, you have to generate an easyroam profile on https://www.easyroam.de/ that
# is generating an pkcs12 file as input for this script.
# Usage: bash configure-eduroam-with-easyroam.sh <YOUR-PKCS12-File>
# Usage: bash configure-eduroam-with-easyroam <YOUR-PKCS12-File>
set -e
@@ -68,7 +68,7 @@ ConfDir="$HOME/.easyroam"
openssl pkcs12 -in "$InputFile" $LegacyOption -nokeys -passin pass: -out "$ConfDir/easyroam_client_cert.pem"
openssl pkcs12 -in "$InputFile" $LegacyOption -nocerts -passin pass: -passout pass:"$Pwd" -out "$ConfDir/easyroam_client_key.pem"
openssl pkcs12 -info -in "$InputFile" $LegacyOption -nokeys -passin pass: -out "$ConfDir/easyroam_root_ca.pem" > /dev/null 2>&1
Identity=$(openssl x509 -noout -in "$ConfDir/easyroam_client_cert.pem" -subject | awk -F \, '{print $1}' | sed -e 's/.*=//' -e 's/\s*//')
Identity=$(openssl x509 -noout -in "$ConfDir/easyroam_client_cert.pem" -subject -nameopt multiline | awk -F' = ' '/commonName/ {print $2}')
# Remove existing connections