italia / Satosa-Saml2Spid

SATOSA SAML-to-SAML proxy with Spid compliances
Apache License 2.0
42 stars 25 forks source link

import keys from enviroments errors #83

Closed MdreW closed 9 months ago

MdreW commented 11 months ago

Hi all, I have find two errors relative of the satosa keys import in run.sh script.

if [[ -v SATOSA_PRIVATE_KEY && -v SATOSA_PUBLIC_KEY ]]; then
  echo $SATOSA_PRIVATE_KEYS > pki/privkey.pem
  echo $SATOSA_PUBLIC_KEY > pki/cert.pem
  echo "Satosa keys imported"
else
  echo "satosa has loaded default keys"
fi
  1. at first line is checked that the enviroments SATOSA_PRIVATE_KEY and SATOSA_PUBLIC_KEY are present but in second line is imported SATOSA_PRIVATE_KEYS, i think thath is a my old typo error.
  2. when echo print an anviroment read the new line symbol as a space and this make not valid the certificate.

Fix

Make omogeneus the enviroments name ad insert the echo's enviroments in duble apex for respect the new lines

if [[ -v SATOSA_PRIVATE_KEY && -v SATOSA_PUBLIC_KEY ]]; then
  echo "$SATOSA_PRIVATE_KEY" > pki/privkey.pem
  echo "$SATOSA_PUBLIC_KEY" > pki/cert.pem
  echo "Satosa keys imported"
else
  echo "satosa has loaded default keys"
fi

I write a pull request for this errors